Spaces:
Running
on
Zero
Running
on
Zero
remove autocast
Browse files
app.py
CHANGED
|
@@ -101,12 +101,7 @@ def detect(
|
|
| 101 |
inputs = bundle.processor(images=image, text=texts, return_tensors="pt").to(DEVICE)
|
| 102 |
|
| 103 |
with torch.inference_mode():
|
| 104 |
-
|
| 105 |
-
# Use autocast to speed up mixed-precision-friendly ops
|
| 106 |
-
with torch.amp.autocast():
|
| 107 |
-
outputs = bundle.model(**inputs)
|
| 108 |
-
else:
|
| 109 |
-
outputs = bundle.model(**inputs)
|
| 110 |
|
| 111 |
results = bundle.processor.post_process_grounded_object_detection(
|
| 112 |
outputs, threshold=threshold, target_sizes=[image.size[::-1]]
|
|
|
|
| 101 |
inputs = bundle.processor(images=image, text=texts, return_tensors="pt").to(DEVICE)
|
| 102 |
|
| 103 |
with torch.inference_mode():
|
| 104 |
+
outputs = bundle.model(**inputs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
results = bundle.processor.post_process_grounded_object_detection(
|
| 107 |
outputs, threshold=threshold, target_sizes=[image.size[::-1]]
|