Spaces:
Sleeping
Sleeping
Commit
·
b671632
1
Parent(s):
e8b1d66
feat
Browse files
app.py
CHANGED
|
@@ -243,8 +243,6 @@ def count_objects(image, pos_caption, neg_caption, box_threshold, point_radius,
|
|
| 243 |
neg_queries = outputs["neg_queries"].squeeze(0).float()
|
| 244 |
pos_queries = pos_queries[-1].squeeze(0)
|
| 245 |
neg_queries = neg_queries[-1].squeeze(0)
|
| 246 |
-
pos_queries = pos_queries.cpu()
|
| 247 |
-
neg_queries = neg_queries.cpu()
|
| 248 |
pos_queries = pos_queries.unsqueeze(0)
|
| 249 |
neg_queries = neg_queries.unsqueeze(0)
|
| 250 |
results = post_process_grounded_object_detection_with_queries(outputs, pos_queries, box_threshold=threshold)[0]
|
|
@@ -268,8 +266,8 @@ def count_objects(image, pos_caption, neg_caption, box_threshold, point_radius,
|
|
| 268 |
|
| 269 |
pos_queries = results["queries"]
|
| 270 |
neg_queries = neg_results["queries"]
|
| 271 |
-
pos_queries = pos_queries.numpy()
|
| 272 |
-
neg_queries = neg_queries.numpy()
|
| 273 |
|
| 274 |
img_size = image.size
|
| 275 |
# filtered_points, kept_indices = filter_points_by_negative(
|
|
|
|
| 243 |
neg_queries = outputs["neg_queries"].squeeze(0).float()
|
| 244 |
pos_queries = pos_queries[-1].squeeze(0)
|
| 245 |
neg_queries = neg_queries[-1].squeeze(0)
|
|
|
|
|
|
|
| 246 |
pos_queries = pos_queries.unsqueeze(0)
|
| 247 |
neg_queries = neg_queries.unsqueeze(0)
|
| 248 |
results = post_process_grounded_object_detection_with_queries(outputs, pos_queries, box_threshold=threshold)[0]
|
|
|
|
| 266 |
|
| 267 |
pos_queries = results["queries"]
|
| 268 |
neg_queries = neg_results["queries"]
|
| 269 |
+
pos_queries = pos_queries.cpu().numpy()
|
| 270 |
+
neg_queries = neg_queries.cpu().numpy()
|
| 271 |
|
| 272 |
img_size = image.size
|
| 273 |
# filtered_points, kept_indices = filter_points_by_negative(
|