Comments (6)
问题1
我的失误,造成了误解,可以看一下两个函数的内容,其实是没有区别的。
问题2
# 将图片数据与标签转换成数组
imgs = np.array(imgs)
labs = np.array([[0,1] if lab == my_faces_path else [1,0] for lab in labs])
前面已经将标签变成[0, 1]格式,所以res[0]取值就是0或1了。
from facerecognition-tensorflow.
imgs = np.array(imgs)
labs = np.array([[0,1] if lab == my_faces_path else [1,0] for lab in labs])
前面已经将标签变成[0, 1]格式,所以res[0]取值就是0或1了。
对,就是这块有点看不懂。这里把自己人脸的标签变成[0,1],其他人的变成[1,0],这里的标签是数组吧?那不应该是res[0]==0下标为0的元素==0的时候才是True 吗?求耐心指导,非常感谢,谢谢你!
from facerecognition-tensorflow.
predict = tf.argmax(output, 1)
这一行代码,tf.argmax返回的是索引位置,你去看一下这个函数具体用法。
from facerecognition-tensorflow.
嗯,这个函数我知道了,按行比较返回最大值的索引
前面是labs = np.array([[0,1] if lab == my_faces_path else [1,0] for lab in labs])
这里
predict = tf.argmax(output, 1)
res = sess.run(predict, feed_dict={x: [image/255.0], keep_prob_5:1.0, keep_prob_75: 1.0})
if res[0] == 1:
return True
else:
return False
然后res[0]==0或者1 所以不应该是==0的时候才true吗?我怎么感觉写反了?而且我刚录了5000张人脸,然后识别结果全是false,改成res[0]==0 正确了。我一会儿得回宿舍了,可能就上不了这个网站了。方便加个联系方式我好向你请教一下吗?非常感谢!!!
from facerecognition-tensorflow.
predict = tf.argmax(output, 1)
这一句代码 output的shape(None, 2), 存放了形如这样的数据:[[1,0], [0,1], [0,1], [1,0]]
经过 tf.argmax之后,得到 predict = [0, 1, 1, 0],
之后res[0] ==0实际就是表示[1, 0]了。
from facerecognition-tensorflow.
这块终于懂了,后期若还有啥不懂的还会继续来提问,望老哥你可以耐心指导一下,谢谢你啦
from facerecognition-tensorflow.
Related Issues (20)
- 这个只能识别出是不是自己的脸吧?能识别出别人的脸吗? HOT 4
- 博主,这个应改就检测自己一次吧,循环一次吧,没有多人检测吧
- 测试问题 HOT 1
- 当我运行train_faces.py HOT 1
- 安装咨询 HOT 1
- 运行错误 HOT 5
- ok
- 为什么要做亮度和对比度调整? HOT 1
- train_test_split是不是不在sklearn这个包了?
- train_faces没有生成model文件 导致is_myface136行报错 HOT 1
- 已经跑过该程序了 HOT 2
- 运行is_my_face.py文件时 HOT 7
- 运行is_my_face时 opencv出了问题 HOT 2
- 如果实际训练过程中出现了新的人,会不会在向量匹配时有影响?
- 请教:执行“train_faces.py”时报错,怎么解决呢?
- 你好,我想问下,为什么在运行train_face.py时没有生成模型 HOT 1
- 手机照片识别不出来
- Is this my face? True 不论识别谁都显示True HOT 2
- 运行get_my_faces代码时
- 用到的包的版本问题 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 facerecognition-tensorflow.