Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -81,7 +81,7 @@ def query(image, confidence_threshold):
|
|
81 |
inputs = processor(images=image, return_tensors="pt").to(device)
|
82 |
with torch.no_grad():
|
83 |
outputs = model(**inputs)
|
84 |
-
target_sizes = torch.Tensor([np.array(image).shape[
|
85 |
|
86 |
results = processor.post_process_object_detection(outputs=outputs, threshold=confidence_threshold, target_sizes=target_sizes)
|
87 |
return results
|
|
|
81 |
inputs = processor(images=image, return_tensors="pt").to(device)
|
82 |
with torch.no_grad():
|
83 |
outputs = model(**inputs)
|
84 |
+
target_sizes = torch.Tensor([np.array(image).shape[::-1]])
|
85 |
|
86 |
results = processor.post_process_object_detection(outputs=outputs, threshold=confidence_threshold, target_sizes=target_sizes)
|
87 |
return results
|