Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,7 @@ def predict_image(image_path, model):
|
|
| 37 |
img = cv2.resize(img, img_size)
|
| 38 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
| 39 |
img = np.expand_dims(img, axis=0) # Add batch dimension
|
| 40 |
-
img = img / 255.0 # Normalize pixel values
|
| 41 |
if model == "Vgg19":
|
| 42 |
input_name = model_vgg19.get_inputs()[0].name
|
| 43 |
output_name= model_vgg19.get_outputs()[0].name
|
|
|
|
| 37 |
img = cv2.resize(img, img_size)
|
| 38 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
| 39 |
img = np.expand_dims(img, axis=0) # Add batch dimension
|
| 40 |
+
img = img.astype(np.float32) / 255.0 # Normalize pixel values
|
| 41 |
if model == "Vgg19":
|
| 42 |
input_name = model_vgg19.get_inputs()[0].name
|
| 43 |
output_name= model_vgg19.get_outputs()[0].name
|