Circularmachines commited on
Commit
7232430
·
1 Parent(s): 6512185

app.py updates

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -57,17 +57,18 @@ draw = ImageDraw.Draw(current_image)
57
  if st.session_state["draw"]:
58
 
59
  # Draw an ellipse at each coordinate in points
60
- for point in st.session_state["points"]:
61
- coords = get_ellipse_coords(point)
62
- draw.rectangle(coords, outline="green",width=2)
 
63
 
64
  value = streamlit_image_coordinates(current_image, key="pil")
65
 
66
  if value is not None:
67
  point = value["x"], value["y"]
68
 
69
- if point not in st.session_state["points"]:
70
- st.session_state["points"]=[point]
71
  st.session_state["draw"]=True
72
  st.experimental_rerun()
73
 
 
57
  if st.session_state["draw"]:
58
 
59
  # Draw an ellipse at each coordinate in points
60
+ #for point in st.session_state["points"]:
61
+ point=st.session_state["points"]
62
+ coords = get_ellipse_coords(point)
63
+ draw.rectangle(coords, outline="green",width=2)
64
 
65
  value = streamlit_image_coordinates(current_image, key="pil")
66
 
67
  if value is not None:
68
  point = value["x"], value["y"]
69
 
70
+ if point != st.session_state["points"]:
71
+ st.session_state["points"]=point
72
  st.session_state["draw"]=True
73
  st.experimental_rerun()
74