Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -96,7 +96,7 @@ def extract_weight(img):
|
|
96 |
if weight:
|
97 |
try:
|
98 |
weight_float = float(weight)
|
99 |
-
if weight_float >= 0: # Only accept
|
100 |
confidence = 95.0 # Assume high confidence if we have a valid weight
|
101 |
logging.info(f"Weight detected: {weight} (Confidence: {confidence:.2f}%)")
|
102 |
return weight, confidence, processed_img
|
|
|
96 |
if weight:
|
97 |
try:
|
98 |
weight_float = float(weight)
|
99 |
+
if weight_float >= 0 and weight_float <= 500: # Only accept reasonable weight values
|
100 |
confidence = 95.0 # Assume high confidence if we have a valid weight
|
101 |
logging.info(f"Weight detected: {weight} (Confidence: {confidence:.2f}%)")
|
102 |
return weight, confidence, processed_img
|