stdcoutzyx / deepid_faceclassify Goto Github PK
View Code? Open in Web Editor NEWPractise of DeepID for Face Classification
Practise of DeepID for Face Classification
I just start to learn DEEPID using caffe, and I wonder when I extract all pictures' 160-d features, then I need to calculate cos distance between new face(validation data chosen from the same data set with training data set) and all pictures' 160-d features? Cause in training data, every people has more than 1 face picture.
So which way should I use?
A. calculate cos distance between new face and all training data,then choose a closest one as result.
B. average every people's 160-d feature,then calculate cos distance between new face and every people,then choose a closest one as result.
Thanks.
ubgpu@ubgpu:~/PycharmProjects/deepID/DeepID_FaceClassify/src/conv_net$ python deepid_class.py ../../../../../big_data/youtube_face/YouTubeFaces/test_vector_folder ../../../../../big_data/youtube_face/YouTubeFaces/train_vector_folder ../../../../../big_data/youtube_face/YouTubeFaces/params_file
if on theano0.6
Using gpu device 0: GeForce GTX 970
loading data ...
train_x: (31900, 7755)
train_y: Shape.0
valid_x: (7975, 7755)
valid_y: Shape.0
building the model ...
Traceback (most recent call last):
File "deepid_class.py", line 257, in
simple_deepid(learning_rate=0.01, n_epochs=20, dataset=(sys.argv[1], sys.argv[2]), params_file=sys.argv[3], nkerns=[20,40,60,80], batch_size=500, n_hidden=160, n_out=1595, acti_func=relu)
File "deepid_class.py", line 245, in simple_deepid
deepid.build_train_model()
File "deepid_class.py", line 193, in build_train_model
self.y: self.train_set_y[self.index * self.batch_size : (self.index+1) * self.batch_size]}
File "/usr/local/lib/python2.7/dist-packages/theano/compile/function.py", line 266, in function
profile=profile)
File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 489, in pfunc
no_default_updates=no_default_updates)
File "/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py", line 217, in rebuild_collect_shared
raise TypeError(err_msg, err_sug)
TypeError: ('An update must have the same type as the original shared variable (shared_var=W, shared_var.type=CudaNdarrayType(float32, matrix), update_val=Elemwise{sub,no_inplace}.0, update_val.type=TensorType(float64, matrix)).', 'If the difference is related to the broadcast pattern, you can call the tensor.unbroadcast(var, axis_to_unbroadcast[, ...]) function to remove broadcastable dimensions.')
ubgpu@ubgpu:/PycharmProjects/deepID/DeepID_FaceClassify/src/conv_net$/PycharmProjects/deepID/DeepID_FaceClassify/src/conv_net$
ubgpu@ubgpu:
"ykreadme" 63L, 3552C written
ubgpu@ubgpu:/PycharmProjects/deepID$/PycharmProjects/deepID$
ubgpu@ubgpu:
I have a very large dataset of 2million identities with 40 million pics, for each identity i have 20 pics.
I have 4 K80 Servers for the train, how can i contact you ?
As mentioned in the readme file:
The 5th img is both in train and val set?
hi,
i run your code on youtube database and received your result in readme.
but ,after run "deepid-generator.py" the generated feature is very sparse.
it's true?
thans
In the DeepID paper, the third and fourth convolutional layer' weights are locally
shared. But, there seems no locally shared weights in your network structure. Do you know how to realize it in convolutional network?
when I run this code vectorize_img.py it shows that:
Traceback (most recent call last):
File "vectorize_img.py", line 87, in
test_vec = vectorize_imgs(test_path_and_labels, img_size)
File "vectorize_img.py", line 43, in vectorize_imgs
arrs = np.asarray(arrs, dtype='float64')
File "D:\Anaconda2\lib\site-packages\numpy\core\numeric.py", line 474, in asarray
return array(a, dtype, copy=False, order=order)
ValueError: could not broadcast input array from shape (250,250,3) into shape (250,250)
I have modify the img_size
img_size = (3, 250, 250) # channel, height, width
Thanks!
hi,
can you share the param_file? if i just want to use the network without training over my data?
Sorry to bother you but I met a tough bug which I really dont know how to do during running the deepid_class.py . Heres's my bug below:
And it shows that there's a ValueError , I searched and it seemed like , "the filter size for training is different from that of I used ".. But I dont have any idea about this ..
Can you tell me why is that ? Thanks for answering !!
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.