Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rapidrabbit76/PaintsTensorFlow
line drawing colorization using TensorFlow
https://github.com/rapidrabbit76/PaintsTensorFlow
colorization gans machine-learning paintschainer tensorflow waifu2x
Last synced: about 8 hours ago
JSON representation
line drawing colorization using TensorFlow
- Host: GitHub
- URL: https://github.com/rapidrabbit76/PaintsTensorFlow
- Owner: rapidrabbit76
- License: mit
- Created: 2018-12-18T17:04:17.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2022-04-02T11:53:40.000Z (almost 3 years ago)
- Last Synced: 2025-01-03T18:43:24.757Z (14 days ago)
- Topics: colorization, gans, machine-learning, paintschainer, tensorflow, waifu2x
- Language: Jupyter Notebook
- Homepage:
- Size: 16.6 MB
- Stars: 52
- Watchers: 5
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# PaintsTensorFlow
# Model Structure
Model Structure
## DraftModel
## Colorization
# Results
### input(line) - input(hint) - draft - output - ground truth
Gray background in hint for visualization.
More result image
# GUI
Current we does not provide a GUI.
instead, we are preparing a web service.
if you want to use it locally using the GUI, refer to tag:[0.0.1](https://github.com/rapidrabbit76/PaintsTensorFlow/tree/0.0.1)
GUI
File - open( select Image )
Click "Liner" to create line art
Click "RUN" to automatically color
Click "Color" to select a color and then draw a color hint
Click "RUN" to automatically color
# Requirements
- tensorflow==2.7.1
- tensorflow-addons==0.16.1
- albumentations==1.1.0
- opencv-python-headless==4.5.5.62
- scipy==1.8.0
- tqdm==4.61.2
- wandb==0.12.11# Pretrained Model
- draft saved_model [link](https://drive.google.com/drive/folders/1yKZ9gbVRznWP7ETowIqMbpZpveBh7Mhn?usp=sharing)
- colorization saved_model [link](https://drive.google.com/drive/folders/1yKZ9gbVRznWP7ETowIqMbpZpveBh7Mhn?usp=sharing)
- draft model onnx [link](https://drive.google.com/drive/folders/17A7db_zGxZllnlqjxf0_dkqIBeouACJa?usp=sharing)
- colorization model onnx [link](https://drive.google.com/drive/folders/17A7db_zGxZllnlqjxf0_dkqIBeouACJa?usp=sharing)# Training
- My dataset over 700,000 images and created a lines, using [SketchKeras](https://github.com/lllyasviel/sketchKeras)
- dataset path structure (**image-line file name must be matched**)
```
{DATASET PATH}
│
├─ train
│ ├─ image
│ │ └─ 1.jpg, 2.jpg, N.jpg
│ ├─ line
│ │ └─ 1.jpg, 2.jpg, N.jpg
└─ test
├─ image
│ └─ 1.jpg, 2.jpg, N.jpg
└─ line
└─ 1.jpg, 2.jpg, N.jpg
```- [step 1]: Training draft model 128X128 size
```
python3 main.py \
--mode="draft" \
--root_dir={"YOURE DATASET PATH"} \
--batch_size={BATCH_SIZE} \
--epochs={EPOCHS} \
--lr=0.0001
```- [step 2]: Training Colorization model 512X512 size
```
python3 main.py \
--mode="colorization" \
--root_dir={"YOURE DATASET PATH"} \
--batch_size={BATCH_SIZE} \
--epochs={EPOCHS} \
--lr=0.0001
```# Convert to ONNX
- check "[convert2onnx.ipynb](./convert2onnx.ipynb)"
# References
- [PaintsChainer](https://github.com/taizan/PaintsChainer/)
- [SketchKeras](https://github.com/lllyasviel/sketchKeras)
- [pix2pix](https://arxiv.org/pdf/1611.07004.pdf)