szad670401 / HyperLPR

基于深度学习高性能中文车牌识别 High Performance Chinese License Plate Recognition Framework.
Apache License 2.0
5.76k stars 2.02k forks source link

识别耗时接近2s #212

Closed Suntester closed 4 years ago

Suntester commented 4 years ago

配置 MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports) 2.3 GHz Intel Core i5 样例代码如下,耗时接近2000ms。官方是100ms,请问哪里出了问题

导入包

from hyperlpr import *

导入OpenCV库

import cv2 import time

读入图片

image = cv2.imread("demo.jpg")

识别结果

start = time.time() print(HyperLPR_plate_recognition(image)) print(time.time() - start)

panda-lab commented 4 years ago

多大分辨率的图片?

Suntester commented 4 years ago

多大分辨率的图片?

图片大小为361 * 640 如果代码在一个脚本里面执行两遍,第二遍耗时就很正常,只有30ms。

from hyperlpr import * import cv2 import time

start = time.time() image = cv2.imread("test.jpeg") print(HyperLPR_plate_recognition(image)) print(time.time() - start)

耗时1980ms

start = time.time() image = cv2.imread("test.jpeg") print(HyperLPR_plate_recognition(image)) print(time.time() - start)

耗时30ms

panda-lab commented 4 years ago

第一次需要对深度学习框架启动,称为 warming up ,这个过程比较耗时。