Spaces:
Running
Running
file added
Browse files
pred.py
CHANGED
@@ -21,9 +21,12 @@ transform = transforms.Compose([
|
|
21 |
])
|
22 |
im = transform(image).unsqueeze(0) # Add batch dimension (BCHW)
|
23 |
|
24 |
-
|
25 |
-
output = model(im)
|
26 |
-
|
|
|
|
|
|
|
27 |
|
28 |
# Get predictions
|
29 |
with torch.no_grad():
|
|
|
21 |
])
|
22 |
im = transform(image).unsqueeze(0) # Add batch dimension (BCHW)
|
23 |
|
24 |
+
try:
|
25 |
+
output = model(im)
|
26 |
+
print(output)
|
27 |
+
except Exception as e:
|
28 |
+
logger.error(f"Error in image prediction: {e}")
|
29 |
+
|
30 |
|
31 |
# Get predictions
|
32 |
with torch.no_grad():
|