Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
|
|
| 11 |
def predict_image(image: Image.Image):
|
| 12 |
try:
|
| 13 |
# Step 1: Use DETR for object detection
|
| 14 |
-
inputs = processor(images=image, return_tensors="pt")
|
| 15 |
|
| 16 |
with torch.no_grad():
|
| 17 |
outputs = model(**inputs)
|
|
|
|
| 11 |
def predict_image(image: Image.Image):
|
| 12 |
try:
|
| 13 |
# Step 1: Use DETR for object detection
|
| 14 |
+
inputs = processor(images=image, return_tensors="pt", padding=True)
|
| 15 |
|
| 16 |
with torch.no_grad():
|
| 17 |
outputs = model(**inputs)
|