This is the Pytorch implementation of our "Test-Time Training for Semantic Segmentation with Output Contrastive Loss". This code is based on the paper MaxSquare, due to using its pretrained checkpoint.
- Download Cityscapes, which contains 5,000 annotated images with 2048 × 1024 resolution taken from real urban street scenes. We use its validation set with 500 images.
- Download the checkpoint pretrained on the GTA5 -> CityScapes task and place it in fold checkpoints.
- Download the checkpoint pretrained on the SYNTHIA -> CityScapes task and place it in fold checkpoints.
python evaluate.py --pretrained_ckpt_file ./checkpoints/GTA5_source.pth --gpu 1 --method baseline --prior 0.0 --flip
python evaluate.py --pretrained_ckpt_file ./checkpoints/synthia_source.pth --gpu 1 --method baseline --prior 0.0 --flip
python evaluate.py --pretrained_ckpt_file ./checkpoints/GTA5_source.pth --gpu 1 --method TTT --prior 0.85 --learning-rate 2e-5 --pos-coeff 3.0
python evaluate.py --pretrained_ckpt_file ./checkpoints/synthia_source.pth --gpu 1 --method TTT --prior 0.85 --learning-rate 1e-5 --pos-coeff 3.0
We present several transfered results reported in our paper.
GTA2Cityscapes
Method | Source only | OCL |
---|---|---|
MIoUs | 37.5 | 45.0 |
Synthia2Cityscapes
Method | Source only | OCL |
---|---|---|
MIoUs | 31.5 | 36.9 |