我正在使用estimateRigidTransform和大约两个100点的向量,并且工作正常.但不知何故getAffineTransform不起作用.
我知道findHomography使用RANSAC找到最好的矩阵,getPerspectiveTransform只需要4个点.
我的问题是如果我在estimateRigidTransform或getAffineTransform中提供更多输入会发生什么?
输入矩阵只需要4个点吗?或者做某种RANSAC?
我目前正在使用来自https://github.com/AKSHAYUBHAT/TensorFace的 VGG-face-discriptor .
VGG-face-discriptor使用VGG16和输出矢量2622,一些名人.我真正需要的是第二个完全连接的层的响应,其大小为4096.使用上面提到的存储库提供的代码
import vggface
from pprint import pprint
import tensorflow as tf
input_placeholder = tf.placeholder(tf.float32, shape=(1, 224, 224, 3))
network = vggface.VGGFace()
ses = tf.InteractiveSession()
network.load(ses,input_placeholder)
output = network.eval(feed_dict={input_placeholder:vggface.load_image('test/ak.png')})[0]
pprint(sorted([(v,network.names[k]) for k,v in enumerate(output)],reverse=True)[:10])
Run Code Online (Sandbox Code Playgroud)
工作非常好,给我最接近的名人脸部结果.
结果:
[(13.686731, 'Aamir_Khan'),
(8.4711819, 'Adam_Driver'),
(8.0207777, 'Manish_Dayal'),
(7.2776313, 'John_Abraham'),
(6.8999376, 'Jacob_Artist'),
(6.5390964, 'Adam_Copeland'),
(6.4980922, 'Adrian_Paul'),
(6.4170547, 'Akshay_Kumar'),
(6.3718734, 'D.B._Woodside'),
(6.0774565, 'Ajay_Devgn')]
Run Code Online (Sandbox Code Playgroud)
看着output变速器,我看到2622 numpy ndarry.但我实际上想要第二个特征向量..我怎样才能实现这个目标?
我查看了所有TensorFlow教程代码,但找不到这样的东西.和Caffe,我只是
out = net.forward()
v = net.blobs['fc7'].data[0].copy()
Run Code Online (Sandbox Code Playgroud)
很简单就是这样.我怎样才能在TensorFlow中看到'blob'?有numpy数组特征向量?
在Python中,我定义了
string = ("car-automobile, gem-jewel, journey-voyage, boy-lad, coast-shore, "
"asylum-madhouse, magician-wizard, midday-noon, furnacestove, food-fruit, "
"bird-cock, bird-crane, tool-implement, brother-monk, ladbrother, "
"crane-implement, journey-car, monk-oracle, cemetery-woodland, foodrooster, "
"coast-hill, forest-graveyard, shore-woodland, monk-slave, coast-forest, "
"lad-wizard, chord-smile, glass-magician, rooster-voyage, "
"noon-string".split(', '))
test = [i.split('-') for i in string]
Run Code Online (Sandbox Code Playgroud)
并且以下代码导致错误:
[e[1] for e in test]
Traceback (most recent call last):
File "<pyshell#136>", line 1, in <module>
[e[1] for e in test]
IndexError: list index out of range
Run Code Online (Sandbox Code Playgroud)
但以下代码有效
[e[-1] for e in …Run Code Online (Sandbox Code Playgroud) 我想每次都在number.jpg中保存图像.
例如,首先我将它保存为1.jpg,2.jpg,...
我将使用imwrite()函数编写图像.