Spaces:
Sleeping
Sleeping
Update api.py
Browse files
api.py
CHANGED
|
@@ -225,7 +225,7 @@ async def classify(image: UploadFile = File(...)):
|
|
| 225 |
|
| 226 |
# Crop the image based on bounding box
|
| 227 |
cropped_image = results[0].orig_img[int(y1):int(y2), int(x1):int(x2)]
|
| 228 |
-
|
| 229 |
cropped_image = cropped_image.resize((64,64))
|
| 230 |
img_array = np.array(cropped_image) / 255.0
|
| 231 |
img_array = np.expand_dims(img_array, axis=0)
|
|
|
|
| 225 |
|
| 226 |
# Crop the image based on bounding box
|
| 227 |
cropped_image = results[0].orig_img[int(y1):int(y2), int(x1):int(x2)]
|
| 228 |
+
cropped_image = Image.fromarray(cropped_image)
|
| 229 |
cropped_image = cropped_image.resize((64,64))
|
| 230 |
img_array = np.array(cropped_image) / 255.0
|
| 231 |
img_array = np.expand_dims(img_array, axis=0)
|