Circularmachines
commited on
Commit
•
775fea9
1
Parent(s):
42bc3b0
app.py updates
Browse files
app.py
CHANGED
@@ -22,24 +22,24 @@ ds = load_dataset("Circularmachines/batch_indexing_machine_100_small_imgs", spli
|
|
22 |
|
23 |
#"# :dart: Streamlit Image Coordinates: Image Update"
|
24 |
|
25 |
-
|
26 |
-
st.session_state["points"] = []
|
27 |
|
28 |
-
|
29 |
-
|
30 |
|
31 |
#"## Click on image"
|
32 |
|
33 |
|
34 |
r=0#np.random.randint(100)
|
35 |
-
current_image=ds[
|
36 |
|
37 |
def button_click():
|
38 |
-
|
39 |
current_image=ds[r]['image']
|
40 |
#st.write(str(r))
|
41 |
st.session_state["points"] = []
|
42 |
-
value = streamlit_image_coordinates(current_image, key="pil")
|
43 |
|
44 |
|
45 |
|
|
|
22 |
|
23 |
#"# :dart: Streamlit Image Coordinates: Image Update"
|
24 |
|
25 |
+
if "points" not in st.session_state:
|
26 |
+
st.session_state["points"] = []
|
27 |
|
28 |
+
if "img" not in st.session_state:
|
29 |
+
st.session_state["img"] = 0
|
30 |
|
31 |
#"## Click on image"
|
32 |
|
33 |
|
34 |
r=0#np.random.randint(100)
|
35 |
+
current_image=ds[st.session_state["img"]]['image']
|
36 |
|
37 |
def button_click():
|
38 |
+
st.session_state["img"]=np.random.randint(100)
|
39 |
current_image=ds[r]['image']
|
40 |
#st.write(str(r))
|
41 |
st.session_state["points"] = []
|
42 |
+
#value = streamlit_image_coordinates(current_image, key="pil")
|
43 |
|
44 |
|
45 |
|