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

layout模型预测时能否单独设置--resized-shape #65

Open
Ontheroad123 opened this issue Aug 22, 2023 · 3 comments
Open

layout模型预测时能否单独设置--resized-shape #65

Ontheroad123 opened this issue Aug 22, 2023 · 3 comments

Comments

@Ontheroad123
Copy link

Ontheroad123 commented Aug 22, 2023

cnstd analyze 参数 --resized-shape 只能输入一个32倍数的整数,shape的height和width只能是一个整数,能否设置不同的值
`cnstd analyze -m layout --resized-shape 2336,1632 -i table_image1.png -o std_table_image1.png

Error: Invalid value for '--resized-shape': '2336,1632' is not a valid integer.`

若如此设置:
cnstd analyze -m layout --resized-shape 2336 -i table_image1.png -o std_table_image1.png则没问题

@Ontheroad123
Copy link
Author

Ontheroad123 commented Aug 23, 2023

函数调用可以设置不同的height和width
`
from cnstd import LayoutAnalyzer, CATEGORY_DICT

import cv2

img_fp = 'image1.png'
img0 = cv2.imread(img_fp)
analyzer = LayoutAnalyzer('layout')
out = analyzer.analyze(img_fp, resized_shape=(2336,1632))
analyzer.save_img(img0, out, 'std_image1_reshape.png')
`
std_image1_reshape
reshape_image(2336,1632)

std_image1
默认大小(704,704)

其实效果并不好,还是和模型训练时输入shape有很大关系,最好还是根据自己任务的input shape重新训练模型效果最好。

@breezedeus
Copy link
Owner

对,版面分析模型的效果一般,没做过特别的优化。

@Ontheroad123
Copy link
Author

这是PaddleOCR基于CDLA数据集训练的版面分析模型[https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/ppstructure/docs/models_list.md],有时间做测试了把效果放上来对比。

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