Spaces:
Paused
Paused
Commit
·
9863e05
1
Parent(s):
3260133
Update app.py
Browse files
app.py
CHANGED
|
@@ -559,8 +559,15 @@ def run_anything_task(input_image, text_prompt, box_threshold, text_threshold,
|
|
| 559 |
plt.savefig(image_path, bbox_inches="tight")
|
| 560 |
segment_image_result = cv2.cvtColor(cv2.imread(image_path), cv2.COLOR_BGR2RGB)
|
| 561 |
os.remove(image_path)
|
| 562 |
-
output_images.append(segment_image_result)
|
| 563 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 564 |
return pred_dict, output_images, gr.Gallery.update(label='result images')
|
| 565 |
|
| 566 |
if __name__ == "__main__":
|
|
|
|
| 559 |
plt.savefig(image_path, bbox_inches="tight")
|
| 560 |
segment_image_result = cv2.cvtColor(cv2.imread(image_path), cv2.COLOR_BGR2RGB)
|
| 561 |
os.remove(image_path)
|
| 562 |
+
output_images.append(segment_image_result)
|
| 563 |
+
|
| 564 |
+
result_list = []
|
| 565 |
+
for i, box in enumerate(boxes_filt):
|
| 566 |
+
label, score = pred_phrases[i][:-5], float(pred_phrases[i][-4:-1]) # assuming 'roof(0.70)' format
|
| 567 |
+
print("label: " + label)
|
| 568 |
+
print("score: " + score)
|
| 569 |
+
print(box.tolist())
|
| 570 |
+
|
| 571 |
return pred_dict, output_images, gr.Gallery.update(label='result images')
|
| 572 |
|
| 573 |
if __name__ == "__main__":
|