Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,8 @@ def anylize(img):
|
|
15 |
outputs = model(**inputs)
|
16 |
|
17 |
#target_sizes = torch.tensor([image.size])
|
18 |
-
|
19 |
-
target_sizes = torch.tensor([image.shape[:2]])
|
20 |
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0]
|
21 |
|
22 |
print(f"results: {results}")
|
|
|
15 |
outputs = model(**inputs)
|
16 |
|
17 |
#target_sizes = torch.tensor([image.size])
|
18 |
+
target_sizes = torch.tensor([image.size[::-1]])
|
19 |
+
#target_sizes = torch.tensor([image.shape[:2]])
|
20 |
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0]
|
21 |
|
22 |
print(f"results: {results}")
|