AkshitShubham commited on
Commit
868cb43
·
verified ·
1 Parent(s): 10966fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -1
app.py CHANGED
@@ -300,4 +300,24 @@ iface = gr.Interface(
300
  ),
301
  gr.Slider(minimum=0.001, maximum=0.1, value=0.01, label="Line Simplification Factor", info="Controls line detail for 'Plain Lines' mode. Lower values = more detailed lines."),
302
  gr.Dropdown(
303
- label="Default Fill Styl
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  ),
301
  gr.Slider(minimum=0.001, maximum=0.1, value=0.01, label="Line Simplification Factor", info="Controls line detail for 'Plain Lines' mode. Lower values = more detailed lines."),
302
  gr.Dropdown(
303
+ label="Default Fill Style",
304
+ choices=['solid', 'cross-hatch', 'dots', 'hachure'],
305
+ value="solid", # Default to solid
306
+ info="Default fill style for detected geometric shapes."
307
+ ),
308
+ gr.Textbox(
309
+ label="Color-Specific Rules (JSON)",
310
+ value='{}', # Default empty JSON
311
+ info='Optional JSON: {"#RRGGBB": {"mode": "Plain Lines", "simplify_factor": 0.005}, "#AABBCC": {"mode": "Geometric Shapes", "fill_style": "hachure"}}'
312
+ )
313
+ ],
314
+ outputs=gr.Textbox(label="Excalidraw JSON Output (Copy & Paste into Excalidraw)"),
315
+ title="Excalidraw Universal Shape Detector & Tracer",
316
+ description="Upload an image. This tool will detect shapes and lines of all colors, "
317
+ "and convert them into Excalidraw elements. You can control the detection "
318
+ "sensitivity and choose between raw lines or approximated geometric shapes, "
319
+ "and even define color-specific processing rules."
320
+ )
321
+
322
+ if __name__ == "__main__":
323
+ iface.launch()