seasonsh / docface Goto Github PK
View Code? Open in Web Editor NEWFace recognition system for ID photos
License: MIT License
Face recognition system for ID photos
License: MIT License
Great Work !
I found that the code works well on multiple gpu training but only for the data parallelism.
However, it is hard to train a model with the classes more than 10 million or even more. In that case,
the model parallelism should solve the problem. I was doing the implementations but the diam softmax may seriously interfere the model parallelism. Could you give the solutions or any idea ?
hello, the paper mentioned the Public IvS dataset and some other paper used the dataset for training; so I want to ask where can I get the Public IvS dataset?
Python: 3.6.9
Tensorflow: 1.8
I am trying to run the
python src/train_sibling.py config/finetune.py
with setting num_gpus = 0
But I see that the code is written for running on GPU's only.
Also getting the following error when trying to run.
Traceback (most recent call last):
File "src/train_sibling.py", line 124, in <module>
main(args)
File "src/train_sibling.py", line 45, in main
network.initialize(config, trainset.num_classes)
File "/home/zero/PycharmProjects/DocFace/src/sibling_net.py", line 60, in initialize
image_splits = tf.split(image_batch_placeholder, config.num_gpus)
File "/home/zero/PycharmProjects/DocFace/venv/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1391, in split
axis=axis, num_split=num_or_size_splits, value=value, name=name)
File "/home/zero/PycharmProjects/DocFace/venv/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 7709, in split
"Split", split_dim=axis, value=value, num_split=num_split, name=name)
File "/home/zero/PycharmProjects/DocFace/venv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 708, in _apply_op_helper
(key, op_type_name, attr_value.i, attr_def.minimum))
ValueError: Attr 'num_split' of 'Split' Op passed 0 less than minimum 1.
Is there any way for me to run it on CPU? @nicolas-raoul @seasonSH
When I train the basemodel according step 2, or extract features with basemodel, no gpu works.
thanks for the excellent work !
I try to implement your work in pytorch. When I implement the weight imprinting, i set the learning rate of the classifier layer to 0. then i use the follow steps:
1、calculate the features and normalize them as the weight vecotors.
2、replace the old weight vector
3、calculate the loss use am softmax
4、backward gradients and update weights except the classifier layer.
is it correct ?
i am not familiar with the tensorflow , so i don't understand your code very well.
please give me some advices, thanks !
How do you use it?
10 300
Abel_Pacheco 1 4
Akhmed_Zakayev 1 3
Akhmed_Zakayev 2 3
Amber_Tamblyn 1 2
Can you explain how it was generated?
Hi,
The guideline has provided the way to extract features for test images. But how to verify if two images belong to the same person or not? To calculate the distance between the extracted features? Can the pre-trained/fine-tuned network be used to output the probability of that?
Many thanks!
Hi, I am currently training the base model without se-module. The reg_loss decreased from 1.031 to 0.065 while the am loss seems stay at 16.287. Isn't training without Se-module just by commenting out the following part:
if i % 2 == 1:
net = se_module(net)
net = net + shortcut
shortcut = net
print('| shortcut')
at the face_resnet.py ? Would you please help me? Thank you.
seems the mps loss described in the paper is not the same with the code, which one is the right one?
Will it have a big impact on the recognize result if i skip this step?
你好,我是一名大四学生,正在做这人证识别方面的研究课题,请问下老哥您是否能提供一下你的训练模型和数据集,我的邮箱是[email protected]
--谢谢
hello sir, can you share your selfie ID dataset? I am very interested in your research.
[email protected]
thanks
hi, seasonSH
thanks for your work.
I use the MPS loss, when I train the model, the loss is allways about 0.5, is it right ? what is the final loss when using the MPS loss ?
训练后的模型导入报错???
NotFoundError (see above for traceback): Key FaceResNet/conv1/layer_0/Conv/biases not found in checkpoint
Hello, I have received the above error when I try to run train_base.py. Could I have the config file please?
Thank you,
pycoder074
(email should be in profile)
how to convert your tf base model to caffe model? i tried mmdnn, but got a empty model. Do you have any suggestions?
Hi: @seasonSH Yichun
thank you for your work .i trained the base model,how can i do?
essing/queues.py", line 105, in get
raise Empty
queue.Empty
Process Process-3:
Traceback (most recent call last):
File "/home/a302/laojiu/anaconda3/envs/tensorflow1.2.0/lib/python3.6/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/home/a302/laojiu/anaconda3/envs/tensorflow1.2.0/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/a302/laojiu/github/DocFace/src/utils.py", line 245, in batch_queue_worker
batch = self.get_batch(config.batch_size, config.batch_format)
File "/home/a302/laojiu/github/DocFace/src/utils.py", line 202, in get_batch
indices_batch.extend(self.index_queue.get(block=True, timeout=30))
File "/home/a302/laojiu/anaconda3/envs/tensorflow1.2.0/lib/python3.6/multiprocessing/queues.py", line 105, in get
raise Empty
queue.Empty
Traceback (most recent call last):
File "src/train_base.py", line 111, in <module>
main(args)
File "src/train_base.py", line 80, in main
batch = trainset.pop_batch_queue()
File "/home/a302/laojiu/github/DocFace/src/utils.py", line 260, in pop_batch_queue
batch = self.batch_queue.get(block=True, timeout=60)
File "/home/a302/laojiu/anaconda3/envs/tensorflow1.2.0/lib/python3.6/multiprocessing/queues.py", line 105, in get
raise Empty
queue.Empty
(tensorflow1.2.0) a302@a302-DGX-Station:~/laojiu/github/DocFace$
``` @
Hi , thanks for sharing your work. I want to train my traindataset but the error appeared all the time ,then I debug the code and the following text always extists . Can you tell me how to debug?
"usage: train_base.py [-h] config_file
train_base.py: error: the following arguments are required: config_file"
i transfer it to pb,when i run it in java it encouter problems. i try the model facenet with pb file and success.so i am confused that weather docface model can run in java?
Exception in thread "main" java.lang.RuntimeException: Reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero
[[{{node None/FaceResNet/NetA_1/conv2/SE/Flatten/flatten/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](None/FaceResNet/NetA_1/conv2/SE/AvgPool2D/AvgPool, None/FaceResNet/NetA_1/conv2/SE/Flatten/flatten/Reshape/shape)]]
at com.umetrip.cv.service.TFTest.performInference(TFTest.java:64)
at com.umetrip.cv.service.TFTest.main(TFTest.java:26)
Caused by: java.lang.IllegalArgumentException: Reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero
[[{{node None/FaceResNet/NetA_1/conv2/SE/Flatten/flatten/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](None/FaceResNet/NetA_1/conv2/SE/AvgPool2D/AvgPool, None/FaceResNet/NetA_1/conv2/SE/Flatten/flatten/Reshape/shape)]]
at org.tensorflow.Session.run(Native Method)
at org.tensorflow.Session.access$100(Session.java:48)
at org.tensorflow.Session$Runner.runHelper(Session.java:314)
at org.tensorflow.Session$Runner.run(Session.java:264)
at com.umetrip.cv.service.TFTest.performInference(TFTest.java:58)
... 1 more
Dear @seasonSH ,
Would you like to teach us how to initialize weights of classifier at finetuning stage, which is not mentioned in your paper?
Thank you for your codes! Can you please share public IvS dataset? I couldn't find it.
hi, seasonSH:
thanks for your work.
in your implementaion, the config of diam is:
losses = {
'diam': {'scale': 'auto', 'm': 5.0, 'alpha':1.0}
}
but the in the am-softmax paper, the m is about 0.35, so, my question is why in your implemention the m is set to 5, it's much larger than the origin am-softmax paper setting ?
Looking forward for your replay !
ValueError: Cannot feed value of shape (128, 250, 250, 3) for Tensor 'inputs:0', which has shape '(?, 112, 96, 3)'
DocFace/src/basenet.py", line 232, in extract_feature
result[start_idx:end_idx] = self.sess.run(self.outputs, feed_dict=feed_dict)
Looking at the code, why is there an SE module and why was it not referenced in the DocFace paper?, From my limited understanding of tf-slim, does the following
with slim.arg_scope([slim.batch_norm, slim.dropout], is_training=phase_train):
print('input shape:', [dim.value for dim in images.shape])
net = conv_module(images, 0, [32, 64], scope='conv1')
print('module_1 shape:', [dim.value for dim in net.shape])
net = conv_module(net, 2, [64, 128], scope='conv2')
print('module_2 shape:', [dim.value for dim in net.shape])
net = conv_module(net, 4, [128, 256], scope='conv3')
print('module_3 shape:', [dim.value for dim in net.shape])
net = conv_module(net, 10, [256, 512], scope='conv4')
print('module_4 shape:', [dim.value for dim in net.shape])
net = conv_module(net, 6, [512], scope='conv5')
print('module_5 shape:', [dim.value for dim in net.shape])
actually use batch_norm
and dropout
in the model at all? How does the model know when and where to create the mentioned layers?
Hello, I have sent an email to the author to apply for the data set, but there was no reply. I wonder if you could share the data set with me? My email is [email protected]
How to test the model, cause i can't find any test script. Sorry still quite a noob in machine learning.
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.