Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -193,8 +193,6 @@ def count_objects(image, pos_caption, neg_caption, box_threshold, point_radius,
|
|
| 193 |
# Ensure captions end with period
|
| 194 |
if not pos_caption.endswith('.'):
|
| 195 |
pos_caption = pos_caption + '.'
|
| 196 |
-
if neg_caption is None:
|
| 197 |
-
neg_caption = "None."
|
| 198 |
if neg_caption and not neg_caption.endswith('.'):
|
| 199 |
neg_caption = neg_caption + '.'
|
| 200 |
|
|
@@ -210,9 +208,12 @@ def count_objects(image, pos_caption, neg_caption, box_threshold, point_radius,
|
|
| 210 |
|
| 211 |
# Process negative caption if provided
|
| 212 |
use_neg = bool(neg_caption and neg_caption.strip() and neg_caption != '.')
|
| 213 |
-
|
| 214 |
|
| 215 |
if use_neg:
|
|
|
|
|
|
|
|
|
|
| 216 |
neg_inputs = processor(
|
| 217 |
images=image,
|
| 218 |
text=neg_caption,
|
|
|
|
| 193 |
# Ensure captions end with period
|
| 194 |
if not pos_caption.endswith('.'):
|
| 195 |
pos_caption = pos_caption + '.'
|
|
|
|
|
|
|
| 196 |
if neg_caption and not neg_caption.endswith('.'):
|
| 197 |
neg_caption = neg_caption + '.'
|
| 198 |
|
|
|
|
| 208 |
|
| 209 |
# Process negative caption if provided
|
| 210 |
use_neg = bool(neg_caption and neg_caption.strip() and neg_caption != '.')
|
| 211 |
+
|
| 212 |
|
| 213 |
if use_neg:
|
| 214 |
+
print('neg_caption: ', neg_caption)
|
| 215 |
+
if neg_caption is None:
|
| 216 |
+
neg_caption = "None."
|
| 217 |
neg_inputs = processor(
|
| 218 |
images=image,
|
| 219 |
text=neg_caption,
|