update get_img_file_list

This commit is contained in:
tink2123 2020-05-12 20:51:28 +08:00
parent 250cd37a36
commit 2025ed1dfb
2 changed files with 23 additions and 22 deletions

View File

@ -22,7 +22,7 @@ import string
import lmdb import lmdb
from ppocr.utils.utility import initial_logger from ppocr.utils.utility import initial_logger
from tools.infer.utility import get_image_file_list from ppocr.utils.utility import get_image_file_list
logger = initial_logger() logger = initial_logger()
from .img_tools import process_image, get_img_data from .img_tools import process_image, get_img_data
@ -173,6 +173,7 @@ class SimpleReader(object):
img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR) img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)
norm_img = process_image(img, self.image_shape) norm_img = process_image(img, self.image_shape)
yield norm_img yield norm_img
else:
with open(self.label_file_path, "rb") as fin: with open(self.label_file_path, "rb") as fin:
label_infor_list = fin.readlines() label_infor_list = fin.readlines()
img_num = len(label_infor_list) img_num = len(label_infor_list)

View File

@ -46,7 +46,7 @@ from ppocr.data.reader_main import reader_main
from ppocr.utils.save_load import init_model from ppocr.utils.save_load import init_model
from ppocr.utils.character import CharacterOps from ppocr.utils.character import CharacterOps
from ppocr.utils.utility import create_module from ppocr.utils.utility import create_module
from tools.infer.utility import get_image_file_list from ppocr.utils.utility import get_image_file_list
logger = initial_logger() logger = initial_logger()