Spaces:
Build error
Build error
Commit
·
f6b4d98
1
Parent(s):
2fac645
app.py updates
Browse files
app.py
CHANGED
|
@@ -63,9 +63,10 @@ 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 |
-
for point in st.session_state["points"]:
|
| 67 |
-
|
| 68 |
-
|
|
|
|
| 69 |
|
| 70 |
value = streamlit_image_coordinates(current_image, key="pil")
|
| 71 |
|
|
@@ -73,7 +74,7 @@ if value is not None:
|
|
| 73 |
point = value["x"], value["y"]
|
| 74 |
|
| 75 |
if point not in st.session_state["points"]:
|
| 76 |
-
st.session_state["points"]=
|
| 77 |
st.session_state["draw"]=True
|
| 78 |
st.experimental_rerun()
|
| 79 |
|
|
|
|
| 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 |
+
point=st.session_state["points"]
|
| 68 |
+
coords = get_ellipse_coords(point)
|
| 69 |
+
draw.rectangle(coords, outline="green",width=2)
|
| 70 |
|
| 71 |
value = streamlit_image_coordinates(current_image, key="pil")
|
| 72 |
|
|
|
|
| 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 |
|