Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ def predict_image(image: Image.Image):
|
|
| 12 |
try:
|
| 13 |
# Step 1: Preprocess the image with padding and ensure it is batched
|
| 14 |
inputs = processor(images=image, return_tensors="pt", padding=True)
|
| 15 |
-
|
| 16 |
# Step 2: Run inference (no gradients)
|
| 17 |
with torch.no_grad():
|
| 18 |
outputs = model(**inputs)
|
|
|
|
| 12 |
try:
|
| 13 |
# Step 1: Preprocess the image with padding and ensure it is batched
|
| 14 |
inputs = processor(images=image, return_tensors="pt", padding=True)
|
| 15 |
+
|
| 16 |
# Step 2: Run inference (no gradients)
|
| 17 |
with torch.no_grad():
|
| 18 |
outputs = model(**inputs)
|