-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
MobileFaceNet training pipeline #214
Comments
My 2-stage pipeline:
Pretrained model: baiduyun |
Can you share mobilenet v2 training pipeline? |
what is the accuracy on LFW and AgeDB after trained by softmax, can you share the training log? |
Hi, can I ask in this thread? |
I used mxnet to calculate the cosine distance of the value of fc1 output, the output is wrong. The model is downloaded from the above Baidu cloud, and then the picture is used by two different men and women, has been aligned with the lfww mtcnn picture of. `#coding=utf-8 image_size = (112,112) def load_model(model_prefix): def dis(x,y): def test(model_prefix): model_prefix = "../../models/model" #############Here are the output######## [00:19:53] src/nnvm/legacy_json_util.cc:190: Loading symbol saved by previous version v1.0.0. Attempting to upgra de... [00:19:53] src/nnvm/legacy_json_util.cc:198: Symbol successfully upgraded! (2, 3, 112, 112) (3, 112, 112) -0.9996472 could you tell me what have I missed? @nttstar |
why you thought the result was wrong? |
Because when I use the two image which are from the same person,the output is -0.99964917,which is similar to the images from different people as I wrote above. How can I tell the two images from the same people or not? what is the threshold?
来自 魅族手机
…-------- 原始邮件 --------
发件人:Jia Guo <notifications@github.com>
时间:周六 5月26日 21:30
收件人:deepinsight/insightface <insightface@noreply.github.com>
抄送:youyicloud <yanghy@youyicloud.com>,Comment <comment@noreply.github.com>
主题:Re: [deepinsight/insightface] MobileFaceNet training pipeline (#214)
why you thought the result was wrong?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
***@***.******@***.******@***.***":"ViewAction","target":"#214 (comment)","url":"https://github.com/deepinsight/insightface/issues/214#issuecomment-392261639","name":"View Issue"},"description":"View this Issue on ***@***.***":"Organization","name":"GitHub","url":"https://github.com"}} {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/deepinsight/insightface","title":"deepinsight/insightface","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in ***@***.*** in #214: why you thought the result was wrong?"}],"action":{"name":"View Issue","url":"#214 (comment)"}}} { ***@***.***": "MessageCard", ***@***.***": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "37567f93-e2a7-4e2a-ad37-a9160fc62647", "title": "Re: [deepinsight/insightface] MobileFaceNet training pipeline (#214)", "sections": [ { "text": "", "activityTitle": "**Jia Guo**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": ***@***.***", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", ***@***.***": "ActionCard", "inputs": [ { "isMultiLine": true, ***@***.***": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"deepinsight/insightface\",\n\"issueId\": 214,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"deepinsight/insightface\",\n\"issueId\": 214\n}" }, { "targets": [ { "os": "default", "uri": "#214 (comment)" } ], ***@***.***": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 335514256\n}" } ], "themeColor": "26292E" }
|
If the images were already aligned, why you resized them again in your code? |
I have just croped the image by the boxes, I need to resize the image to the input shape. I hava found you code in deploy dir, I am analyzing my mistakes by comparing my code with your code, thank you a lot ! |
# #The model I got is too big |
@BUAA-21Li |
@BUAA-21Li use deploy/model_slim.py to delete last layer |
Why have you pre-trained a model with softmax loss when training MobileFaceNet with Arcface loss, but training other networks from the scratch? |
@wayen820 THANKS ! I have solved it! |
**now we get more higher accuray using my modified mobilenet network [lfw][12000]Accuracy-Flip: 0.99617+-0.00358 |
@youyicloud is your problem solved? my code is similar to yours and the consine distances from samples are all around -0.99,no matter positive or negative samples. |
@BUAA-21Li you can use deploy/test.py and load mobilefacenet model, then you can use the consine distance or the Euclidean Distance. It can output the right answer~ |
@youyicloud thank you for your reply.Have you analyzed why your code failed getting correct result. |
In the article, you have reported results for LResNet100E-IR (for m=0.5): With the Mobilenet (m=?) you report the accuracies: What is the expected accuracy drop of this model on MegaFace Challenge 1 (Table 9 from the article)? |
Thanks for your code. Recently I was trying to reproduce the mobile facenet model by your instructions, yet I encountered some question as following, would you please give me some hints. (P.S. the training dataset was combined faces_ms1m_112x112 with my private dataset, using scripts like "im2rec.py", "face2rec2.py" and "dataset_merge.py".) root@656688c713aa:/proj/insightface/src# CUDA_VISIBLE_DEVICES='0,1,2,3' python -u train_softmax.py --data-dir ../datasets/xl_marked --network y1 --loss-type 0 --prefix ../mobile_facenet --per-batch-size 128 --lr-steps "240000,360000,440000" --margin-s 32.0 --margin-m 0.1 --ckpt 2 --emb-size 128 --fc7-wd-mult 10.0 --wd 0.00004 --max-steps 140002 |
@EdwardChou add "--version-output GNAP" to argument |
@shangleyi Thanks for reply. After append "--version-output GNAP" to argument, run, and another error pop out, yet I am using the correct input size, namely 112*112 input images. This is pretty wired.
The complete log is as following:
|
@EdwardChou How did you prepare train.rec |
Hi, @shangleyi
download im2rec.py, modify script follow #265
Modify line to "with open('IMG_DIR' + fullpath, 'rb') as fin:"
|
@EdwardChou I used face2rec2.py directly without using im2rec.py and it worked. Maybe you should write a script which resizes the images and then use face2rec2.py directly. I'm not so sure about im2rec.py. |
training dataset: ms1m, ms1m-v2. private dataset |
@shangleyi Thanks you so much. My problem is exactly the resize function in im2rec.py doesn't work. So I resize the images with another script. Currently the training procedure following instruction above looks good. You save my day! |
Is there any training file corresponding to Caffe? I want to use Caffe training. |
dataset: emore |
Hi, @nttstar I encounter some strange thing when I finetune mobile-facenet model (2nd step of 2-step pipeline) and would like to ask for your help. My training acc got stuck in 0.51~0.53 while accuracy of lfw, agedb-30 reach 95%. Similar to #187 My finetune param is like:
and the result is like:
I have seen your training log attach in baiduyun, the log shows the acc of your model reach 0.5 after 15 epoch, which is the same to my experiment result. Yet the your log stop at 24 epoch when the highest acc reach 0.55. Did you conduct further experiment to reach higher accuracy? Or there is something wrong with the calculation of training acc? Looking for your help, Thanks. |
Hi guys, |
@nttstar |
@karlTUM INFO:root:Epoch[15] Batch [32040-32060] Speed: 274.12 samples/sec acc=0.865625 |
similar issue.
@nttstar |
Hi, have you managed to get correct merged dataset? Thank you! |
It has been a year and I can hardly remember what did I do, but did you try adding the quotation marks? |
Trained mobileFaceNet on emore, here is the result: Called with argument: Namespace(batch_size=224, beta=1000.0, beta_freeze=0, beta_min=5.0, bn_mom=0.9, ce_loss=False, ckpt=1, color=0, ctx_num=1, cutoff=0, data_dir='../datasets/faces_emore', easy_margin=0, emb_size=128, end_epoch=100000, fc7_lr_mult=1.0, fc7_no_bias=False, fc7_wd_mult=10.0, gamma=0.12, image_channel=3, image_h=112, image_size='112,112', image_w=112, images_filter=0, loss_type=4, lr=0.1, lr_steps='200000,280000,320000', margin=4, margin_a=1.0, margin_b=0.0, margin_m=0.5, margin_s=64.0, max_steps=0, mom=0.9, network='y1', num_classes=85742, num_layers=1, per_batch_size=224, power=1.0, prefix='../models/y1-arcface-emore/model', pretrained='../models/y1-softmax-emore/model,234', rand_mirror=1, rescale_threshold=0, scale=0.9993, target='lfw,cfp_fp,agedb_30', use_deformable=0, verbose=2000, version_act='prelu', version_input=1, version_multiplier=1.0, version_output='E', version_se=0, version_unit=3, wd=4e-05) testing verification.. |
What does accuracy_flip mean? Does it have to do with using features of flipped images during training?(as described in one of the mobileface papers?) |
@nttstar你好,如何finetune自己的数据,能提供保护fc7的预训练模型吗? |
your max-steps is 140002(140k), but you said 120k, lr-steps is 240000(240k), 360000(360k), ... , which is right? |
what's your acc on train data |
Which version of ms1m did you use? I trained mobilefacenet with the ms1m-refine-v1 dataset and the same config (except that I used 2 GPUs with per_batch_size=256) but the maximum accuracy on LFW in 180K iterations was 0.99400. |
@bahar3474 hello,excuse me ,Where is the train_SOFTmax file? There is no such file in the branch of the new version |
@CasonTsai |
No description provided.
The text was updated successfully, but these errors were encountered: