move back to check_ocr_box
This commit is contained in:
@@ -4,7 +4,7 @@ import sys
|
||||
import os
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from utils import get_som_labeled_img, get_caption_model_processor, get_yolo_model, get_ocr_bbox
|
||||
from utils import get_som_labeled_img, get_caption_model_processor, get_yolo_model, check_ocr_box
|
||||
import torch
|
||||
from PIL import Image
|
||||
from typing import Dict, Tuple, List
|
||||
@@ -45,7 +45,7 @@ class Omniparser(object):
|
||||
}
|
||||
BOX_TRESHOLD = config['BOX_TRESHOLD']
|
||||
|
||||
text, ocr_bbox = get_ocr_bbox(image)
|
||||
(text, ocr_bbox), _ = check_ocr_box(image, display_img=False, output_bb_format='xyxy', easyocr_args={'text_threshold': 0.8}, use_paddleocr=False)
|
||||
dino_labled_img, label_coordinates, parsed_content_list = get_som_labeled_img(image, self.som_model, BOX_TRESHOLD = BOX_TRESHOLD, output_coord_in_ratio=True, ocr_bbox=ocr_bbox,draw_bbox_config=draw_bbox_config, caption_model_processor=self.caption_model_processor, ocr_text=text,use_local_semantics=True, iou_threshold=0.7, scale_img=False, batch_size=128)
|
||||
|
||||
return dino_labled_img, parsed_content_list
|
||||
|
||||
Reference in New Issue
Block a user