admin08077 commited on
Commit
13b4b26
·
verified ·
1 Parent(s): e173654

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -483,7 +483,7 @@ if uploaded_file:
483
 
484
  st.header("🖌️ Interactive Text Addition")
485
 
486
- # Display the canvas with drawable features
487
  canvas_result = st_canvas(
488
  fill_color="rgba(255, 255, 255, 0)", # Transparent fill
489
  stroke_width=0,
@@ -492,7 +492,7 @@ if uploaded_file:
492
  update_streamlit=True,
493
  height=canvas_image.height,
494
  width=canvas_image.width,
495
- drawing_mode="freedraw",
496
  key="canvas",
497
  # Hide the drawing toolbar
498
  display_toolbar=False,
@@ -524,13 +524,13 @@ if uploaded_file:
524
  'blending_mode': "Normal"
525
  }
526
  add_layer(layer)
527
- st.success("Interactive text added!")
528
  # Reset click position and text input
529
  st.session_state['click_position'] = None
530
  st.session_state['text_input'] = ""
531
  else:
532
  st.warning("Please enter some text.")
533
-
534
  # ------------------------------
535
  # Process Layers and Render Image
536
  # ------------------------------
 
483
 
484
  st.header("🖌️ Interactive Text Addition")
485
 
486
+ # Define canvas parameters
487
  canvas_result = st_canvas(
488
  fill_color="rgba(255, 255, 255, 0)", # Transparent fill
489
  stroke_width=0,
 
492
  update_streamlit=True,
493
  height=canvas_image.height,
494
  width=canvas_image.width,
495
+ drawing_mode="point",
496
  key="canvas",
497
  # Hide the drawing toolbar
498
  display_toolbar=False,
 
524
  'blending_mode': "Normal"
525
  }
526
  add_layer(layer)
527
+ st.sidebar.success("Interactive text added!")
528
  # Reset click position and text input
529
  st.session_state['click_position'] = None
530
  st.session_state['text_input'] = ""
531
  else:
532
  st.warning("Please enter some text.")
533
+
534
  # ------------------------------
535
  # Process Layers and Render Image
536
  # ------------------------------