derekalia commited on
Commit
5f56249
·
1 Parent(s): 69842c6
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -80,12 +80,12 @@ def process(
80
  ocr_bbox_rslt, is_goal_filtered = check_ocr_box(image_save_path, display_img = False, output_bb_format='xyxy', goal_filtering=None, easyocr_args={'paragraph': False, 'text_threshold':0.9}, use_paddleocr=True)
81
  text, ocr_bbox = ocr_bbox_rslt
82
  # print('prompt:', prompt)
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=False, 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"
90
  # for box_id, coords in sorted(label_coordinates.items(), key=lambda x: int(x[0])):
91
  # # Convert numpy array to list and round values
 
80
  ocr_bbox_rslt, is_goal_filtered = check_ocr_box(image_save_path, display_img = False, output_bb_format='xyxy', goal_filtering=None, easyocr_args={'paragraph': False, 'text_threshold':0.9}, use_paddleocr=True)
81
  text, ocr_bbox = ocr_bbox_rslt
82
  # print('prompt:', prompt)
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"
90
  # for box_id, coords in sorted(label_coordinates.items(), key=lambda x: int(x[0])):
91
  # # Convert numpy array to list and round values