Comments (2)
如果是通过文件的话,你可以自己仿照my_dataset.py里面的get_xxxx_data_loader,去做一个自己的dataloader,就类似于predict的时候差不多。
如果是PIL读入的图片的话,可以参考pytorch的api,用transform把图片变灰度图,变尺寸,转成tensor。然后对tensor进行reshape把图片的三维tensor变成模型需要的四维的。
然后仿照captcha_predict.py的代码,把图片的tensor变成Variable,然后调用cnn的模型进行前向传播,然后再把onehot形式的label按4个位置分别取最大值,最后输出4个字符的结果。
from pytorch-captcha-recognition.
实在不会用,用captcha_predict.py可以,但是我想在其它地方单独传入一张图片名称得到返回结果如何做呢?
实际使用时,并不是从本地文件夹打开,而很有可能直接传一张图片。所以你需要按照 seastarmanager 的建议,将图片进行特征数字化、归一化和灰度处理。要注意的是,图片尺寸大小的兼容问题。假如你训练的时候用的是 160*60,那么在预测时也要用这个大小。
from pytorch-captcha-recognition.
Related Issues (20)
- 我想问下如果修改验证码位数为6,怎么修改参数呢 HOT 1
- gpu似乎没有被使用 HOT 3
- 可以用自己的6位验证码集训练吗 HOT 1
- 关于验证码的应用
- 这是什么问题啊
- loss在下降,单识别结果几乎全错
- 效率问题 HOT 1
- 模型成功率为0? HOT 3
- 修改版本:https://github.com/pprp/captcha_identify.torch
- 识别率百分之四十 HOT 6
- 如何直接调用跑所有的图片的识别结果啊 HOT 1
- Hello, can you help me with captcha_test?
- 训练1w张图片,loss率最后也在0.01,使用测试集一只显示0,请问大佬怎么回事? HOT 3
- 模型训练详情 HOT 14
- 加群了 HOT 3
- 请教,如何只预测一张图片? HOT 1
- run captcha_predict.py got an error after change the png photo in predict
- 直接就用cpu训练,把我的电脑cpu给爆了 >_< HOT 2
- 如果是未知字符个数的验证码,4-7个字符的,应该如何修改呀,固定4个5个6个7个的都能跑 HOT 1
- 新手,请问为何要对结果进行独热编码啊
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-captcha-recognition.