Fix: Update deprecated APIs and dependencies

#11
by akseljoonas HF Staff - opened
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -66,7 +66,7 @@ def process(
66
 
67
  ocr_bbox_rslt, is_goal_filtered = check_ocr_box(image_input, display_img = False, output_bb_format='xyxy', goal_filtering=None, easyocr_args={'paragraph': False, 'text_threshold':0.9}, use_paddleocr=use_paddleocr)
68
  text, ocr_bbox = ocr_bbox_rslt
69
- dino_labled_img, label_coordinates, parsed_content_list = get_som_labeled_img(image_input, 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, imgsz=imgsz,)
70
  image = Image.open(io.BytesIO(base64.b64decode(dino_labled_img)))
71
  print('finish processing')
72
  parsed_content_list = '\n'.join([f'icon {i}: ' + str(v) for i,v in enumerate(parsed_content_list)])
@@ -107,6 +107,6 @@ with gr.Blocks() as demo:
107
  outputs=[image_output_component, text_output_component]
108
  )
109
 
110
- # demo.launch(debug=False, show_error=True, share=True)
111
- # demo.launch(share=True, server_port=7861, server_name='0.0.0.0')
112
  demo.queue().launch(share=False)
 
66
 
67
  ocr_bbox_rslt, is_goal_filtered = check_ocr_box(image_input, display_img = False, output_bb_format='xyxy', goal_filtering=None, easyocr_args={'paragraph': False, 'text_threshold':0.9}, use_paddleocr=use_paddleocr)
68
  text, ocr_bbox = ocr_bbox_rslt
69
+ dino_labled_img, label_coordinates, parsed_content_list = get_som_labeled_img(image_input, 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, imgsz=imgsz)
70
  image = Image.open(io.BytesIO(base64.b64decode(dino_labled_img)))
71
  print('finish processing')
72
  parsed_content_list = '\n'.join([f'icon {i}: ' + str(v) for i,v in enumerate(parsed_content_list)])
 
107
  outputs=[image_output_component, text_output_component]
108
  )
109
 
110
+ # demo.launch(debug=False, show_error=True)
111
+ # demo.launch( server_port=7861, server_name='0.0.0.0')
112
  demo.queue().launch(share=False)