mjohanes commited on
Commit
b5ebf86
·
1 Parent(s): a6e60bd
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -162,10 +162,11 @@ else:
162
  new_coord = streamlit_image_coordinates(final_img, key="click_img", use_column_width="always")
163
 
164
  # Remap from displayed coordinate to original coordinate
165
- new_coord = {
166
- "x": new_coord["x"] * scale_factor,
167
- "y": new_coord["y"] * scale_factor
168
- }
 
169
 
170
  # If a new coordinate is received and it's not already in our list, add it and force a rerun.
171
  if new_coord and new_coord not in st.session_state.coords_list and not st.session_state.is_removing_dot:
 
162
  new_coord = streamlit_image_coordinates(final_img, key="click_img", use_column_width="always")
163
 
164
  # Remap from displayed coordinate to original coordinate
165
+ if new_coord:
166
+ new_coord = {
167
+ "x": new_coord["x"] * scale_factor,
168
+ "y": new_coord["y"] * scale_factor
169
+ }
170
 
171
  # If a new coordinate is received and it's not already in our list, add it and force a rerun.
172
  if new_coord and new_coord not in st.session_state.coords_list and not st.session_state.is_removing_dot: