Spaces:
Build error
Build error
Commit
·
186e7ec
1
Parent(s):
f6b4d98
app.py updates
Browse files
app.py
CHANGED
|
@@ -63,10 +63,9 @@ def get_ellipse_coords(point):# tuple[int, int]) -> tuple[int, int, int, int]):
|
|
| 63 |
if st.session_state["draw"]:
|
| 64 |
|
| 65 |
# Draw an ellipse at each coordinate in points
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
draw.rectangle(coords, outline="green",width=2)
|
| 70 |
|
| 71 |
value = streamlit_image_coordinates(current_image, key="pil")
|
| 72 |
|
|
@@ -74,7 +73,7 @@ if value is not None:
|
|
| 74 |
point = value["x"], value["y"]
|
| 75 |
|
| 76 |
if point not in st.session_state["points"]:
|
| 77 |
-
st.session_state["points"]=point
|
| 78 |
st.session_state["draw"]=True
|
| 79 |
st.experimental_rerun()
|
| 80 |
|
|
|
|
| 63 |
if st.session_state["draw"]:
|
| 64 |
|
| 65 |
# Draw an ellipse at each coordinate in points
|
| 66 |
+
for point in st.session_state["points"]:
|
| 67 |
+
coords = get_ellipse_coords(point)
|
| 68 |
+
draw.rectangle(coords, outline="green",width=2)
|
|
|
|
| 69 |
|
| 70 |
value = streamlit_image_coordinates(current_image, key="pil")
|
| 71 |
|
|
|
|
| 73 |
point = value["x"], value["y"]
|
| 74 |
|
| 75 |
if point not in st.session_state["points"]:
|
| 76 |
+
st.session_state["points"]=[point]
|
| 77 |
st.session_state["draw"]=True
|
| 78 |
st.experimental_rerun()
|
| 79 |
|