Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,17 +12,17 @@ def process_image(img):
|
|
12 |
return f"{weight} g (Confidence: {confidence}%)", ist_time, img
|
13 |
|
14 |
with gr.Blocks(title="βοΈ Auto Weight Logger") as demo:
|
15 |
-
gr.
|
16 |
-
|
17 |
-
with gr.Row():
|
18 |
image_input = gr.Image(type="pil", label="π· Upload or Capture Image")
|
19 |
-
output_weight = gr.Textbox(label="βοΈ Detected Weight")
|
20 |
|
21 |
-
|
22 |
-
|
|
|
|
|
23 |
snapshot = gr.Image(label="πΈ Snapshot Image")
|
24 |
|
25 |
-
|
26 |
-
|
27 |
|
28 |
demo.launch()
|
|
|
12 |
return f"{weight} g (Confidence: {confidence}%)", ist_time, img
|
13 |
|
14 |
with gr.Blocks(title="βοΈ Auto Weight Logger") as demo:
|
15 |
+
with gr.Column():
|
16 |
+
gr.Markdown("## βοΈ Auto Weight Logger")
|
|
|
17 |
image_input = gr.Image(type="pil", label="π· Upload or Capture Image")
|
|
|
18 |
|
19 |
+
with gr.Row():
|
20 |
+
output_weight = gr.Textbox(label="βοΈ Detected Weight")
|
21 |
+
timestamp = gr.Textbox(label="π Captured At (IST)")
|
22 |
+
|
23 |
snapshot = gr.Image(label="πΈ Snapshot Image")
|
24 |
|
25 |
+
submit = gr.Button("π Detect Weight")
|
26 |
+
submit.click(process_image, inputs=image_input, outputs=[output_weight, timestamp, snapshot])
|
27 |
|
28 |
demo.launch()
|