Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iver56/image-regression
A DNN that takes in x, y and outputs colors at that point to approximately "paint" an image. A toy problem.
https://github.com/iver56/image-regression
deep-neural-networks dnn image keras python regression
Last synced: 9 days ago
JSON representation
A DNN that takes in x, y and outputs colors at that point to approximately "paint" an image. A toy problem.
- Host: GitHub
- URL: https://github.com/iver56/image-regression
- Owner: iver56
- Created: 2017-02-17T19:04:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-07-21T13:54:34.000Z (over 2 years ago)
- Last Synced: 2024-10-11T20:43:22.766Z (25 days ago)
- Topics: deep-neural-networks, dnn, image, keras, python, regression
- Language: Python
- Homepage:
- Size: 1.58 MB
- Stars: 47
- Watchers: 5
- Forks: 14
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image regression
A toy application that learns a mapping from (x, y) coordinates to color. Uses pytorch and pytorch-lightning.
## Setup
Set up your python environment with conda like this:
`conda env create`
## Usage
### Train on a single greyscale image
`python train.py -i keyboard.png --num-epochs 150`
### Train on a single color image (RGBA)
TODO
### Train on multiple images
`python train.py -i boxy_stripes2.png boxy_stripes2_30.png boxy_stripes2_60.png boxy_stripes2_90.png`
### Train on multiple color images (RGBA)
TODO
### Interpolate between the images:
`python interpolate_between_many.py --width 64 --height 64 --num-images 4 --model boxy_stripes2_boxy_stripes2_30_boxy_stripes2_60_bo_2f59b848.onnx --use-cuda 0`
## Examples
| Name | Original | Learned image |
| ---- | -------- | ------------- |
| Keyboard | ![Original image](input_images/keyboard.png) | ![Learned image](demo/keyboard-learned.gif) |
| 8x8 Checkerboard | ![Original image](input_images/chess.png) | ![Learned image](demo/chess-learned.gif) |The following animation visualizes the output of a neural network that was trained on 12 different images (different rotations of boxy stripes). The input vectors are constructed to interpolate between the 12 images, so we get a kind of morphing effect.
![Boxy stripes](demo/boxy_stripes_interpolation.gif)