← 开源
piddnad

DDColor

[ICCV 2023] DDColor: Towards Photo-Realistic Image Colorization via Dual Decoders

ModelsVision modelsPython
在 GitHub 打开
增长势头
+124 小时新增 Star+0.1%
1.51k
Star
169
Fork
+2
本周
6
贡献者
创建于 2022-12-23 · 更新于 2026-10-16 · 今日第 5501 名
主要开发者
piddnadSkwarson96chenxwh

piddnad/DDColor 排名第 5,501,有 1,507 个星标。

同类别比较

piddnad/DDColor 排名第 5,501,此处有 8 个同类条目;SkyworkAI/Skywork 排名第 5,507。

同类别比较
名称排名指标
evo-design/evo5,455
语言:
Python
星标数:
1,579
分叉数:
189
简介:
Biological foundation modeling from molecular to genome scale
QwenAudio/Fun-ASR5,458
语言:
C
星标数:
1,576
分叉数:
156
简介:
Fun-ASR speech recognition models, with native Hugging Face Transformers support for Fun-ASR-Nano and separate FunASR, vLLM and llama.cpp deployment paths.
NVlabs/Fast-FoundationStereo5,483
语言:
Python
星标数:
1,535
分叉数:
161
简介:
[CVPR 2026] Fast-FoundationStereo: Real-Time Zero-Shot Stereo Matching
WenmuZhou/PytorchOCR5,489
语言:
Python
星标数:
1,528
分叉数:
317
简介:
基于Pytorch的OCR工具库,支持常用的文字检测和识别算法
SkyworkAI/Skywork5,507
语言:
Python
星标数:
1,498
分叉数:
148
简介:
Skywork series models are pre-trained on 3.2TB of high-quality multilingual (mainly Chinese and English) and code data. We have open-sourced the model, training data, evaluation data, evaluation methods, etc.
NJU-PCALab/STAR5,509
语言:
Python
星标数:
1,497
分叉数:
87
简介:
[ICCV 2025] STAR: Spatial-Temporal Augmentation with Text-to-Video Models for Real-World Video Super-Resolution
nyrahealth/CrisperWhisper5,539
语言:
Python
星标数:
1,450
分叉数:
94
简介:
Controllable Transcription. Verbatim ( every, filler, pause, stutter, vocal sound) , or intended ( what the speaker meant to say, optimized for readability) with word-level timestamps.
MiuLab/Taiwan-LLM5,550
语言:
Python
星标数:
1,427
分叉数:
121
简介:
Traditional Mandarin LLMs for Taiwan
关键参数与规格
关键参数与规格
参数值
语言Python
类别Models
子类别Vision models
关键词Image production
星标数1,507
分叉数169
贡献者6
创建日期2022-12-23
更新日期2026-10-16
1 天星标数1
7 天星标数2
排名5,501
上次排名3,994
排名变化-1,507
7 天星标排名8,033
上次 7 天星标排名9,853
7 天星标排名变化1,820
总星标排名8,065
上次总星标排名8,062
总星标排名变化-3
国家France
README 摘录

🎨 DDColor Official PyTorch implementation of ICCV 2023 Paper "DDColor: Towards Photo-Realistic Image Colorization via Dual Decoders". Xiaoyang Kang, Tao Yang, Wenqi Ouyang, Peiran Ren, Lingzhi Li, Xuansong Xie *DAMO Academy, Alibaba Group* 🪄 DDColor can provide vivid and natural colorization for historical black and white old photos. 🎲 It can even colorize/recolor landscapes from anime games, transforming your animated scenery into a realistic real-life style! (Image source: Genshin Impact) News [2024-01-28] Support inference via 🤗 Hugging Face! Thanks

