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

循环对主体检测结果进行特征提取很耗时 #3092

Open
anlywxqwu opened this issue Feb 22, 2024 · 1 comment
Open

循环对主体检测结果进行特征提取很耗时 #3092

anlywxqwu opened this issue Feb 22, 2024 · 1 comment
Assignees

Comments

@anlywxqwu
Copy link

anlywxqwu commented Feb 22, 2024

    for result in results:
        preds = {}
        xmin, ymin, xmax, ymax = result["bbox"].astype("int")
        crop_img = img[ymin:ymax, xmin:xmax, :].copy()
        start = time.time()
        #特征识别
        rec_results = self.rec_predictor.predict(crop_img)
        end = time.time()
        print('rec_predictor.predict程序运行时间为:', end - start, '秒')

这个问题怎么解决,我知道调整
threshold,max_det_results参数可以控制输出数量,这对检测结果有些什么影响呢, 除了调整参数外能否将识别部分用c++实现,或者有更高明的方式
rec_predictor.predict程序运行时间为: 0.2493739128112793 秒
Searcher.search程序运行时间为: 0.0 秒
rec_predictor.predict程序运行时间为: 0.21487092971801758 秒

rec_predictor.predict这个数量是max_det_results决定的,我看通常是设置的5,这样好像计算要达到1秒了=5*0,2(估算)

@changdazhou
Copy link
Contributor

这个位置如果想加速的话,就需要对这个for循环进行修改,比如改成并行或者组batch等操作,但我们目前没有计划支持哈,需要自己修改一下代码。对于max_det results,不建议调小,会漏掉一些检测框,影响精度

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants