Skip to content

Latest commit

 

History

History
90 lines (83 loc) · 3.56 KB

README.md

File metadata and controls

90 lines (83 loc) · 3.56 KB

High-Resolution Daytime Translation Without Domain Labels

Open HiDT in Colab

Official PyTorch implementation (only inference part) for the paper I. Anokhin, P. Solovev, D. Korzhenkov, A. Kharlamov, T. Khakhulin, A. Silvestrov, S. Nikolenko, V. Lempitsky, and G. Sterkin. "High-Resolution Daytime Translation Without Domain Labels." In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). teaser image

Installation

Make sure that you use python >= 3.7. We have tested it with conda package manager. If you are new to conda, proceed to https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html

conda create -n hidt python=3.7
conda activate hidt

Clone the repo

git clone https://github.com/advimman/HiDT.git

Install requirenments

cd HiDT
pip install -r requirements.txt

Inference

Daytime translation, upsampling with Genh

CUDA_VISIBLE_DEVICES=0 PYTHONPATH=$(pwd):${PYTHONPATH} \
python ./bin/infer_on_folders.py \
    --content-dir ./images/daytime/content/ \
    --style-dir ./images/daytime/styles/ \
    --cfg-path ./configs/daytime.yaml \
    --chk-path ./trained_models/generator/daytime.pt \
    --enh-path ./trained_models/enhancer/enhancer.pth \
    --enhancement generator

Daytime translation, generator in fully convolutional mode, no postprocessing

CUDA_VISIBLE_DEVICES=0 PYTHONPATH=$(pwd):${PYTHONPATH} \
python ./bin/infer_on_folders.py \
    --content-dir ./images/daytime/content/ \
    --style-dir ./images/daytime/styles/ \
    --cfg-path ./configs/daytime.yaml \
    --chk-path ./trained_models/generator/daytime.pt \
    --enhancement fullconv

Model, trained on wikiart, upsampling with Genh

CUDA_VISIBLE_DEVICES=0 PYTHONPATH=$(pwd):${PYTHONPATH} \
python ./bin/infer_on_folders.py \
    --content-dir ./images/wikiart/content/ \
    --style-dir ./images/wikiart/styles/ \
    --cfg-path ./configs/wikiart.yaml \
    --chk-path ./trained_models/generator/wikiart.pt \
    --enh-path ./trained_models/enhancer/enhancer.pth \
    --enhancement generator

Model, trained on wikiart, generator in fully convolutional mode, no postprocessing

CUDA_VISIBLE_DEVICES=0 PYTHONPATH=$(pwd):${PYTHONPATH} \
python ./bin/infer_on_folders.py \
    --content-dir ./images/wikiart/content/ \
    --style-dir ./images/wikiart/styles/ \
    --cfg-path ./configs/wikiart.yaml \
    --chk-path ./trained_models/generator/wikiart.pt \
    --enhancement fullconv

Citation

If you found our work useful, please don't forget to cite

@inproceedings{Anokhin_2020_CVPR,
  author = {Anokhin, Ivan and
            Solovev, Pavel and
            Korzhenkov, Denis and
            Kharlamov, Alexey and
            Khakhulin, Taras and
            Silvestrov, Alexey and
            Nikolenko, Sergey and
            Lempitsky, Victor and
            Sterkin, Gleb
  },
  title = {High-Resolution Daytime Translation Without Domain Labels},
  booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  month = {June},
  year = {2020},
}