Spaces:
Running
on
Zero
Running
on
Zero
update content
Browse files
app.py
CHANGED
|
@@ -83,7 +83,6 @@ def process(
|
|
| 83 |
dino_labled_img, label_coordinates, parsed_content_list = get_som_labeled_img(image_save_path, yolo_model, BOX_TRESHOLD = box_threshold, output_coord_in_ratio=True, ocr_bbox=ocr_bbox,draw_bbox_config=draw_bbox_config, caption_model_processor=caption_model_processor, ocr_text=text,iou_threshold=iou_threshold)
|
| 84 |
image = Image.open(io.BytesIO(base64.b64decode(dino_labled_img)))
|
| 85 |
print('finish processing')
|
| 86 |
-
parsed_content_list = '\n'.join(parsed_content_list)
|
| 87 |
|
| 88 |
# Format the coordinates output in a more readable way
|
| 89 |
# coordinates_text = "Bounding Box Coordinates (x, y, width, height):\n"
|
|
@@ -108,8 +107,11 @@ def process(
|
|
| 108 |
else:
|
| 109 |
combined_content.append(content)
|
| 110 |
|
| 111 |
-
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
|
| 115 |
with gr.Blocks() as demo:
|
|
|
|
| 83 |
dino_labled_img, label_coordinates, parsed_content_list = get_som_labeled_img(image_save_path, yolo_model, BOX_TRESHOLD = box_threshold, output_coord_in_ratio=True, ocr_bbox=ocr_bbox,draw_bbox_config=draw_bbox_config, caption_model_processor=caption_model_processor, ocr_text=text,iou_threshold=iou_threshold)
|
| 84 |
image = Image.open(io.BytesIO(base64.b64decode(dino_labled_img)))
|
| 85 |
print('finish processing')
|
|
|
|
| 86 |
|
| 87 |
# Format the coordinates output in a more readable way
|
| 88 |
# coordinates_text = "Bounding Box Coordinates (x, y, width, height):\n"
|
|
|
|
| 107 |
else:
|
| 108 |
combined_content.append(content)
|
| 109 |
|
| 110 |
+
# Join the content lists into strings
|
| 111 |
+
parsed_content_str = '\n'.join(parsed_content_list)
|
| 112 |
+
combined_content_str = '\n'.join(combined_content)
|
| 113 |
+
|
| 114 |
+
return image, parsed_content_str, combined_content_str
|
| 115 |
|
| 116 |
|
| 117 |
with gr.Blocks() as demo:
|