gmgge / trocr-seal-recognition Goto Github PK
View Code? Open in Web Editor NEW基于transformer的ocr识别,在公章(印章识别, seal recognition)拓展应用
基于transformer的ocr识别,在公章(印章识别, seal recognition)拓展应用
看介绍说新上传的链接有320320的新模型,点开seal链接看还是原来的384384的模型?新的320*320的模型大致有哪些更新呢?
另有2W+标注好的印章检测数据,暂没法上传,看如何数据共享方便些
有没有检测模型呀哥哥,么么哒
有检测的数据集 但是我没有找到,检测的代码在哪里,只找到了对抠出来的印章进行识别的代码
大佬你好,我是一个深度学习方面的新手。
我在py环境下成功跑通了该项目。
所以我想把本项目的onnx_test.py部署到C++上面。
但是我发现本项目用到的模型有两个encoder_model.onnx和decoder_model.onnx。这和我在网上搜到的C++部署教程不太一致。
请问大佬有什么参考的方向或者指导吗?非常感谢
大佬,我在trocr_chinese中找到了模型以及app.py,使用
python -m transformers.onnx -m ./torchmode --feature=vision2seq-lm onnx-modlepath --atol 1e-4 转换了onnx模型
但是转换结果精确的不太行,不能达到你在线部署的那个识别率
https://aistudio.baidu.com/datasetdetail/154271 百度社区的开放印章数据集(非本人原创),希望能够帮助到。
另外请教一下基于trocr如何获取字符的位置。
您好,大佬 针对旋转/有角度的印章,如何转正呢,有方法推荐么?
您好,请问这个印章识别的模型和数据集删除了吗?
印章识别的模型地址失效了 seal点开模型地址,已经不能下载了,辛苦再分享一个吧,多谢。或者发个模型到有邮件: [email protected]。万分感谢
ImportError: cannot import name 'image_aug' from 'tool.image_aug'
在运行train.py的时候出现该报错,请问有解决方法吗
虽然提供了一些开源数据集,但是并没有给出训练文件中txt文件的示例格式
【生成】paddlepaddle社区印章数据集1
【生成】paddlepaddle社区印章数据集2
这两个数据集好像是一样的
您好!
1, 请问使用付费api来打标签这种方式,能分享一下具体方式吗?
2, 分享一个数据集: 链接: https://pan.baidu.com/s/1iOciAjii82nXNyKrbbXciQ?pwd=q6a7 提取码: q6a7
--来自百度网盘超级会员v8的分享
感谢您的辛勤付出! 🥲
请问onnx模型要怎么转呢,我使用如下脚本报错python -m \ transformers.onnx \ -m /home/liangsuyin/code/TrOCR-Seal-Recognition/cust-data/weights \ --feature=vision2seq-lm \ seal-onnx --atol 1e-4
Hugging Face ONNX Exporter tool: error: argument --feature: invalid choice: 'vision2seq-lm' (choose from 'causal-lm', 'causal-lm-with-past', 'default', 'default-with-past', 'masked-lm', 'question-answering', 'seq2seq-lm', 'seq2seq-lm-with-past', 'sequence-classification', 'token-classification')
下载onnx推理模型,放入当前目录
python onnx_test.py --model {模型目录} --test_img ./img/seal_0.png
0.99598354
南京谐诚机电工程有限公司
这部分
'
seal-ocr(印章识别)预训练模型百度网盘下载地址失效了,能否重新分享一下,谢谢
首先非常感谢您对文档智能的各个模块任务的贡献,针对公式识别以及表格识别模块是否有开源的打算呢
> 很感谢你的想法,关于合成公章我这边生成很多,目前缺少的是真实公章。
还是很感谢你的分享,不知道你这边是否收集了这个ICDAR 2023 Competition on Reading the Seal Title比赛的数据集。
至于生成公章,不知道你是否尝试过这个网站
非常感谢大佬,目前生成公章使用的就是这个网站,ICDAR的数据集也有使用。但我在训练的过程中发现TrOCR很容易过拟合,不知道您这边的是怎么解决的?此外,还想问一下您的训练数据量大约有多少?
Originally posted by @LUXUS1 in #3 (comment)
Traceback (most recent call last):
File "onnx_test.py", line 135, in
res = model.run(img)
File "onnx_test.py", line 103, in run
decoder_output = self.decoder(input_ids=input_ids,
File "onnx_test.py", line 75, in call
onnx_output = self.model.run(['logits'], onnx_inputs)
File "D:\anaconda\envs\fastapi\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 200, in run
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Unexpected input data type. Actual: (tensor(int32)) , expected: (tensor(int64))
您好,我想请问一下,我运行onnx_test.py 文件,每次执行一个照片需要20分钟。请问这个是什么原因?
印章数据怎么给你呢?
[email protected]
或者
[email protected]
谢谢Thanks♪(・ω・)ノ
大佬你好,请问印章识别模型能开源吗?
大佬好,from tool.image_aug import image_aug, .image_aug.py文件没有定义image_aug,麻烦补充一下,谢谢
我使用您提供的链接下载了对应的模型权重,解压后如下结构
34M decoder_model.onnx
85M encoder_model.onnx
45K vocab.json
使用了您建议的运行指令:
python onnx_test.py --model /xxx/seal --test_img /xxx/seal_fake.jpeg
首先遇到第一个错误:
Traceback (most recent call last):
File "onnx_test.py", line 131, in
res = model.run(img)
File "onnx_test.py", line 109, in run
if pred[-1] == self.vocab[""]:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
我看了下输出没问题,代码是控制循环停止的,暂时没啥影响,就禁掉了。
继续运行代码,然后又遇到下面第二个错误:
Traceback (most recent call last):
File "onnx_test.py", line 135, in
res = model.run(img)
File "onnx_test.py", line 102, in run
decoder_output = self.decoder(input_ids=input_ids,
File "onnx_test.py", line 74, in call
onnx_output = self.model.run(['logits'], onnx_inputs)
File "/opt/conda/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 192, in run
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Unexpected input data type. Actual: (tensor(string)) , expected: (tensor(int64))
报错位置的代码,如下:
onnx_inputs = {"input_ids": input_ids,
"attention_mask": attention_mask,
"encoder_hidden_states": encoder_hidden_states}
print('onnx_inputs', onnx_inputs['input_ids'].shape)
print('onnx_inputs', onnx_inputs['attention_mask'].shape)
print('onnx_inputs', onnx_inputs['encoder_hidden_states'].shape)
onnx_output = self.model.run(['logits'], onnx_inputs)
我把报错位置的数据打印看了下,感觉并没有问题呀,输入格式完成符合预期,如下:
onnx_inputs (1, 1)
onnx_inputs (1, 1)
onnx_inputs (1, 578, 384)
[[ 3.1568584e+01 -1.5170749e+01 -1.3366631e-02 ... -2.6361866e+00
-5.3458900e+00 1.1954393e+00]]
[[1.0000000e+00 5.0276506e-21 1.9236803e-14 ... 1.3965480e-15
9.2949584e-17 6.4433281e-14]]
(1, 3584)
ids [0]
onnx_test.py:103: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
input_ids = np.array([ids])
onnx_inputs (1, 2)
onnx_inputs (1, 2)
onnx_inputs (1, 578, 384)
麻烦大佬帮忙看下,谢谢~~
非常感谢楼主的分享,请问楼主训练模型的数据量是多大呢
请问有公开印章预训练模型的计划吗?我基于TAL_OCR_CHN微调效果很一般
请问如果我想要修改训练的预处理size为其他值,我该怎么改呢
你好,百度网盘分享的印章数据集已过期,能否再分享一下,或者将数据集上传到github,谢谢
非常感谢您的分享,我想请教下模型训练时,印章图像对应的标注,直接是整个印章图像和对应的标签吗?印章上是弯曲文本区域,而且会有多个,是当成多行问题解决吗?还是说需要对弯曲文本区域进行多边形标注,再做处理?
如果你的真实印章过少,可以尝试生成一些假印章
印章生成(gitee)
印章生成(github)
您好我看到共享数据的 计划,想问一下如何联系。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.