benjaminwan / ocrlitencnn Goto Github PK
View Code? Open in Web Editor NEWchineseocr lite onnx to ncnn,超轻量级中文ocr demo,支持ncnn推理 ( dbnet+crnn+anglenet)
Home Page: https://github.com/ouyanghuiyu/chineseocr_lite
chineseocr lite onnx to ncnn,超轻量级中文ocr demo,支持ncnn推理 ( dbnet+crnn+anglenet)
Home Page: https://github.com/ouyanghuiyu/chineseocr_lite
for (int i = 0; i < textBoxes.size(); ++i) {
Logger("TextBox%d[score(%f),[x: %d, y: %d], [x: %d, y: %d], [x: %d, y: %d], [x: %d, y: %d]]\n", i,
textBoxes[i].score,
textBoxes[i].boxPoint[0].x, textBoxes[i].boxPoint[0].y,
textBoxes[i].boxPoint[1].x, textBoxes[i].boxPoint[1].y,
textBoxes[i].boxPoint[2].x, textBoxes[i].boxPoint[2].y,
textBoxes[i].boxPoint[3].x, textBoxes[i].boxPoint[3].y);
}
wode@xxx-NBLK-WAX9X:~/src/OcrLiteNcnn$ bash run-test.sh
Setting the Number of Threads=8 Using an OpenMP Environment Variable
Gpu版本测试前请先安装Vulkan SDK v1.2.162.0,https://vulkan.lunarg.com/sdk/home
请输入测试选项并回车: 1)CPU, 2)GPU
2
1.8.1
[0 AMD RADV RAVEN] queueC=1[4] queueG=0[1] queueT=0[1]
[0 AMD RADV RAVEN] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[0 AMD RADV RAVEN] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
[0 AMD RADV RAVEN] subgroup=64 basic=1 vote=1 ballot=1 shuffle=1
[1 llvmpipe (LLVM 13.0.1, 256 bits)] queueC=0[1] queueG=0[1] queueT=0[1]
[1 llvmpipe (LLVM 13.0.1, 256 bits)] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[1 llvmpipe (LLVM 13.0.1, 256 bits)] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
[1 llvmpipe (LLVM 13.0.1, 256 bits)] subgroup=8 basic=1 vote=1 ballot=1 shuffle=0
This device has 2 GPUs
modelsPath=models
model dbnet path=models/dbnet_op
model angle path=models/angle_op
model crnn path=models/crnn_lite_op
keys path=models/keys.txt
imgDir=images/, imgName=1.jpg
resultTxtPath(images/1.jpg-result.txt)
[0 AMD RADV RAVEN] queueC=1[4] queueG=0[1] queueT=0[1]
[0 AMD RADV RAVEN] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[0 AMD RADV RAVEN] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
[0 AMD RADV RAVEN] subgroup=64 basic=1 vote=1 ballot=1 shuffle=1
[1 llvmpipe (LLVM 13.0.1, 256 bits)] queueC=0[1] queueG=0[1] queueT=0[1]
[1 llvmpipe (LLVM 13.0.1, 256 bits)] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[1 llvmpipe (LLVM 13.0.1, 256 bits)] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
[1 llvmpipe (LLVM 13.0.1, 256 bits)] subgroup=8 basic=1 vote=1 ballot=1 shuffle=0
dbNet try to use Gpu0
AngleNet use Cpu
CrnnNet use Cpu
=====Input Params=====
numThread(8),padding(50),maxSideLen(0),boxScoreThresh(0.600000),boxThresh(0.300000),unClipRatio(2.000000),doAngle(1),mostAngle(1),GPU(0)
=====Init Models=====
--- Init DbNet ---
--- Init AngleNet ---
param is too old, please regenerate!
layer load_param 106 611 failed
run-test.sh:行 57: 25190 段错误 (核心已转储) ./${EXE_PATH}/OcrLiteNcnn --models models --det dbnet_op --cls angle_op --rec crnn_lite_op --keys keys.txt --image $TARGET_IMG --numThread $NUM_THREADS --padding 50 --maxSideLen 0 --boxScoreThresh 0.6 --boxThresh 0.3 --unClipRatio 2.0 --doAngle 1 --mostAngle 1 --GPU $GPU_INDEX
我想要识别更多的中文和英文字符应该怎么弄,这边是否有训练和模型转换的参考。
我安装了VS2019和Cmake但是generate-vs-project.bat运行 选项选择完 只生成文件夹 ,文件夹里没东西。build.bat也是只生成文件夹但没有东西!
这是我电脑路径 E:\VSwork_Project\Project_OcrLiteNcnn-1.8.0
没有中文和特殊符号!
C:\Users\admin\Desktop\Project_OcrLiteNcnn-1.7.0\ncnnocr\Release>ncnnocr.exe --models models --det det --cls cls --rec rec --keys keys.txt --image 1.jpg --GPU 0
modelsPath=models
model dbnet path=models/det
model angle path=models/cls
model crnn path=models/rec
keys path=models/keys.txt
imgDir=, imgName=1.jpg
Model dbnet file not found: models/det.param
C:\Users\admin\Desktop\Project_OcrLiteNcnn-1.7.0\ncnnocr\Release>ncnnocr.exe --models models --keys keys.txt --image 1.jpg --GPU 0
modelsPath=models
keys path=models/keys.txt
imgDir=, imgName=1.jpg
resultTxtPath(1.jpg-result.txt)
=====Input Params=====
numThread(4),padding(50),maxSideLen(1024),boxScoreThresh(0.600000),boxThresh(0.300000),unClipRatio(2.000000),doAngle(1),mostAngle(1),GPU(0)
=====Init Models=====
--- Init DbNet ---
--- Init AngleNet ---
--- Init CrnnNet ---
=====Start detect=====
ScaleParam(sw:740,sh:740,dw:736,dh:736,0.994595,0.994595)
---------- step: dbNet getTextBoxes ----------
dbNetTime(496.365100ms)
TextBox0[score(0.735103),[x: 314, y: 58], [x: 668, y: 433], [x: 622, y: 476], [x: 268, y: 102]]
TextBox1[score(0.770903),[x: 435, y: 53], [x: 691, y: 305], [x: 635, y: 362], [x: 379, y: 110]]
TextBox2[score(0.791785),[x: 263, y: 122], [x: 564, y: 460], [x: 500, y: 515], [x: 201, y: 178]]
TextBox3[score(0.794584),[x: 182, y: 176], [x: 483, y: 530], [x: 415, y: 589], [x: 114, y: 234]]
TextBox4[score(0.699193),[x: 109, y: 230], [x: 320, y: 501], [x: 255, y: 552], [x: 44, y: 281]]
---------- step: drawTextBoxes ----------
---------- step: angleNet getAngles ----------
angle[0][index(1), score(0.999997), time(7.265200ms)]
angle[1][index(1), score(0.999786), time(2.394500ms)]
angle[2][index(1), score(0.999846), time(2.373200ms)]
angle[3][index(1), score(0.791865), time(2.258000ms)]
angle[4][index(1), score(1.000000), time(2.451200ms)]
---------- step: crnnNet getTextLine ----------
textLine0
textScores[0]{0.996313 ,0.999845 ,0.999914 ,0.999713 ,0.999677 ,0.998594 ,0.999956 ,0.999995 ,0.995888 ,0.998597}
crnnTime0
textLine1
textScores[1]{0.999805 ,0.576728 ,0.993639 ,0.999157 ,0.999847}
crnnTime1
textLine2
textScores[2]{0.999981 ,0.999988 ,0.999614 ,0.999997 ,0.999606 ,0.999977 ,0.999962}
crnnTime2
textLine3
textScores[3]{0.985631 ,0.999934 ,0.993689 ,0.982854 ,0.958149 ,0.996716 ,0.999792}
crnnTime3
textLine4
textScores[4]{0.987057 ,0.984709 ,0.969712 ,0.880784 ,0.790944 ,0.988959}
crnnTime4
=====End detect=====
FullDetectTime(628.647800ms)
棣欐腐娣卞湷鎶借锛屽彲閭瘎
涓撲笟鏌ユ€у埆
涓撲笟閴村畾B瓒呭崟
b瓒呬华鍣ㄦ煡鎬у埆
鍔犲井淇ee
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 optarg
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 "void __cdecl printGpuInfo(void)" (?printGpuInfo@@yaxxz)
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 "public: struct OcrResult __cdecl OcrLite::detect(char const *,char const *,int,int,float,float,float,bool,bool)" (?detect@OcrLite@@qeaa?AUOcrResult@@PEBD0HHMMM_N1@Z)
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 "public: void __cdecl OcrLite::Logger(char const *,...)" (?Logger@OcrLite@@QEAAXPEBDZZ)
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 "public: bool __cdecl OcrLite::initModels(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?initModels@OcrLite@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@000@Z)
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 "public: void __cdecl OcrLite::setGpuIndex(int)" (?setGpuIndex@OcrLite@@QEAAXH@Z)
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 "public: void __cdecl OcrLite::enableResultTxt(char const *,char const *)" (?enableResultTxt@OcrLite@@QEAAXPEBD0@Z)
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 "public: void __cdecl OcrLite::initLogger(bool,bool,bool)" (?initLogger@OcrLite@@QEAAX_N00@Z)
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 "public: void __cdecl OcrLite::setNumThread(int)" (?setNumThread@OcrLite@@QEAAXH@Z)
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl OcrLite::~OcrLite(void)" (??1OcrLite@@qeaa@XZ)
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 "public: __cdecl OcrLite::OcrLite(void)" (??0OcrLite@@qeaa@XZ)
1>OcrTest.obj : error LNK2001: 无法解析的外部符号 getopt_long
这个应该是库的版本不符合的问题,都是release64的,用的是复制main.cpp文件,请问下这个问题怎么解决
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.