Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,7 +52,7 @@ model.eval() # Set the model to evaluation mode
|
|
| 52 |
def preprocess_image(image):
|
| 53 |
#img0 = cv2.imread(image_path)
|
| 54 |
#img = letterbox(img0, 640, stride=32, auto=True)[0] # Resize and pad to 640x640
|
| 55 |
-
img0 = letterbox(
|
| 56 |
img = img.transpose(2, 0, 1)[::-1] # Convert BGR to RGB, to 3x416x416
|
| 57 |
img = np.ascontiguousarray(img)
|
| 58 |
img = torch.from_numpy(img).to(device)
|
|
|
|
| 52 |
def preprocess_image(image):
|
| 53 |
#img0 = cv2.imread(image_path)
|
| 54 |
#img = letterbox(img0, 640, stride=32, auto=True)[0] # Resize and pad to 640x640
|
| 55 |
+
img0 = letterbox(image, 640, stride=32, auto=True)[0] # Resize and pad to 640x640
|
| 56 |
img = img.transpose(2, 0, 1)[::-1] # Convert BGR to RGB, to 3x416x416
|
| 57 |
img = np.ascontiguousarray(img)
|
| 58 |
img = torch.from_numpy(img).to(device)
|