{"id":18439450,"url":"https://github.com/idiap/multimodal_gaze_target_prediction","last_synced_at":"2025-04-07T21:32:29.592Z","repository":{"id":144962438,"uuid":"553453434","full_name":"idiap/multimodal_gaze_target_prediction","owner":"idiap","description":"This repo provides the training and testing code for our paper \"A Modular Multimodal Architecture for Gaze Target Prediction: Application to Privacy-Sensitive Settings\" published at the GAZE workshop at CVPR 2022","archived":false,"fork":false,"pushed_at":"2022-10-18T08:38:20.000Z","size":50,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-23T01:01:50.166Z","etag":null,"topics":["attention","cvpr","cvpr2022","gaze","gaze-estimation","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idiap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/GPL-3.0-only.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-10-18T08:36:36.000Z","updated_at":"2025-02-28T14:17:15.000Z","dependencies_parsed_at":"2023-09-25T06:47:05.297Z","dependency_job_id":"dc1265de-75bf-404c-95bc-ddbcf2e95de1","html_url":"https://github.com/idiap/multimodal_gaze_target_prediction","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"1d2b87c27511836b6ff6e239e197143d8fa40acd"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmultimodal_gaze_target_prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmultimodal_gaze_target_prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmultimodal_gaze_target_prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmultimodal_gaze_target_prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idiap","download_url":"https://codeload.github.com/idiap/multimodal_gaze_target_prediction/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247732686,"owners_count":20986902,"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":["attention","cvpr","cvpr2022","gaze","gaze-estimation","pytorch"],"created_at":"2024-11-06T06:24:50.104Z","updated_at":"2025-04-07T21:32:25.325Z","avatar_url":"https://github.com/idiap.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Overview\n\nThis repo provides the training and testing code for our paper \"A Modular Multimodal Architecture for Gaze Target Prediction: Application to Privacy-Sensitive Settings\" published at the GAZE workshop at CVPR 2022.\n[[paper]](https://openaccess.thecvf.com/content/CVPR2022W/GAZE/papers/Gupta_A_Modular_Multimodal_Architecture_for_Gaze_Target_Prediction_Application_to_CVPRW_2022_paper.pdf) [[video]](https://youtu.be/z-XSwLOpNzw)\n\n\n### Setup\n\nWe use the GazeFollow and VideoAttentionTarget datasets for training and testing our models. Please download them at the following link provided by ejcgt/attention-target-detection: \u003cbr\u003e\nGazeFollow extended: [link](https://www.dropbox.com/s/3ejt9pm57ht2ed4/gazefollow_extended.zip?dl=0) \u003cbr\u003e\nVideoAttentionTarget: [link](https://www.dropbox.com/s/8ep3y1hd74wdjy5/videoattentiontarget.zip?dl=0)\n\nNext, extract the pose and depth modalities for both datasets following the instructions in [modality_extraction.md](modality_extraction.md)\n\nAfter, please update the paths to the datasets in the ```config.py``` file.\n\nWe use pytorch for our experiments. Use the provided environment file to create the conda environment for the experiments.\n```\nconda env create -f environment.yml\n```\n\n\n### Training\n\n#### Training on GazeFollow\n##### Step 1. Train the single modality models\n```\npython train_on_gazefollow.py --modality image --backbone_name efficientnet-b1 --log_dir \u003cpath\u003e\npython train_on_gazefollow.py --modality depth --backbone_name efficientnet-b0 --log_dir \u003cpath\u003e\npython train_on_gazefollow.py --modality pose --backbone_name efficientnet-b0 --log_dir \u003cpath\u003e\n```\nThe trained model weights will be saved in the specified ```log_dir```. \n\n##### Step 2. Initialize the weights for the attention model\n```\npython initialize_attention_model.py --image_weights \u003cpath\u003e --depth_weights \u003cpath\u003e --pose_weights \u003cpath\u003e --attention_weights \u003cpath\u003e\n```\nProvide the paths to the pretrained image, depth and pose models. The attention model with initialized weights will be saved in the path specified by the ```attention_weights``` argument.\n\n##### Step 3. Train the attention model\n```\npython train_on_gazefollow.py --modality attention --init_weights \u003cpath\u003e --log_dir \u003cpath\u003e\n```\nProvide the path to the initialized attention model weights. The trained model weights will be saved in the specified ```log_dir```.\n\n\n#### Training on VideoAttentionTarget\n\nSet ```pred_inout=True``` in the ```config.py``` file.\n\n##### Train the single modality models\n```\npython train_on_videoatttarget.py --modality image --init_weights \u003cpath\u003e --backbone_name efficientnet-b1 --log_dir \u003cpath\u003e\npython train_on_videoatttarget.py --modality depth --init_weights \u003cpath\u003e --backbone_name efficientnet-b0 --log_dir \u003cpath\u003e\npython train_on_videoatttarget.py --modality pose --init_weights \u003cpath\u003e --backbone_name efficientnet-b0 --log_dir \u003cpath\u003e\n```\nProvide the initial weights from training on GazeFollow. The trained model weights will be saved in the specified ```log_dir```.\n\n##### Train the attention model\n```\npython train_on_videoatttarget.py --modality attention --init_weights \u003cpath\u003e --log_dir \u003cpath\u003e\n```\nProvide the initial weights from training on GazeFollow. The trained model weights will be saved in the specified ```log_dir```.\n\n\n#### Training the privacy-sensitive models\nSimply set ```privacy=True``` in the ```config.py``` file. Then follow the same steps as above to train the respective models.\n\n\n### Testing\n\n#### Testing on GazeFollow\n```\npython eval_on_gazefollow.py --model_weights \u003cpath\u003e \n```\nProvide the path to the model weights with the ```model_weights``` argument.\n\n#### Testing on VideoAttentionTarget\n```\npython eval_on_videoatttarget.py --model_weights \u003cpath\u003e\n```\nProvide the path to the model weights with the ```model_weights``` argument.\n\n\n### Pre-trained models\nPre-trained human-centric module: [link](https://drive.switch.ch/index.php/s/5hDsBdP4OsLks5X) \u003cbr\u003e\nPre-trained attention model on GazeFollow: [link](https://drive.switch.ch/index.php/s/fJVjWSJWQtoJeT3) \u003cbr\u003e\nPre-trained attention model on VideoAttentionTarget: [link](https://drive.switch.ch/index.php/s/EjVQlvUDisvL1c4)\n\n\n### Citation\n\nIf you use our code, please cite:\n```bibtex\n@inproceedings{gupta2022modular,\n  title={A Modular Multimodal Architecture for Gaze Target Prediction: Application to Privacy-Sensitive Settings},\n  author={Gupta, Anshul and Tafasca, Samy and Odobez, Jean-Marc},\n  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW)},\n  pages={5041--5050},\n  year={2022}\n}\n```\n\n### References\nParts of the code have been adapted from ejcgt/attention-target-detection\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiap%2Fmultimodal_gaze_target_prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidiap%2Fmultimodal_gaze_target_prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiap%2Fmultimodal_gaze_target_prediction/lists"}