Astridkraft commited on
Commit
8665379
·
verified ·
1 Parent(s): fa064ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -452,10 +452,19 @@ def main_ui():
452
  with gr.Column():
453
  img_input = gr.Image(
454
  type="pil",
455
- label="Eingabebild mit Masken-Vorschau",
456
  height=300,
457
- sources=["upload"] # Nur Upload-Button anzeigen
458
  )
 
 
 
 
 
 
 
 
 
459
  with gr.Column():
460
  gr.Markdown("**📐 Masken-Koordinaten**")
461
  with gr.Row():
@@ -527,11 +536,11 @@ def main_ui():
527
  type="pil"
528
  )
529
 
530
- # Event-Handler für Bild-Upload - Jetzt MIT Vorschau
531
  img_input.change(
532
  fn=update_bbox_from_image,
533
  inputs=[img_input],
534
- outputs=[bbox_x1, bbox_y1, bbox_x2, bbox_y2, img_input]
535
  )
536
 
537
  # Event-Handler für Live-Masken-Vorschau bei Koordinaten-Änderungen
@@ -541,7 +550,7 @@ def main_ui():
541
  coordinate.change(
542
  fn=create_mask_preview,
543
  inputs=[img_input] + coordinates_inputs,
544
- outputs=img_input
545
  )
546
 
547
  transform_btn.click(
 
452
  with gr.Column():
453
  img_input = gr.Image(
454
  type="pil",
455
+ label="Eingabebild",
456
  height=300,
457
+ sources=["upload"]
458
  )
459
+ with gr.Column():
460
+ img_preview = gr.Image(
461
+ type="pil",
462
+ label="Masken-Vorschau",
463
+ height=300,
464
+ interactive=False
465
+ )
466
+
467
+ with gr.Row():
468
  with gr.Column():
469
  gr.Markdown("**📐 Masken-Koordinaten**")
470
  with gr.Row():
 
536
  type="pil"
537
  )
538
 
539
+ # Event-Handler für Bild-Upload - Jetzt MIT separater Vorschau
540
  img_input.change(
541
  fn=update_bbox_from_image,
542
  inputs=[img_input],
543
+ outputs=[bbox_x1, bbox_y1, bbox_x2, bbox_y2, img_preview]
544
  )
545
 
546
  # Event-Handler für Live-Masken-Vorschau bei Koordinaten-Änderungen
 
550
  coordinate.change(
551
  fn=create_mask_preview,
552
  inputs=[img_input] + coordinates_inputs,
553
+ outputs=img_preview
554
  )
555
 
556
  transform_btn.click(