Code Monkey home page Code Monkey logo

trocr-seal-recognition's People

Contributors

gmgge avatar wenlihaoyu avatar wenyinlong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

trocr-seal-recognition's Issues

有没有检测模型呀哥哥,么么哒

有没有检测模型呀哥哥,么么哒
有检测的数据集 但是我没有找到,检测的代码在哪里,只找到了对抠出来的印章进行识别的代码

关于两个模型文件如何在C++部署的问题

大佬你好,我是一个深度学习方面的新手。
我在py环境下成功跑通了该项目。
所以我想把本项目的onnx_test.py部署到C++上面。
但是我发现本项目用到的模型有两个encoder_model.onnx和decoder_model.onnx。这和我在网上搜到的C++部署教程不太一致。

请问大佬有什么参考的方向或者指导吗?非常感谢

app.py 没有找到,能否补档百度网盘链接

大佬,我在trocr_chinese中找到了模型以及app.py,使用

python -m transformers.onnx -m ./torchmode --feature=vision2seq-lm onnx-modlepath --atol 1e-4 转换了onnx模型
但是转换结果精确的不太行,不能达到你在线部署的那个识别率

印章角度转正

您好,大佬 针对旋转/有角度的印章,如何转正呢,有方法推荐么?

模型和数据集

您好,请问这个印章识别的模型和数据集删除了吗?

关于import报错

ImportError: cannot import name 'image_aug' from 'tool.image_aug'
在运行train.py的时候出现该报错,请问有解决方法吗

模型转onnx

请问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模型在哪下载

下载onnx推理模型,放入当前目录
python onnx_test.py --model {模型目录} --test_img ./img/seal_0.png

output: '[1.0, 1.0, 1.0, 0.94803417, 0.99987036, 0.9999962, 0.99990654, 1.0, 0.9999809, 0.99999815, 1.0, 1.0, 1.0]

0.99598354
南京谐诚机电工程有限公司

这部分
'

如何共享数据集?

我现在有1.5k左右的数据,都是自己合成的,请问如何共享?数据如下图所示:
image

训练数据量

          > 很感谢你的想法,关于合成公章我这边生成很多,目前缺少的是真实公章。

还是很感谢你的分享,不知道你这边是否收集了这个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分钟。请问这个是什么原因?

印章模型无法识别数字

如题,目前印章识别无法识别数字,字典里面也有相关数字字符,是需要加相关字符数据集进行微调模型吗?
Uploading Snipaste_2024-01-02_17-55-12.png…

印章识别

大佬你好,请问印章识别模型能开源吗?

章识别模型运行错误,

我使用您提供的链接下载了对应的模型权重,解压后如下结构
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)

麻烦大佬帮忙看下,谢谢~~

dataset

非常感谢楼主的分享,请问楼主训练模型的数据量是多大呢

印章预训练模型

请问有公开印章预训练模型的计划吗?我基于TAL_OCR_CHN微调效果很一般

印章数据集已过期

你好,百度网盘分享的印章数据集已过期,能否再分享一下,或者将数据集上传到github,谢谢

印章识别模型训练时,数据标签格式问题?

非常感谢您的分享,我想请教下模型训练时,印章图像对应的标注,直接是整个印章图像和对应的标签吗?印章上是弯曲文本区域,而且会有多个,是当成多行问题解决吗?还是说需要对弯曲文本区域进行多边形标注,再做处理?

测试权重链接失效

你好,感谢你的项目分享。你实现的印章识别的方式对我们很有启发。我们想实验模型的识别效果,但发现权重的链接过期了,可以重新上传一份吗?谢谢。
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.