https://github.com/mandyschen/bwtocolorized
Automatic image colorization for scenery.
https://github.com/mandyschen/bwtocolorized
computer-vision tensorflow
Last synced: 7 months ago
JSON representation
Automatic image colorization for scenery.
- Host: GitHub
- URL: https://github.com/mandyschen/bwtocolorized
- Owner: mandyschen
- License: mit
- Created: 2024-11-07T15:57:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-10T19:08:34.000Z (over 1 year ago)
- Last Synced: 2025-04-26T00:27:26.440Z (about 1 year ago)
- Topics: computer-vision, tensorflow
- Language: Python
- Homepage:
- Size: 3.18 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Black and White to Colorized Image Conversion
This project implements an image colorization model inspired by the paper *Colorful Image Colorization* by Zhang et al., using TensorFlow.
---
## Model Overview
Like Zhang et al., we treat colorization as a classification problem, predicting discrete color classes instead of directly estimating color values per pixel. We preprocess images from RGB to LAB color space, which has a single grayscale lightness channel (L) and two color channels (A and B). We also quantize the whole AB space into 40 discrete color bins, allowing us to treat the task as a classification problem. For training, each pixel's color values are mapped to the nearest of these 40 "classes" and encoded as a one-hot vector. Our model is then trained using the below architecture and categorical cross-entropy loss to predict color classes for inputted grayscale images.
---
## Results
Examples of colorized images generated by the model:

---
## Model
Our Model Architecture:

---
## References
*Zhang, R., Isola, P., & Efros, A. A. (2016). Colorful Image Colorization.*
[Paper Link](https://arxiv.org/abs/1603.08511)
---
## Instructions for Use
1. Upload the files that you would like to train the model on.
2. Choose the amount of files to be trained.
3. Choose which images you would like modified.
4. Run the Jupyter Notebook provided.