Skip to content

This repo provides DeOldify model for image colorization using OpenMMLab.

License

Notifications You must be signed in to change notification settings

soonera/DeOldify-OpenMMLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeOldifyPredictor

Introduction

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

Major features of this repo

  • Modular design: We decompose the deoldify framework into different components and one can easily construct a customized editor framework by combining different modules.

Examples

Orignal Image Stable Colorization Image Artistic Colorization Image
Artistic

Installation

Please refer to https://github.com/open-mmlab/mmediting/blob/master/docs/install.md for installation.

License

All code in this repository is under the MIT license.

Get Started

Completed Generator Weights

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

Image demo

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.

Video demo

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.

Citation

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}
}

About

This repo provides DeOldify model for image colorization using OpenMMLab.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages