Skip to content

Chumsy0725/FBC-SA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Towards Generalizing to Unseen Domains with Few Labels - CVPR 2024

This repository gives the official implementation of Towards Generalizing to Unseen Domains with Few Labels (CVPR 2024)

How to setup the environment

This code is built on top of Dassl.pytorch and ssdg-benchmark. Please follow the instructions provided in https://github.com/KaiyangZhou/Dassl.pytorch and https://github.com/KaiyangZhou/ssdg-benchmark to install the dassl environment, as well as to prepare the datasets.

Checkpoints

All the checkpoints for our method on top of FixMatch are available on this link.

How to run

The script is provided in ssdg-benchmark/scripts/FBASA/run_ssdg.sh. You need to update the DATA variable that points to the directory where you put the datasets. There are two input arguments: DATASET and NLAB (total number of labels).

Here we give an example. Say you want to run FBC-SA on OfficHome under the 10-labels-per-class setting (i.e. 1950 labels in total), simply run the following commands in your terminal,

conda activate dassl
cd ssdg-benchmark/scripts/FBCSA
bash run_ssdg.sh ssdg_officehome 1950 

In this case, the code will run FBC-SA in four different setups (four target domains), each for five times (five random seeds). You can modify the code to run a single experiment instead of all at once if you have multiple GPUs.

To show the results, simply do

python parse_test_res.py output/ssdg_officehome/nlab_1950/FBCSA/resnet18 --multi-exp

Citation

@inproceedings{jay2024towards,
title={Towards Generalizing to Unseen Domains with Few Labels},
author={Chamuditha Jayanga Galappaththige, Sanoojan Baliah, Malitha Gunawardena, Muhammad Haris Khan},
booktitle={Conference on Computer Vision and Pattern Recognition 2024},
year={2024},
url={https://openreview.net/forum?id=1XN2EMzH8N}
}

About

Official Repository for "Towards Generalizing to Unseen Domains with Few Labels". (CVPR-24)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published