milliyin commited on
Commit
1d8a0ce
Β·
verified Β·
1 Parent(s): 42b1c23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -45
app.py CHANGED
@@ -287,52 +287,46 @@ with gr.Blocks(css=custom_css, title="Jewellery Photography Preview") as demo:
287
  status_html.value = _update_status()
288
  gr.Button("πŸ”„ Check Status").click(fn=_update_status, outputs=status_html)
289
 
290
- # 2‑column layout
291
- with gr.Row():
292
- # left inputs
293
- with gr.Column(scale=0.4):
294
- gr.HTML("""
295
- <div class="feature-box"">
296
- <h3>πŸ–ΌοΈ Upload Jewellery Image</h3>
297
- <p style="color: #666; font-size: 14px;">Select a clear jewellery image for best results</p>
298
- </div>
299
- """)
300
- with gr.Tabs():
301
- with gr.TabItem("Setting"):
302
- category = gr.Dropdown(label="Jewellery category", choices=["Rings", "Bracelets", "Watches", "Earrings"], value="Bracelets")
303
- gender = gr.Dropdown(label="Model gender", choices=["male", "female"], value="female")
304
- input_img = gr.Image(label="Upload image", type="pil", height=400)
305
-
306
- # Example images
307
- gr.Examples(
308
- examples=[
309
- ["examples/ring1.jpg"],
310
- ["examples/bracelet1.jpg"],
311
- ["examples/watch1.jpg"],
312
- ["examples/earring1.jpg"],
313
- ],
314
- inputs=[input_img],
315
- label="Example Images",
316
- )
317
-
318
- # right outputs
319
- with gr.Column():
320
- gr.HTML("""
321
- <div class="feature-box">
322
- <h3>🎨 AI Generated Results</h3>
323
- <p style="color: #666; font-size: 14px;">Preview overlay detection and final professional background</p>
324
- </div>
325
- """)
326
- info = gr.Markdown(value="...")
327
  with gr.Row():
328
- run_btn = gr.Button("🎯 Generate", elem_id="button", variant="primary")
329
- with gr.tabs():
330
- with gr.TabItem():
331
- info2 = gr.Markdown(value="### Final result")
332
- out_bg = gr.Image(height=400)
333
- with gr.TabItem():
334
- info1 = gr.Markdown(value="### Detection overlay")
335
- out_overlay = gr.Image(height=400)
336
  out_status = gr.Text(label="Status", interactive=False)
337
  # ──────── Footer ────────
338
  gr.HTML("""
 
287
  status_html.value = _update_status()
288
  gr.Button("πŸ”„ Check Status").click(fn=_update_status, outputs=status_html)
289
 
290
+ with gr.Column():
291
+ with gr.Row():
292
+
293
+ with gr.Column(scale=0.4):
294
+ gr.HTML("""
295
+ <div class="feature-box"">
296
+ <h3>πŸ–ΌοΈ Upload Jewellery Image</h3>
297
+ <p style="color: #666; font-size: 14px;">Select a clear jewellery image for best results</p>
298
+ </div>
299
+ """)
300
+ gr.Markdown("β€Ž")
301
+ gr.Markdown("β€Ž")
302
+ input_img = gr.Image(label="Upload image", type="pil", height=400)
303
+
304
+ # with gr.Column():
305
+
306
+ with gr.Column():
307
+ gr.HTML("""
308
+ <div class="feature-box">
309
+ <h3>🎨 AI Generated Results</h3>
310
+ <p style="color: #666; font-size: 14px;">Preview overlay detection and final professional background</p>
311
+ </div>
312
+ """)
313
+
314
+ with gr.Tabs():
315
+ with gr.TabItem("Final result"):
316
+ info2 = gr.Markdown(value="### Final result")
317
+ out_bg = gr.Image(height=400)
318
+ with gr.TabItem("Detection overlay"):
319
+ info1 = gr.Markdown(value="### Detection overlay")
320
+ out_overlay = gr.Image(height=400)
321
+ run_btn = gr.Button("🎯 Generate", elem_id="button", variant="primary")
322
+
 
 
 
 
323
  with gr.Row():
324
+ with gr.Column(scale=0.4):
325
+ gr.Markdown(value="Setting")
326
+ category = gr.Dropdown(label="Jewellery category", choices=["Rings", "Bracelets", "Watches", "Earrings"], value="Bracelets")
327
+ gender = gr.Dropdown(label="Model gender", choices=["male", "female"], value="female")
328
+
329
+
 
 
330
  out_status = gr.Text(label="Status", interactive=False)
331
  # ──────── Footer ────────
332
  gr.HTML("""