Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -95,6 +95,10 @@ def predict_hemoglobin(age, gender, image):
|
|
95 |
if image is None:
|
96 |
return "Error: No image uploaded. Please upload an image."
|
97 |
|
|
|
|
|
|
|
|
|
98 |
# Extract features from the image
|
99 |
features = extract_features(image)
|
100 |
|
|
|
95 |
if image is None:
|
96 |
return "Error: No image uploaded. Please upload an image."
|
97 |
|
98 |
+
# Check if the image is valid
|
99 |
+
if not isinstance(image, Image.Image):
|
100 |
+
return "Error: Invalid image format. Please upload a valid image file."
|
101 |
+
|
102 |
# Extract features from the image
|
103 |
features = extract_features(image)
|
104 |
|