mirror of
https://github.com/RapidAI/RapidOCR.git
synced 2026-11-13 22:40:53 +08:00
Format by black
This commit is contained in:
1 parent
ad4631fdd4
commit
f4fd5cdcba
40 files changed
+908
-854
No files matched your search
@@ -14,22 +14,22 @@ import cv2
|
||||
from rapidocr_onnxruntime import RapidOCR
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--yaml_path', type=str, default='config.yaml')
|
||||
parser.add_argument("--yaml_path", type=str, default="config.yaml")
|
||||
args = parser.parse_args()
|
||||
|
||||
yaml_path = cur_dir / args.yaml_path
|
||||
rapid_ocr = RapidOCR(yaml_path)
|
||||
|
||||
image_dir = cur_dir / 'test_images_benchmark'
|
||||
image_dir = cur_dir / "test_images_benchmark"
|
||||
if not image_dir.exists():
|
||||
raise FileNotFoundError(f'{image_dir} does not exits!!')
|
||||
raise FileNotFoundError(f"{image_dir} does not exits!!")
|
||||
|
||||
image_list = list(image_dir.iterdir())
|
||||
|
||||
cost_time_list = []
|
||||
for image_path in tqdm(image_list, desc='Test'):
|
||||
for image_path in tqdm(image_list, desc="Test"):
|
||||
img = cv2.imread(str(image_path))
|
||||
|
||||
start_time = time.time()
|
||||
@@ -40,6 +40,8 @@ if __name__ == '__main__':
|
||||
|
||||
total_time = sum(cost_time_list)
|
||||
avg_time = total_time / len(cost_time_list)
|
||||
print(f'Total Files: {len(image_list)}, '
|
||||
f'Total Time: {total_time:.5f}, '
|
||||
f'Average Time: {avg_time:.5f}')
|
||||
print(
|
||||
f"Total Files: {len(image_list)}, "
|
||||
f"Total Time: {total_time:.5f}, "
|
||||
f"Average Time: {avg_time:.5f}"
|
||||
)
|
||||
Reference in new issue
Block a user