8000 调用openocr问题,怎么改检测网络输入网络的最长边 · Issue #95 · Topdu/OpenOCR · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

调用openocr问题,怎么改检测网络输入网络的最长边 #95

< 8000 div class="gh-header-actions mt-0 mb-3 mb-md-2 ml-1 flex-md-order-1 flex-shrink-0 d-flex flex-items-center gap-1">
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

Open
Mrgorlay opened this issue Mar 11, 2025 · 1 comment
Open

Comments

@Mrgorlay
Copy link

大佬们,想请教下,我的做法是写了一个api接口,我想每次检测时候传入检测网络的输入尺寸,因为发现图片差异太大了,有没有好的办法呀,麻烦指导谢谢

@Topdu
Copy link
Owner
Topdu commented Mar 23, 2025

可以参考demo_gradio.py中设置最长边的方法:

def main(input_image,
         model_type_select,
         det_input_size_textbox=960, # 最长边
         rec_drop_score=0.4,
         mask_thresh=0.3,
         box_thresh=0.6,
         unclip_ratio=1.5,
         det_score_mode='slow'):
    global text_sys, model_type

    # Update OCR model if the model type changes
    if model_type_select != model_type:
        model_type = model_type_select
        text_sys = initialize_ocr(model_type, rec_drop_score)

    img = input_image[:, :, ::-1]
    starttime = time.time()
    results, time_dict, mask = text_sys( # text_sys=OpenOCR()
        img_numpy=img,
        return_mask=True,
        det_input_size=int(det_input_size_textbox), # 最长边
        thresh=mask_thresh,
        box_thresh=box_thresh,
        unclip_ratio=unclip_ratio,
        score_mode=det_score_mode)

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

2 participants
0