Giter Club home page Giter Club logo

recolor's Introduction

Recolor

Retouch old black and white imges whith Recolor!

TODO

  • Better image quality

Installation and Usage

This project uses pipenv for dependency management. You need to ensure that you have pipenv installed.

Here are the commands to facilitate using this project.

Clone the repo

git clone https://github.com/Rohith04MVK/Recolor
cd Recolor

Install dependencies and Open the shell

# Install dependencies
pipenv sync -d

# Open the venv shell
pipenv shell

Train the model

python3 main.py --train-type general \
  --save-path /kaggle/working/output \
  --pretrain y \
  --epochs 25 \
  --use-gpu y

Inference

python infer.py --model-path path/to/model \
  --input-img path/to/input/image \
  --output path/to/save/output/image \

Requirements

You will need the following to run the above:

  • Torch 1.9.1
  • Python 2.8.5, Pillow 8.2.0, numpy 1.20.3, fastai 2.4
  • If you want to train (and don't want to wait for 4 months):
    • A decent GPU
    • All the required NVIDIA software to run Torch on a GPU (cuda, etc)

Tested on:

Spec
Operating System Ubuntu 20.04.3
GPU NVIDIA Tesla P100 PCIe 16GB
CUDA Version 11.0
Driver Version 450.119

Documentation

main.py

main.py trains networks that can transform black and white images into color images.

Flags

  • --train-type: What type of model to train, we support a face recolor model and a general recolor model. Required
  • --save-path: Path to save the models too. Required
  • --pretrain: If to pre-train the gan, gives better results. Required
  • --epochs: Number of times to train the model for. Required
  • --use-gpu: If to use a GPU to train the model. Required

infer.py

Flags

  • --checkpoint-dir: Path to the trained model. Required
  • --input-path: Path to image to recolor. Required
  • --output: Path to save the generated image to. Required

Attributions/Thanks

recolor's People

Contributors

janasunrise avatar rohith04mvk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.