push app
Browse files
app.py
CHANGED
|
@@ -88,24 +88,23 @@ if picture is not None:
|
|
| 88 |
# Use the canvas container for all related UI elements
|
| 89 |
with canvas.container():
|
| 90 |
# canvas.image(img, caption="Captured (512x512) Image", use_container_width=True)
|
| 91 |
-
|
| 92 |
# Place the interactive component inside the same container
|
| 93 |
if 'dotted_image' not in st.session_state:
|
| 94 |
img_to_dot = img
|
| 95 |
else:
|
| 96 |
img_to_dot = st.session_state.dotted_image
|
| 97 |
coords = streamlit_image_coordinates(img_to_dot, key="click_img")
|
| 98 |
-
|
| 99 |
if coords:
|
| 100 |
cx, cy = int(coords['x']), int(coords['y'])
|
| 101 |
# Draw a red circle on the image to indicate the selected point
|
| 102 |
-
img_with_dot = img.copy()
|
| 103 |
draw = ImageDraw.Draw(img_with_dot)
|
| 104 |
draw.ellipse((cx-5, cy-5, cx+5, cy+5), fill='red')
|
| 105 |
# canvas.image(img_with_dot, caption=f"Selected Point: ({cx}, {cy})", use_container_width=True)
|
| 106 |
-
|
| 107 |
else:
|
| 108 |
cx = cy = None
|
|
|
|
| 109 |
|
| 110 |
# Prompt input for inpainting
|
| 111 |
prompt = st.text_input("Prompt for inpainting (describe what should replace the selected area):")
|
|
|
|
| 88 |
# Use the canvas container for all related UI elements
|
| 89 |
with canvas.container():
|
| 90 |
# canvas.image(img, caption="Captured (512x512) Image", use_container_width=True)
|
|
|
|
| 91 |
# Place the interactive component inside the same container
|
| 92 |
if 'dotted_image' not in st.session_state:
|
| 93 |
img_to_dot = img
|
| 94 |
else:
|
| 95 |
img_to_dot = st.session_state.dotted_image
|
| 96 |
coords = streamlit_image_coordinates(img_to_dot, key="click_img")
|
| 97 |
+
img_with_dot = img.copy()
|
| 98 |
if coords:
|
| 99 |
cx, cy = int(coords['x']), int(coords['y'])
|
| 100 |
# Draw a red circle on the image to indicate the selected point
|
|
|
|
| 101 |
draw = ImageDraw.Draw(img_with_dot)
|
| 102 |
draw.ellipse((cx-5, cy-5, cx+5, cy+5), fill='red')
|
| 103 |
# canvas.image(img_with_dot, caption=f"Selected Point: ({cx}, {cy})", use_container_width=True)
|
| 104 |
+
|
| 105 |
else:
|
| 106 |
cx = cy = None
|
| 107 |
+
st.session_state.dotted_image = img_with_dot
|
| 108 |
|
| 109 |
# Prompt input for inpainting
|
| 110 |
prompt = st.text_input("Prompt for inpainting (describe what should replace the selected area):")
|