This repo covers the implementation of MetaPix: Domain transfer for semantic segmentation by meta pixel weighting published on Image and Vision Computing, 2021.
@article{Jian2021MetaPix,
author = {Jian, Yiren and Gao, Chongyang},
title = {MetaPix: Domain Transfer for Semantic Segmentation by Meta Pixel Weighting},
journal = {Image and Vision Computing},
pages = {104334},
year = {2021},
issn = {0262-8856}
}
- Python 3.7
- Pytorch >= 1.5
- CUDA 9.2 or higher
- Clone the repo:
$ git clone https://github.com/yiren-jian/MetaPix
$ cd MetaPix
- Install this repository and the dependencies using pip:
$ pip install -e <root_dir>
- Optional. To uninstall this package, run:
$ pip uninstall MetaPix
$ cd <root_dir>/meta_domain_transfer/model
$ python fcn8s_v2.py
This will create a directory pretrained_models
with/and a FCN model pretrained on ImageNet.
To train MetaPixelWeight:
$ cd <root_dir>/meta_domain_transfer/scripts
$ python train.py --cfg ./configs/direct_joint.yml
$ cd <root_dir>/meta_domain_transfer/scripts
$ python train.py --cfg ./configs/train_W_with_FCN.yml
$ cd <root_dir>/meta_domain_transfer/scripts
$ python train.py --cfg ./configs/train_FCN_with_W.yml
To test MetaPixelWeight:
$ cd <root_dir>/meta_domain_transfer/scripts
$ python test.py --cfg ./configs/train_FCN_with_W.yml
$ cd <root_dir>/meta_domain_transfer/scripts
$ python train.py --cfg ./configs/direct_joint.yml
$ python test.py --cfg ./configs/direct_joint.yml
$ cd <root_dir>/meta_domain_transfer/scripts
$ python train.py --cfg ./configs/target_only.yml
$ python test.py --cfg ./configs/target_only.yml
This codebase is heavily borrowed from ADVENT.