{"id":28505098,"url":"https://github.com/prs-eth/dginstyle-segmodel","last_synced_at":"2025-07-06T12:31:57.256Z","repository":{"id":231189321,"uuid":"740574487","full_name":"prs-eth/DGInStyle-SegModel","owner":"prs-eth","description":"Downstream semantic segmentation  evaluation of DGInStyle.","archived":false,"fork":false,"pushed_at":"2024-04-01T23:08:39.000Z","size":3507,"stargazers_count":25,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-08T19:06:55.432Z","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/prs-eth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2024-01-08T16:13:58.000Z","updated_at":"2025-04-18T05:47:22.000Z","dependencies_parsed_at":"2024-04-02T23:41:57.843Z","dependency_job_id":null,"html_url":"https://github.com/prs-eth/DGInStyle-SegModel","commit_stats":null,"previous_names":["yurujaja/dginstyle-segmodel","prs-eth/dginstyle-segmodel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prs-eth/DGInStyle-SegModel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FDGInStyle-SegModel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FDGInStyle-SegModel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FDGInStyle-SegModel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FDGInStyle-SegModel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prs-eth","download_url":"https://codeload.github.com/prs-eth/DGInStyle-SegModel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FDGInStyle-SegModel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263900743,"owners_count":23527302,"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":"2025-06-08T19:06:38.359Z","updated_at":"2025-07-06T12:31:57.249Z","avatar_url":"https://github.com/prs-eth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## :minidisc: DGInStyle-SegModel: Downstream Tasks Evaluation\n\nThis is the downstream tasks evaluation component of [DGInStyle](https://dginstyle.github.io/). The repository hosts implementations of the off-the-shelf semantic segmentation networks trained on datasets that utilize the [DGInStyle data generator](https://github.com/yurujaja/DGInStyle).\n\n\n[[Project Page]](https://dginstyle.github.io/) | [[ArXiv]](https://arxiv.org/abs/2312.03048) |\n[[Datasets]](https://drive.google.com/file/d/1e2wiwr5_wgCN3pLCQMOQvjRqQYtEozWy/view)\n\nBy [Yuru Jia](https://github.com/yurujaja),\n[Lukas Hoyer](https://lhoyer.github.io/),\n[Shengyu Huang](https://shengyuh.github.io/),\n[Tianfu Wang](https://tianfwang.github.io/),\n[Luc Van Gool](https://scholar.google.com/citations?user=TwMib_QAAAAJ\u0026hl=en),\n[Konrad Schindler](https://scholar.google.com/citations?user=FZuNgqIAAAAJ\u0026hl=en),\n[Anton Obukhov](https://www.obukhov.ai/)\n \n\u003cimg src=\"docs/history.png\" width=\"50%\" height=\"60%\"\u003e\n\n## :gear: Setup Environments\nFor this project, we used python/3.8.5, cuda/11.0.3. \n\n### Repository\n```bash\ngit clone https://github.com/yurujaja/DGInStyle-SegModel.git\ncd DGInStyle-SegModel\n```\n### Dependencies\n```bash\nexport SegModel_PATH=/path/to/venv/segmodel # change this\npython3 -m venv ${SegModel_PATH}\nsource ${SegModel_PATH}/bin/activate\n\n# use --ignore-installed to override pytorch installation\npip install --ignore-installed -r requirements.txt -f https://download.pytorch.org/whl/torch_stable.html\n# requires the other packages to be installed first\npip install mmcv-full==1.3.7  \n```\n\n## :open_file_folder: Setup Datasets\n\nIn domain generalization scenario, semantic segmentation models are trained exclusively with synthetic datasets and tested on target (real-world) datasets.\n\n### Synthetic Datasets: \n- **DGInStyle Datasets**: Please put the [DGInStyle produced dataset](https://github.com/yurujaja/DGInStyle) into `data/dginstyle_gen`. \n- **GTA**: Please download all image and label packages from here and extract them to `data/gta`. Then run the following scripts to generate rare classes related files and sample GTA subsets based on rare class sampling.\n   ```   \n   cd tools\n   python convert_datasets/gta.py data/gta --nproc 8   # generate rare classes related files\n   python rcs_sample_gta.py   # sample GTA subsets\n   ```\n### Real-World Datasets:\n\nOnly evaluation datasets are essential for the real-world datasets. \n- **Cityscapes**: Please download leftImg8bit_trainvaltest.zip and\ngt_trainvaltest.zip from [here](https://www.cityscapes-dataset.com/downloads/)\nand extract them to `data/cityscapes`.\n- **BDD100K**: Please download the `10K Images` and `Segmentation` from\n[here](https://bdd-data.berkeley.edu/portal.html#download) and extract it\nto `data/bdd100k`.\n- **Mapillary**: Please download the mapillary-vistas-dataset_public_v1.2.zip\nfrom [here](https://www.mapillary.com/dataset/vistas) and extract it\nto `data/mapillary`.\n- **ACDC**: Please download rgb_anon_trainvaltest.zip and\ngt_trainval.zip from [here](https://acdc.vision.ee.ethz.ch/download) and\nextract them to `data/acdc`. Further, please restructure the folders from\n`condition/split/sequence/` to `split/` using the following commands:\n\n   ```shell\n   rsync -a data/acdc/rgb_anon/*/val/*/* data/acdc/rgb_anon/val/\n   rsync -a data/acdc/gt/*/val/*/*_labelTrainIds.png data/acdc/gt/val/\n   ```\n- **Dark Zurich**: Please download the Dark_Zurich_val_anon.zip from\n[here](https://www.trace.ethz.ch/publications/2019/GCMA_UIoU/) and extract it\nto `data/dark_zurich`.\n\n## :balance_scale: Training\nUse the following script to automatically generate and train the configs:\n```shell\npython run_experiments.py --exp \u003cID\u003e\n```\nThe training configs, logs and checkpoints are saved in `work_dirs/`. More information about the available experiments and their assigned IDs, can be found in [experiments.py](experiments.py).\n\n## :hook: Testing \u0026 Predictions\nTo evaluate the model saved in `work_dirs/your_exp/`, run the following script:\n```shell\nsh test.sh work_dirs/your_exp/\n```\nTo specify the dataset or visualizations, please refer to [tools/test.py](tools/test.py) for further instructions.\n\n### Provided checkpoints\nWe provide the [checkpoints, training logs and evaluation files](https://huggingface.co/yurujaja/DGInStyle/tree/main/Segmentation_Models) for two DG models with MiT-B5 backbone: DAFormer and HRDA. \n\n## :shamrock: Acknowledgements\n\nThis repository is based on the following open-source projects. We thank their\nauthors for making the source code publicly available.\n\n* [HRDA](https://github.com/lhoyer/HRDA)\n* [DAFormer](https://github.com/lhoyer/DAFormer)\n* [MMSegmentation](https://github.com/open-mmlab/mmsegmentation)\n* [SegFormer](https://github.com/NVlabs/SegFormer)\n* [DACS](https://github.com/vikolss/DACS)\n* [SHADE](https://github.com/HeliosZhao/SHADE)\n\n## :receipt: License\n\nThis project is released under the [Apache License 2.0](LICENSE), while some specific features in this repository are with other licenses. Please refer to [LICENSE](LICENSE) for the careful check, if you are using our code for commercial matters.\n\n## :page_with_curl: Citation\n```bibtex\n@misc{jia2023dginstyle,\n      title={DGInStyle: Domain-Generalizable Semantic Segmentation with Image Diffusion Models and Stylized Semantic Control}, \n      author={Yuru Jia, Lukas Hoyer, Shengyu Huang, Tianfu Wang, Luc Van Gool, Konrad Schindler, Anton Obukhov},\n      year={2023},\n      eprint={2312.03048},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV}\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprs-eth%2Fdginstyle-segmodel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprs-eth%2Fdginstyle-segmodel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprs-eth%2Fdginstyle-segmodel/lists"}