{"id":13612610,"url":"https://github.com/auroua/InsightFace_TF","last_synced_at":"2025-04-13T12:32:17.374Z","repository":{"id":59911090,"uuid":"123647445","full_name":"auroua/InsightFace_TF","owner":"auroua","description":"Insight Face on TensorFlow","archived":false,"fork":false,"pushed_at":"2019-08-14T03:36:46.000Z","size":366,"stargazers_count":697,"open_issues_count":76,"forks_count":253,"subscribers_count":45,"default_branch":"master","last_synced_at":"2024-08-02T20:44:29.480Z","etag":null,"topics":["facerecognition","tensorflow","tensorlayer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/auroua.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-03T01:10:35.000Z","updated_at":"2024-06-28T04:36:19.000Z","dependencies_parsed_at":"2022-09-25T07:00:35.567Z","dependency_job_id":null,"html_url":"https://github.com/auroua/InsightFace_TF","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auroua%2FInsightFace_TF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auroua%2FInsightFace_TF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auroua%2FInsightFace_TF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auroua%2FInsightFace_TF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auroua","download_url":"https://codeload.github.com/auroua/InsightFace_TF/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223585421,"owners_count":17169296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["facerecognition","tensorflow","tensorlayer"],"created_at":"2024-08-01T20:00:32.376Z","updated_at":"2024-11-07T20:31:15.452Z","avatar_url":"https://github.com/auroua.png","language":"Python","readme":"## Insight Face in TensorFlow\n\n#### Tasks\n* ~~mxnet dataset to tfrecords~~\n* ~~backbone network architectures [vgg16, vgg19, resnet]~~\n* ~~backbone network architectures [resnet-se, resnext]~~\n* ~~LResNet50E-IR~~\n* ~~LResNet100E-IR~~\n* ~~Additive Angular Margin Loss~~\n* ~~CosineFace Loss~~\n* ~~train network code~~\n* ~~add validate during training~~\n* ~~multi-gpu training~~\n* ~~combine losses~~ contributed by RogerLo.\n* evaluate code\n\n\n#### Training Tips(Continual updates)\n* If you can't use large batch size(\u003e128), you should use small learning rate\n* If you can't use large batch size(\u003e128), you can try batch renormalization(file `L_Resnet_E_IR_RBN.py`)\n* If use multiple gpus, you should keep at least 16 images each gpu.\n* Try [Group Normalization](https://arxiv.org/pdf/1803.08494.pdf), you can use the code `L_Resnet_E_IR_GBN.py`\n* Using the current model, and the lr schedule in `train_nets.py`, you can get the results as `model c`\n* The bug about model size is 1.6G have fixed based on issues #9. If you want to get a small model, you should use `L_Resnet_E_IR_fix_issues9.py`\n* multi-gpu training code's bug have fixed. If you want to use the correct version, you should use `train_nets_mgpu_new.py`\n\n\n#### Training models (Continual updates)\n\n##### model A\n| model name    | depth| normalization layer |batch size| total_steps | download | password |\n| ----- |:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|\n| model A | 50 |group normalization|16| 1060k |[model a](https://pan.baidu.com/s/1qWrDCTFlQXlFcBR-dqR-6A)|2q72|\n\n###### accuracy\n| dbname | accuracy |\n| ----- |:-----:|\n| lfw |0.9897|\n| cfp_ff |0.9876|\n| cfp_fp |0.84357|\n| age_db30 |0.914|\n\n\n##### model B\n| model name    | depth| normalization layer |batch size| total_steps| download | password |\n| ----- |:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|\n| model B | 50 |batch normalization|16| 1100k |[model_b](https://pan.baidu.com/s/11KDqOkF4ThO7mnQQaNO9bA) |h6ai|\n\n###### accuracy\n| dbname | accuracy |\n| ----- |:-----:|\n| lfw |0.9933|\n| cfp_ff |0.99357|\n| cfp_fp |0.8766|\n| age_db30 |0.9342|\n\n\n\n##### model C\n| model name    | depth| normalization layer |batch size| total_steps| download | password |\n| ----- |:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|\n| model C | 50 |batch normalization|16| 1950k |[model_c](https://pan.baidu.com/s/1ZlDcQPBh0znduSH6vQ_Q8Q) |8mdi|\n\n###### accuracy\n| dbname | accuracy |\n| ----- |:-----:|\n| lfw |0.9963|\n| cfp_ff |0.99586|\n| cfp_fp |0.9087|\n| age_db30 |0.96367|\n\n\n##### model D\n| model name    | depth| normalization layer |batch size| total_steps| model_size| download | password |\n| ----- |:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|\n| model D | 50 |batch normalization|136| 710k | 348.9MB |[model_d](https://pan.baidu.com/s/1tQYMqfbG36wg1cXKHVoMVw) |amdt|\n\n###### accuracy\n| dbname | accuracy |\n| ----- |:-----:|\n| lfw |0.9968|\n| cfp_ff |0.9973|\n| cfp_fp |0.9271|\n| age_db30 |0.9725|\n\n\n\n#### Requirements\n1. TensorFlow 1.4 1.6\n2. TensorLayer 1.7\n3. cuda8\u0026cudnn6 or cuda9\u0026cudnn7\n4. Python3\n\n\n#### Max Batch Size Test\n###### Environment\n\n| GPU    | cuda| cudnn | TensorFlow |TensorLayer|Maxnet |Gluon|\n| ----- |:-----:|:-----:|:------:|:---:|:------:|:---:|\n| Titan xp | 9.0 |7.0|1.6|1.7 |1.1.0|1.1.0 |\n\n###### Results\n\n| DL Tools        | Max BatchSize(without bn and prelu)| Max BatchSize(with bn only) | Max BatchSize(with prelu only) |Max BatchSize(with bn and prelu)|\n| ------------- |:-------------:|:--------------:|:------------:|:------------:|\n| TensorLayer      | (8000, 9000) |(5000, 6000)|(3000, 4000)|(2000, 3000) |\n| Mxnet      | (40000, 50000) |(20000, 30000)|(20000, 30000)|(10000, 20000) |\n| Gluon      | (7000, 8000) |(3000, 4000)|no official method| None |\n\n\u003e (8000, 9000) : 8000 without OOM, 9000 OOM Error\n\n###### Test Code\n\n|TensorLayer| Maxnet | Gluon |\n| ----- |:-----:|:-----:|\n| [tensorlayer_batchsize_test.py](https://github.com/auroua/InsightFace_TF/blob/master/test/benchmark/tensorlayer_batchsize_test.py) | [mxnet_batchsize_test.py](https://github.com/auroua/InsightFace_TF/blob/master/test/benchmark/mxnet_batchsize_test.py) |[gluon_batchsize_test.py](https://github.com/auroua/InsightFace_TF/blob/master/test/benchmark/gluon_batchsize_test.py)|\n\n\n\n#### pretrained model download link\n* [resnet_v1_50](http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz)\n* [resnet_v1_101](http://download.tensorflow.org/models/resnet_v1_101_2016_08_28.tar.gz)\n* [resnet_v1_152](http://download.tensorflow.org/models/resnet_v1_152_2016_08_28.tar.gz)\n* [vgg16](http://www.cs.toronto.edu/~frossard/post/vgg16/)\n* [vgg19](https://github.com/machrisaa/tensorflow-vgg)\n\n\n#### References\n1. [InsightFace mxnet](https://github.com/deepinsight/insightface)\n2. [InsightFace : Additive Angular Margin Loss for Deep Face Recognition](https://arxiv.org/abs/1801.07698)\n3. [Group Normalization](https://arxiv.org/pdf/1803.08494.pdf)\n3. [tensorlayer_vgg16](https://github.com/tensorlayer/tensorlayer/blob/master/example/tutorial_vgg16.py)\n4. [tensorlayer_vgg19](https://github.com/tensorlayer/tensorlayer/blob/master/example/tutorial_vgg19.py)\n5. [tf_slim](https://github.com/tensorflow/models/tree/master/research/slim)\n6. [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385)\n7. [Very Deep Convolutional Networks For Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556)\n8. [Squeeze-and-Excitation Networks](https://arxiv.org/pdf/1709.01507.pdf)","funding_links":[],"categories":["2. General Computer Vision"],"sub_categories":["1.2 DatasetAPI and TFRecord Examples"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauroua%2FInsightFace_TF","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauroua%2FInsightFace_TF","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauroua%2FInsightFace_TF/lists"}