Open Ontheroad123 opened 10 months ago
函数调用可以设置不同的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') ` reshape_image(2336,1632)
默认大小(704,704)
其实效果并不好,还是和模型训练时输入shape有很大关系,最好还是根据自己任务的input shape重新训练模型效果最好。
对,版面分析模型的效果一般,没做过特别的优化。
这是PaddleOCR基于CDLA数据集训练的版面分析模型[https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/ppstructure/docs/models_list.md],有时间做测试了把效果放上来对比。
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
则没问题