Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jafagervik/ganban
Pattern Recognition Group 9 Project
https://github.com/jafagervik/ganban
Last synced: 26 days ago
JSON representation
Pattern Recognition Group 9 Project
- Host: GitHub
- URL: https://github.com/jafagervik/ganban
- Owner: Jafagervik
- License: mit
- Created: 2023-05-26T01:46:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-16T22:54:53.000Z (over 1 year ago)
- Last Synced: 2024-10-30T01:53:58.640Z (2 months ago)
- Language: Python
- Size: 446 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# GANBan
[![.github/workflows/ci.yml](https://github.com/github/gh-actions-importer/actions/workflows/ci.yml/badge.svg)](https://github.com/github/gh-actions-importer/actions/workflows/ci.yml)
Correcting and coloring old and damaged images using a CycleGAN
| ![image](examples/portrait0_in.png) | ![image](examples/portrait1_in.png) | ![image](examples/portrait2_in.png) | ![image](examples/portrait3_in.png) |
| --- | --- | --- | --- |
| ![image](examples/portrait0_out.png) | ![image](examples/portrait1_out.png) | ![image](examples/portrait2_out.png) | ![image](examples/portrait3_out.png) |## Converting Images
```sh
python convert.py input_file
```This will fix a damaged image and and will colorize grayscale images.
This requires the weights `ganban.pth` to be in the same directory. This can be downloaded from [here](https://0x0.st/Hj3_.zip).
Additional arguments are as follows:
```
usage: convert.py [-h] [-i] [-m] [-r] input_file [input_file ...]Converts an old damaged image into a new colored image. Outputs a file(s) with the name input_file..png
positional arguments:
input_file input file(s)options:
-h, --help show this help message and exit
-i, --intermediate Output (save) the intermediate states
-m, --multi-domain Use the multiple domain/model approach (damaged<>fixed<>color)
-r, --reverse Reverses the process (corrected image --> old image)
```## Dataset
You can download the dataset used [here](https://0x0.st/Hj39.zip). It contains ~900 unique images trained on for 3 different models.
## Structure
### data
Dataset location and directory to save models in.
### config.py
Contains the hyperparameters.
### cyclegan.py
Contains the generator, discriminator, and initialization weights.
### datasetup.py
Contains the class (Dataset) that interacts with the data
### engine.py
Setup for the train and test steps
### train.py
Entry point to begin training the model. To start, execute `python train.py`.