-
Notifications
You must be signed in to change notification settings - Fork 844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【讨论】使用自制数字图像测试模型精度 #7
Comments
接下来,需要通过这些自制数字图像来检测模型的精度。
|
@leewishyuanfang great sharing! |
在上一步骤中出现了一个错误,就是测试时错误地使用了没有经过转换的手写数字图片,经改正后,实际190张图像中,成功识别的图像有53张,正确率0.327。 |
会不会是因为训练模型里的数字书写与你上传的书写差距过大。之前的训练应该还是比较狭窄吧 |
我提取了训练文件中的20张数字图像,成功率要高不少,感觉主要的区别在于训练图像的数字字体要粗一些 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在本次试验中,一共收集了19个人的手写数字笔迹,共190副图片。
为批量对这些图片进行处理,对图片处理的make_your_mnist.py代码进行了一定修改,具体修改如下:
# -- coding: utf-8 --
"""
Make mnist data set.
Ensure that the PIL module is installed before using the code below.
"""
from PIL import Image
cache = '../data/mnist_data/image/'
# 从image文件夹中依次读取数字图片并进行转换
# 本次一共收集到了19个人的0-9的数字笔迹,所以转换图片共10*19=190张
for i in range(0,9):
for j in range(1,19):
# 源图像
sr = (cache+'source/%d-%d.jpg' % (i,j))
# 目标图像
tg = (cache+'target/%d-%d.jpg' % (i,j))
I = Image.open(sr)
# 转换大小 为 28 * 28
I = I.resize((28, 28))
# 图像黑白化
L = I.convert('L')
# 保存转换后的图像
L.save(tg)
最后,得到190张处理后的,黑白化的28*28大小的数字图像
The text was updated successfully, but these errors were encountered: