Giter Club home page Giter Club logo

colorformer's Introduction

ColorFormer: Image Colorization via Color Memory assisted Hybrid-attention Transformer

This is the implementation of ``ColorFormer: Image Colorization via Color Memory assisted Hybrid-attention Transformer'' (ECCV22)

Xiaozhong Ji, Boyuan Jiang, Donghao Luo, Guangpin Tao, Wenqing Chu, Zhifeng Xie, Chengjie Wang, Ying Tai

framework

This repository is heavily based on BasicSR.

Requirements

  • pytorch==1.9.0
  • torchvision
  • scikit-image
  • einops
  • timm

Please run this to install basicsr.

python3 setup.py develop

Inference

  1. Download pretrained weights pretrain from google drive and put the folder under './'
  2. Run
python3 inference/inference_colorformer.py --input /path/to/input --output /path/to/output --model_path pretrain/net_g_200000.pth

Train

  1. Download imagenet training set from https://www.image-net.org/, then list all the image paths in a txt file.
  2. Specify 'meta_info_file' in options/train/ECCV22/train_colorformer.yml
  3. To collect semantic and color priors, run
python3 memory_build/inference_GLH.py --input_txt image_paths.txt
python3 memory_build/semantic_color_clustering.py -m 512 -k 64
  1. For multi-gpu training, run
sh scripts/train.sh

We thank the authors of BasicSR as we train colorformer based on 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.

colorformer's People

Stargazers

Jordan avatar Eduardo Herrera Alba avatar xia-zx avatar  avatar yuexy avatar  avatar Tong Shaojun avatar  avatar Hangyan Zhu avatar githubuser avatar  avatar wenwen avatar  avatar Shika Sensei avatar Nick Pai avatar Dong Yi avatar 陶光品 avatar sudo avatar  avatar Nukaliad avatar Piddnad avatar

Watchers

 avatar  avatar

colorformer's Issues

Doubts about performance

Thanks for the shared code.
When we use the training code you provided, the final performance is quite different from the value of the paper. Meanwhile, we tested the checkpoints you provided, but they can't achieve the performance of the paper. Do you have any tricks when training the model? Looking forward to your reply.

how to obtain pretrained weights for encoder

Hi, thank you for your great work.

I have a question when I run the code. At the beginning of the training, encoder needs to load a pretrained weight (pretrain/GLH.pth).

I wonder how this pretrained weight is obtained. Was the encoder model first trained on imagenet for classification?

Thank you in advance for answering my question.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.