@Niels for the suggestion and example code and @Skwara for fixing bug. [2024-01-18] Add Replicate demo and API! [2023-12-13] Release the DDColor-tiny pre-trained model! [2023-09-07] Add the Model Zoo and release three pretrained models! [2023-05-15] Code release for training and inference! [2023-05-05] The online demo is available! Online Demo Try our online demos at ModelScope and Replicate. Methods *In short:* DDColor uses multi-scale visual features to optimize

**learnable color tokens** (i. color queries) and achieves state-of-the-art performance on automatic image colorization. 7 Installation with conda (recommended) Quick Start Inference Using Local Script (No Required) 1. Run inference with or Inference Using Hugging Face Load the model via Hugging Face Hub: Or directly perform model inference by running: Inference Using ModelScope 1. Run inference: This code will automatically download the model (see ModelZoo) and performs inference. The model file can be found in the local

path . Gradio Demo Install the gradio and other required libraries: Then, you can run the demo with the following command: Model Zoo We provide several different versions of pretrained models, please check out Model Zoo. Dataset Preparation: Download the ImageNet dataset or create a custom dataset. Use this script to obtain the dataset list file: 2. Download the pretrained weights for ConvNeXt and InceptionV3 and place them in the folder. Specify 'meta_info_file' and other options in . Start training

: ONNX export Support for ONNX model exports is available. Usage example: Demo of ONNX export using a model is available here. Citation If our work is helpful for your research, please consider citing: Acknowledgments We thank the authors of BasicSR for the awesome training pipeline. BasicSR: Open Source Image and Video Restoration Toolbox. Some codes are adapted from ColorFormer, BigColor, ConvNeXt, Mask2Former, and DETR.

常见问题

记录了多少星标和分叉?

piddnad/DDColor 有 1,507 个星标和 169 个分叉。

仓库排名是多少?

piddnad/DDColor 排名第 5,501。

记录的语言和类别是什么?

piddnad/DDColor 有 1,507 个星标,语言为 Python,类别为 Models。

哪个仓库排名最接近?

piddnad/DDColor 与 SkyworkAI/Skywork 比较,后者排名第 5,507,有 1,498 个星标。

README

🎨 DDColor

Official PyTorch implementation of ICCV 2023 Paper "DDColor: Towards Photo-Realistic Image Colorization via Dual Decoders".

Xiaoyang Kang, Tao Yang, Wenqi Ouyang, Peiran Ren, Lingzhi Li, Xuansong Xie
DAMO Academy, Alibaba Group

🪄 DDColor can provide vivid and natural colorization for historical black and white old photos.

🎲 It can even colorize/recolor landscapes from anime games, transforming your animated scenery into a realistic real-life style! (Image source: Genshin Impact)

News

  • [2024-01-28] Support inference via 🤗 Hugging Face! Thanks @Niels for the suggestion and example code and @Skwara for fixing bug.
  • [2024-01-18] Add Replicate demo and API! Thanks @Chenxi.
  • [2023-12-13] Release the DDColor-tiny pre-trained model!
  • [2023-09-07] Add the Model Zoo and release three pretrained models!
  • [2023-05-15] Code release for training and inference!
  • [2023-05-05] The online demo is available!

Online Demo

Try our online demos at ModelScope and Replicate.

Methods

In short: DDColor uses multi-scale visual features to optimize learnable color tokens (i.e. color queries) and achieves state-of-the-art performance on automatic image colorization.

Installation

Requirements

  • Python >= 3.7
  • PyTorch >= 1.7

Installation with conda (recommended)

conda create -n ddcolor python=3.9
conda activate ddcolor
pip install torch==2.2.0 torchvision==0.17.0 --index-url https://download.pytorch.org/whl/cu118

pip install -r requirements.txt

# For training, install the following additional dependencies and basicsr
pip install -r requirements.train.txt
python3 setup.py develop

Quick Start

Inference Using Local Script (No basicsr Required)

  1. Download the pretrained model:
from modelscope.hub.snapshot_download import snapshot_download

