Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove dependency #1536

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions deepdoc/vision/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import onnxruntime as ort

from .postprocess import build_post_process
from rag.settings import cron_logger


def transform(data, ops=None):
Expand Down Expand Up @@ -566,9 +565,6 @@ def detect(self, img):
end = time.time()
time_dict['all'] = end - start
return None, None, time_dict
else:
cron_logger.debug("dt_boxes num : {}, elapsed : {}".format(
len(dt_boxes), elapse))

return zip(self.sorted_boxes(dt_boxes), [
("", 0) for _ in range(len(dt_boxes))])
Expand Down Expand Up @@ -597,9 +593,7 @@ def __call__(self, img, cls=True):
end = time.time()
time_dict['all'] = end - start
return None, None, time_dict
else:
cron_logger.debug("dt_boxes num : {}, elapsed : {}".format(
len(dt_boxes), elapse))

img_crop_list = []

dt_boxes = self.sorted_boxes(dt_boxes)
Expand All @@ -612,8 +606,6 @@ def __call__(self, img, cls=True):
rec_res, elapse = self.text_recognizer(img_crop_list)

time_dict['rec'] = elapse
cron_logger.debug("rec_res num : {}, elapsed : {}".format(
len(rec_res), elapse))

filter_boxes, filter_rec_res = [], []
for box, rec_result in zip(dt_boxes, rec_res):
Expand Down
2 changes: 0 additions & 2 deletions deepdoc/vision/recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

from api.utils.file_utils import get_project_base_directory
from .operators import *
from rag.settings import cron_logger


class Recognizer(object):
Expand Down Expand Up @@ -340,7 +339,6 @@ def postprocess(self, boxes, inputs, thr):
if score < thr:
continue
if clsid >= len(self.label_list):
cron_logger.warning(f"bad category id")
continue
bb.append({
"type": self.label_list[clsid].lower(),
Expand Down