sunil18p31a0101 commited on
Commit
7b18cbe
·
verified ·
1 Parent(s): bb32dda

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
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