English | 简体中文
This repo provides DeOldify model for image/video colorization using mmcv and mmediting. About more details of DeOldify, please refer to https://github.com/jantic/DeOldify
- Modular design: We decompose the deoldify framework into different components and one can easily construct a customized editor framework by combining different modules.
Orignal Image | Stable Colorization Image | Artistic Colorization Image |
---|---|---|
Please refer to https://github.com/open-mmlab/mmediting/blob/master/docs/install.md for installation.
All code in this repository is under the MIT license.
These weights are from https://github.com/jantic/DeOldify
The weight keys will be automatically transformed in this file. You should only put these three weight files in ./checkpoints
This script performs inference on a single image.
python demo/image_demo.py \
${IMAGE_FILE} \
${CONFIG_FILE} \
${CHECKPOINT_FILE} \
[--device ${GPU_ID}] \
[--out ${OUT}] \
[--show ${SHOW}]
Examples:
- If you want to use stable mode:
python demo/image_demo.py \
work_dirs/stable/source/1.jpg \
configs/deoldify_stable_configs.py \
checkpoints/ColorizeStable_gen.pth \
--out work_dirs/stable/result/1.png \
--show
The predicted stable colorization result will be save in work_dirs/stable/result/1.png
.
- If you want to use artistic mode:
python demo/image_demo.py \
work_dirs/artistic/source/1.jpg \
configs/deoldify_artistic_configs.py \
checkpoints/ColorizeArtistic_gen.pth \
--out work_dirs/artistic/result/1.png \
--show
The predicted artistic colorization result will be save in work_dirs/artistic/result/1.png
.
This script performs inference on a single video.
python demo/image_demo.py \
${IMAGE_FILE} \
${CONFIG_FILE} \
${CHECKPOINT_FILE} \
[--device ${GPU_ID}] \
[--out ${OUT}] \
[--show ${SHOW}]
Examples:
- You can only use video mode:
python demo/video_demo.py \
work_dirs/video/source/test.mp4 \
configs/deoldify_video_configs.py \
checkpoints/ColorizeVideo_gen.pth \
--out work_dirs/video/result/test.mp4 \
--show
The predicted video colorization result will be saved in work_dirs/video/result/test.mp4
.
If you find this project useful in your research, please consider cite:
@misc{DeOldify-OpenMMLab,
title={DeOldify Implement using OpenMMLab},
author={DeOldify-OpenMMLab Contributors},
howpublished = {\url{https://github.com/soonera/DeOldify-OpenMMLab}},
year={2021}
}