{"id":20268971,"url":"https://github.com/1adrianb/unsupervised-face-representation","last_synced_at":"2025-10-08T07:34:47.737Z","repository":{"id":46944670,"uuid":"515657926","full_name":"1adrianb/unsupervised-face-representation","owner":"1adrianb","description":"Implementation for Pre-training strategies and datasets for facial representation learning, ECCV 2022","archived":false,"fork":false,"pushed_at":"2024-02-16T20:16:04.000Z","size":89,"stargazers_count":70,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T01:51:09.730Z","etag":null,"topics":["emotion-recognition","face-alignment","face-recognition","face-representation-learning","pytorch","representation-learning","unsupervised-learning"],"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/1adrianb.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-07-19T16:16:28.000Z","updated_at":"2025-02-19T03:01:48.000Z","dependencies_parsed_at":"2024-02-16T20:26:08.274Z","dependency_job_id":"19a69d62-3a71-4d8a-9686-afb78596ccb3","html_url":"https://github.com/1adrianb/unsupervised-face-representation","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/1adrianb%2Funsupervised-face-representation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1adrianb%2Funsupervised-face-representation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1adrianb%2Funsupervised-face-representation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1adrianb%2Funsupervised-face-representation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1adrianb","download_url":"https://codeload.github.com/1adrianb/unsupervised-face-representation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339262,"owners_count":21087214,"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":["emotion-recognition","face-alignment","face-recognition","face-representation-learning","pytorch","representation-learning","unsupervised-learning"],"created_at":"2024-11-14T12:22:09.141Z","updated_at":"2025-10-08T07:34:42.695Z","avatar_url":"https://github.com/1adrianb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pre-training strategies and datasets for facial representation learning\n\nThis is the PyTorch implementation for [Facial Representation Learning (FRL) paper](http://www.adrianbulat.com/downloads/ECCV2022/face_representation_learning.pdf):\n```\n@inproceedings{bulat2022pre,\n  title={Pre-training strategies and datasets for facial representation learning},\n  author={Bulat, Adrian and Cheng, Shiyang and Yang, Jing and Garbett, Andrew and Sanchez, Enrique and Tzimiropoulos, Georgios},\n  journal={ECCV},\n  year={2022}\n}\n```\n\n## Model Zoo\n\nWe provide bellow some of the models trained in a self-supervised manner. More models to be added later on.\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr style=\"text-align: right;\"\u003e\n      \u003cth align=\"center\"\u003edata\u003c/th\u003e\n      \u003cth align=\"center\"\u003ebackbone\u003c/th\u003e\n      \u003cth align=\"center\"\u003eurl\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003eVGG\u003c/td\u003e\n      \u003ctd align=\"center\"\u003eResNet 50\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e \u003ca href=\"https://www.adrianbulat.com/downloads/ECCV2022/pretrained_models/unsupervised/flr_r50_vgg_face.pth\"\u003emodel\u003c/a\u003e \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003eVGG (1M)\u003c/td\u003e\n      \u003ctd align=\"center\"\u003eResNet 50\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e \u003ca href=\"https://www.adrianbulat.com/downloads/ECCV2022/pretrained_models/unsupervised/flr_r50_vgg_face_1m.pth\"\u003emodel\u003c/a\u003e \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\nCode snippet for loading the weights in a torchvision standard resnet:\n\n```python\nimport torch\nfrom torchvision.models import resnet50\n\ninit_weights = torch.load('flr_r50_vgg_face.pth', map_location=torch.device('cpu'))['state_dict']\nconverted_weights = {k.replace('module.base_net.', ''):v for k, v in init_weights.items()}\n\nmodel = resnet50(weights=None)\nresults = model.load_state_dict(converted_weights, strict=False)\n# Note: the classifier layer is not loaded (fc.weight and fc.bias)\n# similarly,  the projection layers used for pre-training are discarded.\nprint(results)\n```\n\n## Installation\n\nTo use the code, clone the repo and install the following packages:\n\n```bash\ngit clone https://github.com/1adrianb/unsupervised-face-representation\n```\n\n### Requirements\n\n* Python \u003e= 3.8\n* Numpy\n* pytorch: [install instructions](https://pytorch.org/get-started/locally/)\n* torchvision: ``conda install torchvision -c pytorch``\n* apex: [install instructions](https://github.com/NVIDIA/apex#installation)\n* OpenCV: ``pip install opencv-python``\n* H5Py: ``conda install h5py``\n* tensorboard: ``pip install tensorboard``\n* pandas\n\nNote, if you are using pytorch \u003e 1.10 and experience issues with apex, please see [#1282](https://github.com/NVIDIA/apex/pulls/1282). Alternatively you can switch to the native pytorch amp.\n\n\n## Training\n\n```bash\nbash scripts/run.sh\n```\n\nBefore running the script make sure to set the appropiate paths. The models released in the paper were trained using 64 K40 GPUs.\n\n\n## Acknowledgement\n\nWe thank the original authors for releasing their code: [SwAV](https://github.com/facebookresearch/swav), [MoCo](https://github.com/facebookresearch/moco), [BYOL](https://github.com/deepmind/deepmind-research/blob/master/byol/byol_experiment.py), and [vissl](https://github.com/facebookresearch/vissl) which we base our code base upon.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1adrianb%2Funsupervised-face-representation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1adrianb%2Funsupervised-face-representation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1adrianb%2Funsupervised-face-representation/lists"}