Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -353,14 +353,14 @@ def classify(platform, UserInput, Image, Textbox2, Textbox3):
|
|
353 |
}
|
354 |
if platform == "wh":
|
355 |
get_image = requests.get(Image, headers=headers)
|
356 |
-
|
357 |
elif platform == "web":
|
358 |
print("WEB")
|
359 |
# Handle web case if needed
|
360 |
else:
|
361 |
pass
|
362 |
|
363 |
-
image_data = cv.resize(
|
364 |
normalized_image_array = (image_data.astype(np.float32) / 127.0) - 1
|
365 |
data[0] = normalized_image_array
|
366 |
|
|
|
353 |
}
|
354 |
if platform == "wh":
|
355 |
get_image = requests.get(Image, headers=headers)
|
356 |
+
imageData = cv.imdecode(np.asarray(bytearray(get_image.content), dtype="uint8"), cv.IMREAD_COLOR)
|
357 |
elif platform == "web":
|
358 |
print("WEB")
|
359 |
# Handle web case if needed
|
360 |
else:
|
361 |
pass
|
362 |
|
363 |
+
image_data = cv.resize(imageData, (224, 224))
|
364 |
normalized_image_array = (image_data.astype(np.float32) / 127.0) - 1
|
365 |
data[0] = normalized_image_array
|
366 |
|