Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
|
@@ -528,16 +528,16 @@ def main(device, segment_type):
|
|
| 528 |
|
| 529 |
if (pipe.tokenizer("man")["input_ids"][1] in pipe.tokenizer(args.prompt)["input_ids"][1:-1]) and (
|
| 530 |
pipe.tokenizer("woman")["input_ids"][1] in pipe.tokenizer(args.prompt)["input_ids"][1:-1]):
|
| 531 |
-
mask1, mask2 = predict_mask(detect_model, sam, image[0], ['man', 'woman'], args.segment_type, confidence=0.
|
| 532 |
threshold=0.5)
|
| 533 |
|
| 534 |
elif pipe.tokenizer("man")["input_ids"][1] in pipe.tokenizer(args.prompt)["input_ids"][1:-1]:
|
| 535 |
-
mask1 = predict_mask(detect_model, sam, image[0], ['man'], args.segment_type, confidence=0.
|
| 536 |
threshold=0.5)
|
| 537 |
mask2 = None
|
| 538 |
|
| 539 |
elif pipe.tokenizer("woman")["input_ids"][1] in pipe.tokenizer(args.prompt)["input_ids"][1:-1]:
|
| 540 |
-
mask2 = predict_mask(detect_model, sam, image[0], ['woman'], args.segment_type, confidence=0.
|
| 541 |
threshold=0.5)
|
| 542 |
mask1 = None
|
| 543 |
else:
|
|
|
|
| 528 |
|
| 529 |
if (pipe.tokenizer("man")["input_ids"][1] in pipe.tokenizer(args.prompt)["input_ids"][1:-1]) and (
|
| 530 |
pipe.tokenizer("woman")["input_ids"][1] in pipe.tokenizer(args.prompt)["input_ids"][1:-1]):
|
| 531 |
+
mask1, mask2 = predict_mask(detect_model, sam, image[0], ['man', 'woman'], args.segment_type, confidence=0.05,
|
| 532 |
threshold=0.5)
|
| 533 |
|
| 534 |
elif pipe.tokenizer("man")["input_ids"][1] in pipe.tokenizer(args.prompt)["input_ids"][1:-1]:
|
| 535 |
+
mask1 = predict_mask(detect_model, sam, image[0], ['man'], args.segment_type, confidence=0.05,
|
| 536 |
threshold=0.5)
|
| 537 |
mask2 = None
|
| 538 |
|
| 539 |
elif pipe.tokenizer("woman")["input_ids"][1] in pipe.tokenizer(args.prompt)["input_ids"][1:-1]:
|
| 540 |
+
mask2 = predict_mask(detect_model, sam, image[0], ['woman'], args.segment_type, confidence=0.05,
|
| 541 |
threshold=0.5)
|
| 542 |
mask1 = None
|
| 543 |
else:
|