{"id":14286848,"url":"https://github.com/CVIR/SLM","last_synced_at":"2025-08-15T07:31:20.418Z","repository":{"id":67247255,"uuid":"585282271","full_name":"CVIR/SLM","owner":"CVIR","description":"This repository contains the official implementation of SLM (WACV 2023) https://arxiv.org/pdf/2012.03358.pdf.","archived":false,"fork":false,"pushed_at":"2023-01-04T19:53:23.000Z","size":969,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-12-16T02:34:27.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CVIR.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,"publiccode":null,"codemeta":null}},"created_at":"2023-01-04T19:25:15.000Z","updated_at":"2023-11-21T08:50:58.000Z","dependencies_parsed_at":"2023-06-10T12:15:27.020Z","dependency_job_id":null,"html_url":"https://github.com/CVIR/SLM","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CVIR/SLM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVIR%2FSLM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVIR%2FSLM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVIR%2FSLM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVIR%2FSLM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CVIR","download_url":"https://codeload.github.com/CVIR/SLM/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVIR%2FSLM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270539512,"owners_count":24603182,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-23T17:01:04.098Z","updated_at":"2025-08-15T07:31:20.409Z","avatar_url":"https://github.com/CVIR.png","language":"Python","funding_links":[],"categories":["Training Paradigms"],"sub_categories":["**Domain Adaption**"],"readme":"# Select, Label, and Mix (SLM)\n\nThe repository contains the codes for the paper \"Select, Label, and Mix: Learning Discriminative Invariant Feature Representations for Partial Domain Adaptation\" part of Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), 2023.\n\n[Aadarsh Sahoo\u003csup\u003e1\u003c/sup\u003e](https://aadsah.github.io/), [Rameswar Panda\u003csup\u003e1\u003c/sup\u003e](https://rpand002.github.io/), [Rogerio Feris\u003csup\u003e1\u003c/sup\u003e](https://www.rogerioferis.org/), [Kate Saenko\u003csup\u003e1,2\u003c/sup\u003e](http://ai.bu.edu/ksaenko.html), [Abir Das\u003csup\u003e3\u003c/sup\u003e](https://cse.iitkgp.ac.in/~adas/)\n\n\u003csup\u003e1\u003c/sup\u003e MIT-IBM Watson AI Lab, \u003csup\u003e2\u003c/sup\u003e Boston University, \u003csup\u003e3\u003c/sup\u003e IIT Kharagpur\n\n[[Paper]](https://openaccess.thecvf.com/content/WACV2023/papers/Sahoo_Select_Label_and_Mix_Learning_Discriminative_Invariant_Feature_Representations_for_WACV_2023_paper.pdf) [[Project Page]](https://cvir.github.io/projects/slm)\n\n\n### Preparing the Environment\n\n#### Conda \nPlease use the `slm_environment.yml` file to create the conda environment `SLM` as:\n\n```\nconda env create -f slm_environment.yml\n```\n\n#### Pip\nPlease use the `requirements.txt` file to install all the required dependencies as:\n\n```\npip install -r requirements.txt\n```\n\n### Data Directory Structure\nAll the datasets should be stored in the folder `./data` following the convention `./data/\u003cdataset_name\u003e/\u003cdomain_names\u003e`. E.g. for `Office31` the structure would be as follows:\n\n```\n    .\n    ├── ...\n    ├── data\n    │   ├── Office31\n    │   │    ├── amazon\n    │   │    ├── webcam\n    │   │    ├── dslr\n    │   └── ...\n    └── ...\n```\n\nFor using datasets stored in some other directories, please update the path to the data accordingly in the txt files inside the folder `./data_labels`.\n\nThe official download links for the datasets used for this paper are:\n\n**Office31**: https://people.eecs.berkeley.edu/~jhoffman/domainadapt/#datasets_code\n\n**OfficeHome**: http://hemanthdv.org/OfficeHome-Dataset/\n\n**ImageNet-Caltech**: http://www.image-net.org/, http://www.vision.caltech.edu/Image_Datasets/Caltech256/\n\n**VisDA-2017**: http://ai.bu.edu/visda-2017/#download\n\n### Training SLM\nHere is a sample and recomended command to train SLM for the transfer task of `Amazon -\u003e Webcam` from `Office31` dataset:\n\n```\nCUDA_VISIBLE_DEVICES=0 python main.py --manual_seed 1 --dataset_name Office31 --src_dataset amazon --tgt_dataset webcam  --batch_size 64 --model_root ./checkpoints_a31_w10 --save_in_steps 500 --log_in_steps 10 --eval_in_steps 10 --model_name resnet50 --classifier_name resnet50 --source_images_path ./data_labels/Office31/amazon_31_list.txt --target_images_path ./data_labels/Office31/webcam_10_list.txt --pseudo_threshold 0.3 --warmstart_models True --num_iter_adapt 10000 --num_iter_warmstart 5000 --learning_rate 0.0005 --learning_rate_ws 0.001\n```\n\nFor detailed description regarding the arguments, use:\n\n```\npython main.py --help\n```\n\n### Citing SLM\n\nIf you use codes in this repository, consider citing SLM. Thanks!\n\n```\n@inproceedings{sahoo2023select,\n  title={Select, label, and mix: Learning discriminative invariant feature representations for partial domain adaptation},\n  author={Sahoo, Aadarsh and Panda, Rameswar and Feris, Rogerio and Saenko, Kate and Das, Abir},\n  booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision},\n  pages={4210--4219},\n  year={2023}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCVIR%2FSLM","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCVIR%2FSLM","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCVIR%2FSLM/lists"}