Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ def process_image(image):
|
|
13 |
timestamp = datetime.now(ist).strftime("%Y-%m-%d %H:%M:%S IST")
|
14 |
|
15 |
if not weight or "No valid" in weight:
|
16 |
-
return "β Unable to detect. Try again with clearer image.", "", image, gr.update(visible=True)
|
17 |
|
18 |
return weight, timestamp, image, gr.update(visible=False)
|
19 |
except Exception as e:
|
@@ -33,7 +33,7 @@ with gr.Blocks(css=".gr-button {background-color: #2e7d32 !important; color: whi
|
|
33 |
|
34 |
with gr.Row():
|
35 |
weight_out = gr.Textbox(label="π¦ Detected Weight", placeholder="e.g., 97.9 kg", show_copy_button=True)
|
36 |
-
time_out = gr.Textbox(label="π Captured At (IST)", placeholder="e.g., 2025-
|
37 |
|
38 |
snapshot = gr.Image(label="πΈ Snapshot Preview")
|
39 |
retake_btn = gr.Button("π Retake / Try Again", visible=False)
|
|
|
13 |
timestamp = datetime.now(ist).strftime("%Y-%m-%d %H:%M:%S IST")
|
14 |
|
15 |
if not weight or "No valid" in weight:
|
16 |
+
return "β Unable to detect. Try again with a clearer image.", "", image, gr.update(visible=True)
|
17 |
|
18 |
return weight, timestamp, image, gr.update(visible=False)
|
19 |
except Exception as e:
|
|
|
33 |
|
34 |
with gr.Row():
|
35 |
weight_out = gr.Textbox(label="π¦ Detected Weight", placeholder="e.g., 97.9 kg", show_copy_button=True)
|
36 |
+
time_out = gr.Textbox(label="π Captured At (IST)", placeholder="e.g., 2025-07-01 12:00:00")
|
37 |
|
38 |
snapshot = gr.Image(label="πΈ Snapshot Preview")
|
39 |
retake_btn = gr.Button("π Retake / Try Again", visible=False)
|