model_dir = snapshot_download('damo/cv_ddcolor_image-colorization', cache_dir='./modelscope')
print('model assets saved to %s' % model_dir)
  1. Run inference with
python scripts/infer.py --model_path ./modelscope/damo/cv_ddcolor_image-colorization/pytorch_model.pt --input ./assets/test_images

or

sh scripts/inference.sh

Inference Using Hugging Face

Load the model via Hugging Face Hub:

from huggingface_hub import PyTorchModelHubMixin
from ddcolor import DDColor

class DDColorHF(DDColor, PyTorchModelHubMixin):
    def __init__(self, config=None, **kwargs):
        if isinstance(config, dict):
            kwargs = {**config, **kwargs}
        super().__init__(**kwargs)

ddcolor_paper_tiny = DDColorHF.from_pretrained("piddnad/ddcolor_paper_tiny")
ddcolor_paper      = DDColorHF.from_pretrained("piddnad/ddcolor_paper")
ddcolor_modelscope = DDColorHF.from_pretrained("piddnad/ddcolor_modelscope")
ddcolor_artistic   = DDColorHF.from_pretrained("piddnad/ddcolor_artistic")

Or directly perform model inference by running:

python scripts/infer.py --model_name ddcolor_modelscope --input ./assets/test_images
# model_name: [ddcolor_paper | ddcolor_modelscope | ddcolor_artistic | ddcolor_paper_tiny]

Inference Using ModelScope

  1. Install modelscope:
pip install modelscope
  1. Run inference:
import cv2
from modelscope.outputs import OutputKeys
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

img_colorization = pipeline(Tasks.image_colorization, model='damo/cv_ddcolor_image-colorization')
result = img_colorization('https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/audrey_hepburn.jpg')
cv2.imwrite('result.png', result[OutputKeys.OUTPUT_IMG])

This code will automatically download the ddcolor_modelscope model (see ModelZoo) and performs inference. The model file pytorch_model.pt can be found in the local path ~/.cache/modelscope/hub/damo.

Gradio Demo

Install the gradio and other required libraries:

pip install gradio gradio_imageslider

Then, you can run the demo with the following command:

python demo/gradio_app.py

Model Zoo

We provide several different versions of pretrained models, please check out Model Zoo.

Train

  1. Dataset Preparation: Download the ImageNet dataset or create a custom dataset. Use this script to obtain the dataset list file:
python scripts/get_meta_file.py
  1. Download the pretrained weights for ConvNeXt and InceptionV3 and place them in the pretrain folder.

  2. Specify 'meta_info_file' and other options in options/train/train_ddcolor.yml.

  3. Start training:

sh scripts/train.sh

ONNX export

Support for ONNX model exports is available.

  1. Install dependencies:
pip install onnx==1.16.1 onnxruntime==1.19.2 onnxsim==0.4.36
  1. Usage example:
python scripts/export_onnx.py --model_path pretrain/ddcolor_paper_tiny.pth --export_path weights/ddcolor-tiny.onnx

Demo of ONNX export using a ddcolor_paper_tiny model is available here.

Citation

If our work is helpful for your research, please consider citing:

@inproceedings{kang2023ddcolor,
  title={DDColor: Towards Photo-Realistic Image Colorization via Dual Decoders},
  author={Kang, Xiaoyang and Yang, Tao and Ouyang, Wenqi and Ren, Peiran and Li, Lingzhi and Xie, Xuansong},
  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
  pages={328--338},
  year={2023}
}

Acknowledgments

We thank the authors of BasicSR for the awesome training pipeline.

Xintao Wang, Ke Yu, Kelvin C.K. Chan, Chao Dong and Chen Change Loy. BasicSR: Open Source Image and Video Restoration Toolbox. https://github.com/xinntao/BasicSR, 2020.

Some codes are adapted from ColorFormer, BigColor, ConvNeXt, Mask2Former, and DETR. Thanks for their excellent work!

排名相邻
同类项目