Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,8 @@ def classify(image_path):
|
|
30 |
try:
|
31 |
image_data = np.array(image_path)
|
32 |
# image = cv.imread(image_path)
|
33 |
-
|
34 |
-
image_array = np.asarray(
|
35 |
normalized_image_array = (image_array.astype(np.float32) / 127.0) - 1
|
36 |
data[0] = normalized_image_array
|
37 |
prediction = model.predict(data)
|
@@ -79,4 +79,4 @@ iface = gr.Interface(
|
|
79 |
title="Waste Classifier",
|
80 |
description="Upload an image to classify and get disposal instructions."
|
81 |
)
|
82 |
-
iface.launch()
|
|
|
30 |
try:
|
31 |
image_data = np.array(image_path)
|
32 |
# image = cv.imread(image_path)
|
33 |
+
image_data = cv.resize(image_data, (224, 224))
|
34 |
+
image_array = np.asarray(image_data)
|
35 |
normalized_image_array = (image_array.astype(np.float32) / 127.0) - 1
|
36 |
data[0] = normalized_image_array
|
37 |
prediction = model.predict(data)
|
|
|
79 |
title="Waste Classifier",
|
80 |
description="Upload an image to classify and get disposal instructions."
|
81 |
)
|
82 |
+
iface.launch()
|