{"id":18439452,"url":"https://github.com/idiap/model-uncertainty-for-adaptation","last_synced_at":"2025-04-07T21:32:29.700Z","repository":{"id":144962369,"uuid":"355463335","full_name":"idiap/model-uncertainty-for-adaptation","owner":"idiap","description":"Code paper Uncertainty Reduction for Uncertainty Reduction for Model Adaptation in Semantic Segmentation at CVPR 2021","archived":false,"fork":false,"pushed_at":"2022-09-12T18:42:30.000Z","size":140,"stargazers_count":51,"open_issues_count":1,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-23T01:01:50.164Z","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":"other","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":"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":"2021-04-07T08:09:16.000Z","updated_at":"2025-03-11T14:35:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"93cc7b9e-be47-4c8e-a0e2-c2c968f0b2f6","html_url":"https://github.com/idiap/model-uncertainty-for-adaptation","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/idiap%2Fmodel-uncertainty-for-adaptation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmodel-uncertainty-for-adaptation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmodel-uncertainty-for-adaptation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiap%2Fmodel-uncertainty-for-adaptation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idiap","download_url":"https://codeload.github.com/idiap/model-uncertainty-for-adaptation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247732685,"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":[],"created_at":"2024-11-06T06:24:50.106Z","updated_at":"2025-04-07T21:32:29.691Z","avatar_url":"https://github.com/idiap.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code for paper [*Uncertainty Reduction for Model Adaptation in Semantic Segmentation*](http://publications.idiap.ch/attachments/papers/2021/Sivaprasad_CVPR_2021.pdf) at CVPR 2021\n\nIn this package, we provide our PyTorch code for out CVPR 2021 paper on Model Adaptation for Segmentation. If you use our code, please cite us:\n\n```bibtex\n@inproceedings{teja2021uncertainty,\n  author={S, Prabhu Teja and Fleuret, François},\n  booktitle={2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, \n  title={Uncertainty Reduction for Model Adaptation in Semantic Segmentation}, \n  year={2021},\n  volume={},\n  number={},\n  pages={9608-9618},\n  doi={10.1109/CVPR46437.2021.00949}}\n```\n\nThe PDF version of the paper is available [here](http://publications.idiap.ch/attachments/papers/2021/Sivaprasad_CVPR_2021.pdf).\n\n## Requirements\n\nWe use PyTorch for the experiments. The conda environment required to run these codes can be installed by\n\n`conda create --name ucr --file spec-file.txt`\n\nWhile we aren't aware of any python version specific idiosyncracies, we tested this on Python 3.7 on Debian, with the above `spec-file.txt`. If you find any missing details, or have trouble getting it to run, please create an issue.\n\n## Training the network\n\n### Downloading pre-trained models\n\nWe use the pretrained models provided by [MaxSquareLoss](https://github.com/ZJULearning/MaxSquareLoss) at [https://drive.google.com/file/d/1QMpj7sPqsVwYldedZf8A5S2pT-4oENEn/view](https://drive.google.com/file/d/1QMpj7sPqsVwYldedZf8A5S2pT-4oENEn/view) into a folder named `pretrained`\n\n### Setting up paths\n\nFirst, the paths to the Cityscapes dataset has to be set in `datasets/new_datasets.py` in the dataset's constructor. The path to NTHU cities dataset can be set in `utils/argparser.py` in line 15 at `DATA_TGT_DIRECTORY` or can be added to the command line call at with `--data-tgt-dir`. The code trains the network and evaluates its performance and writes it into the log file in the `savedir` called `training_logger`.\n\n### Running the code\n\nThen code can be run with\n\n```python\npython do_segm.py --city {city} --no-src-data --freeze-classifier --unc-noise --lambda-ce 1 --lambda-ent 1  --save {savedir} --lambda-ssl 0.1\n```\n\nwhere `city` can in `Rome` or `Rio` or `Tokyo` or `Taipei`, and `savedir` is the path to save the logs and models. \n\n## Acknowledgements\n\nThis code borrows parts from [MaxSquareLoss](https://github.com/ZJULearning/MaxSquareLoss) (the network definitions, and pretrained models) and [CRST](https://github.com/yzou2/CRST) (class balanced pseudo-label generation). The author thanks Evann Courdier for parts of the clean `datasets` code.\n\n## License\n\nThis software is distributed with the **MIT** license which pretty much means that you can use it however you want and for whatever reason you want. All the information regarding support, copyright and the license can be found in the [`LICENSE`](./LICENSE) file in the repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiap%2Fmodel-uncertainty-for-adaptation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidiap%2Fmodel-uncertainty-for-adaptation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiap%2Fmodel-uncertainty-for-adaptation/lists"}