commit
910c6128bb
|
@ -15,6 +15,7 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from ppocr.utils.utility import enable_static_mode
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
@ -43,7 +44,6 @@ logger = initial_logger()
|
|||
from ppocr.utils.save_load import init_model
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
startup_prog, eval_program, place, config, _ = program.preprocess()
|
||||
|
||||
|
@ -72,4 +72,5 @@ def main():
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
enable_static_mode()
|
||||
main()
|
||||
|
|
|
@ -191,10 +191,13 @@ if __name__ == "__main__":
|
|||
if count > 0:
|
||||
total_time += elapse
|
||||
count += 1
|
||||
print("Predict time of %s:" % image_file, elapse)
|
||||
logger.info("The predicted time of img: {} is {}:".format(image_file,
|
||||
elapse))
|
||||
src_im = utility.draw_text_det_res(dt_boxes, image_file)
|
||||
img_name_pure = os.path.split(image_file)[-1] # image_file.split("/")[-1]
|
||||
img_path = os.path.join(draw_img_save, "det_res_%s" % img_name_pure)
|
||||
cv2.imwrite(img_path, src_im)
|
||||
img_name_pure = image_file.split("/")[-1]
|
||||
cv2.imwrite(
|
||||
os.path.join(draw_img_save, "det_res_%s" % img_name_pure), src_im)
|
||||
logger.info("The visualized img saved in {}".format(
|
||||
os.path.join(draw_img_save, "det_res_%s" % img_name_pure)))
|
||||
if count > 1:
|
||||
print("Avg Time:", total_time / (count - 1))
|
||||
logger.info("Avg Time:", total_time / (count - 1))
|
||||
|
|
Loading…
Reference in New Issue