guanshuicheng / invoice Goto Github PK
View Code? Open in Web Editor NEW增值税发票OCR识别,使用flask微服务架构,识别type:增值税电子普通发票,增值税普通发票,增值税专用发票;识别字段为:发票代码、发票号码、开票日期、校验码、税后金额等
License: MIT License
增值税发票OCR识别,使用flask微服务架构,识别type:增值税电子普通发票,增值税普通发票,增值税专用发票;识别字段为:发票代码、发票号码、开票日期、校验码、税后金额等
License: MIT License
如题
[请求的时候不是直接上传图片吗?请求参数是?]
返回结果是:
{
"FileName": {},
"code": 101,
"data": {},
"message": "请求参数错误",
"ocrIdentifyTime": {}
}
Hello,
While trying the tool, I find that the uploading file functionality relies on using the user-provided filename extension which could be a security issue as described in CWE-646: Reliance on File Name or Extension of Externally-Supplied File.
Attacker could obfuscate the file name extension and drop malicious code on the server for the further attack.
Thanks for reading.
I've download "models.rar" but can not open it. Any one fit the same problem?
刚刚接触这块,不知道你是如何训练的,以及训练的代码在哪儿?
I got the error like this :
Traceback (most recent call last):
File "app.py", line 14, in
from model_post_type import ocr as OCR
File "/Users/xianglingyun/invoice_ocr/invoice-master/model_post_type.py", line 32, in
from text import keras_detect_type as detect
File "/Users/xianglingyun/invoice_ocr/invoice-master/text/keras_detect_type.py", line 19, in
sess = K.get_session()
can you tell me how to fix it?
您好,
我使用您提供的YOLO3模型进行预测的时候,预测出的框如下图:
请问一下,在训练模型之前的数据标注阶段,是以发票什么部分作为YOLO3的目标进行检测?
我翻看了其他issue中提到的 chinese-ocr,还是有些不太明白,可以具体的请教一下数据是如何标注的吗?
谢谢!
您好,方便的话,能否给下您YOLO 文字检测的训练代码。Email:[email protected]
1.我现在跑起来后,内存暂用非常高,大约会暂用4G左右
2.识别速度比较慢,需要5s左右,把识别发票类型代码注释后,稍微快了点3s左右
刚刚开始学习识别,请教这2个问题怎么解决,谢谢。
多次调用接口会出现显存的累积,如何释放?
我看评论说这个识别的区域只有5个?
你是微调做的吗?微调数据量检测和ocr两部分分别是多少?
ps:居然遇到了一个也是姓管的,哈哈哈
我最近也在做类似的研究,但苦于数据集不足,自己也收集了一部分数据,但还是不够,请问能公开下您的训练集么,感谢!
corrupted size vs. prev_size
已放弃 (核心已转储)
使用了test-invoice文件夹中的发票,
当上传一张发票时候直接报以上错误,程序便自动结束。
完整信息如下
[{'text': '天津增值税电子普通发票', 'cx': 451.0, 'cy': 80.5, 'w': 309.0616503223912, 'h': 25.99999999999999, 'degree': 0.18592417856631746}]
['电子普通']
['普通发票']
[]
corrupted size vs. prev_size
已放弃 (核心已转储)
question: cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\dnn\src\darknet\darknet_importer.cpp:207: error: (-212:Parsing error) Failed to parse NetParameter file: D:\新建文件夹\invoice\models\text.cfg in function 'cv::dnn::experimental_dnn_34_v7::readNetFromDarknet'
python3.6.7 +opencv3.4.3.18
您好,关于yolo3区域检测是如何只检测5个文字目标区域的,能加下微信交流下么
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\ZKRH001\Desktop\invoice-master\models\ocr-lstm.pth'
Traceback (most recent call last):
File "C:\Users\ZKRH001\Desktop\invoice-master\app.py", line 14, in
from model_post_type import ocr as OCR
File "C:\Users\ZKRH001\Desktop\invoice-master\model_post_type.py", line 10, in
from crnn.crnn_torch import crnnOcr as crnnOcr ##torch版本ocr
File "C:\Users\ZKRH001\Desktop\invoice-master\crnn\crnn_torch.py", line 38, in
model,converter = crnnSource()
File "C:\Users\ZKRH001\Desktop\invoice-master\crnn\crnn_torch.py", line 26, in crnnSource
trainWeights = torch.load(ocrModel,map_location=lambda storage, loc: storage)
File "C:\Users\ZKRH001\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 594, in load
with _open_file_like(f, 'rb') as opened_file:
File "C:\Users\ZKRH001\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "C:\Users\ZKRH001\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 211, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\ZKRH001\Desktop\invoice-master\models\ocr-lstm.pth'
请按任意键继续. . .
大佬能不能帮忙把requirements内的版本号加上啊,像pip freeze生成的那种
有没有兄弟跑起来的 tensorflow 1.14.0 版本 python版本 3.6.7
报错信息:
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder_368' with dtype float and shape [2]
[[{{node Placeholder_368}}]]
也考虑一下升级环境到Python 3.8吧。 毕竟3.6明年就停止支持了
how to deal with the problem? the memory is too smaller? I use 8G RAM for win10 systerm
請問一下 要怎麼POST照片
感觉作者的文字检测中,相比于Chines OCR 还包含了识别区域的检测,请问作者如何标注和训练识别区域的,谢谢
在浏览器上 http://0.0.0.0:11111/invoice-ocr 网页打不开
Traceback (most recent call last):
File "D:\Anacaonda\envs\invoice-master\lib\site-packages\flask\app.py", line 2091, in call
return self.wsgi_app(environ, start_response)
File "D:\Anacaonda\envs\invoice-master\lib\site-packages\flask\app.py", line 2076, in wsgi_app
response = self.handle_exception(e)
File "D:\Anacaonda\envs\invoice-master\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "D:\Anacaonda\envs\invoice-master\lib\site-packages\flask\app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "D:\Anacaonda\envs\invoice-master\lib\site-packages\flask\app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "D:\Anacaonda\envs\invoice-master\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "D:\Anacaonda\envs\invoice-master\lib\site-packages\flask\app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "D:\Anacaonda\envs\invoice-master\lib\site-packages\flask\app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "C:\Users\HP\Desktop\invoice-master\app.py", line 110, in invoice_ocr
Recognition_invoice = Recognition_invoice(whole_path)
File "C:\Users\HP\Desktop\invoice-master\app.py", line 81, in Recognition_invoice
result_type = OCR(img1)
File "C:\Users\HP\Desktop\invoice-master\model_post_type.py", line 156, in ocr
alph=0.01, ##对检测的文本行进行向右、左延伸的倍数
File "C:\Users\HP\Desktop\invoice-master\model_post_type.py", line 124, in model
text_recs = text_detect(**config) ##文字检测
File "C:\Users\HP\Desktop\invoice-master\model_post_type.py", line 45, in text_detect
boxes, scores = detect.text_detect(np.array(img))
File "C:\Users\HP\Desktop\invoice-master\text\keras_detect_type.py", line 57, in text_detect
K.learning_phase(): 0
File "C:\Users\HP\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 958, in run
run_metadata_ptr)
File "C:\Users\HP\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1181, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\HP\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1359, in _do_run
run_metadata)
File "C:\Users\HP\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.FailedPreconditionError: Error while reading resource variable conv2d_74/kernel from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/conv2d_74/kernel)
[[node conv2d_74/Conv2D/ReadVariableOp (defined at C:\Users\HP\Desktop\invoice-master\text\keras_yolo3.py:49) ]]
作者你好,我在学习这个OCR项目,想得到所有模型的训练代码,不知道方便发一下吗。
我的微信:wsh_2766659938
邮箱:[email protected]
You need configured Python 2 SDK to render Epydoc docstrings
(base) xianglingyun@xianglingyundeMacBook-Pro invoice-master % curl http://127.0.0.1:11111/invoice-ocr -X POST -d 'file=@电子发票-test.png'
{"FileName":{},"code":101,"data":{},"message":"请求参数错误","ocrIdentifyTime":{}}
when I running the script, It will have above issue
可以提供部分数据集吗?想train一下代码。谢谢
您好,能交流一下您做检测训练时是如何标注吗的,方便的话能加一下您微信吗
|
Network Access Message: The page cannot be displayed |
Explanation:
The request timed out before the page could be retrieved.
Try the following:
|
由于很多包的兼容性问题,执行pip install -r requirements.txt会有各种兼容性问题,有没有那位大佬能提供一套完整兼容的依赖版本的requirements.txt,在此感谢!!!
你好!我已经分别写好了检测训练脚本和识别训练脚本,请问训练的时候是要一起训练吗?检测和识别部分是如何联系在一起的呢?
已经生成了gpu_nms.so 现在import gpu_nms 还是不成功
1.15.2 这个版本支持吗?
Traceback (most recent call last):
File "app.py", line 14, in
from model_post_type import ocr as OCR
File "/home/test/invoice/model_post_type.py", line 32, in
from text import keras_detect_type as detect
File "/home/test/invoice/text/keras_detect_type.py", line 23, in
box_score = box_layer([*textModel.output,image_shape,input_shape],anchors, num_classes)
File "/home/test/invoice/text/keras_yolo3.py", line 366, in box_layer
boxes = concatenate(boxes, axis=0)
File "/test/anaconda3/envs/py37/lib/python3.7/site-packages/tensorflow_core/python/keras/layers/merge.py", line 705, in concatenate
return Concatenate(axis=axis, **kwargs)(inputs)
File "/test/anaconda3/envs/py37/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 802, in call
base_layer_utils.create_keras_history(inputs)
File "/test/anaconda3/envs/py37/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer_utils.py", line 184, in create_keras_history
_, created_layers = _create_keras_history_helper(tensors, set(), [])
File "/test/anaconda3/envs/py37/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer_utils.py", line 231, in _create_keras_history_helper
layer_inputs, processed_ops, created_layers)
File "/test/anaconda3/envs/py37/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer_utils.py", line 231, in _create_keras_history_helper
layer_inputs, processed_ops, created_layers)
File "/test/anaconda3/envs/py37/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer_utils.py", line 231, in _create_keras_history_helper
layer_inputs, processed_ops, created_layers)
[Previous line repeated 2 more times]
File "/test/anaconda3/envs/py37/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer_utils.py", line 229, in _create_keras_history_helper
constants[i] = backend.function([], op_input)([])
File "/test/anaconda3/envs/py37/lib/python3.7/site-packages/tensorflow_core/python/keras/backend.py", line 3476, in call
run_metadata=self.run_metadata)
File "/test/anaconda3/envs/py37/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1472, in call
run_metadata_ptr)
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder_367' with dtype float and shape [2]
[[{{node Placeholder_367}}]]
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.