/SRCNN-2

Primary LanguagePythonMIT LicenseMIT

Super_resolution

Easy model running super resolution based on SRCNN using Keras.

Description

Implementation of SRCNN with RGB using Keras. These programs can load images from the specified directory, resize these images and train the Keras model. Also, trained models can be loaded and can perform upsampling.

Requirements

  • Python 3.0 or more
  • Keras 2.0 or more (Tensorflow backend)
  • Pillow
  • numpy
  • tqdm
  • h5py

Get started

  1. Clone this repository:
git clone https://github.com/kcct-fujimotolab/Super_resolution.git
cd Super_resolution/
  1. Make a directory for data sets:
mkdir images
  1. Collect images (more than thousands better):
ls images/
data0000.jpg   data0001.jpg   ...   data9999.jpg
  1. Start training with specifying image size, number of epochs, data set directory, etc.:
python train.py --input images/ --size 64 64 --epoch 1000
  1. Do super resolution with running sr2x.py:
python sr2x.py
Using TensorFlow backend.
Enter the file name (*.jpg)
>> test/data.jpg

Options

--help -h: show information

train.py

--input -i: data sets path (default -i images/)
--size -z: image size, 2 values required, must be multiples of 2 (default -z 128 128)
--epoch -e: number of epochs (default -e 500)
--batch -b: batch size (default -b 64)

Results

We extracted 4096 images from the face data provided by Labeled Faces in the Wild, and trained 1000 epochs.
A part of the results are shown below.

A
B
C
D

Author

Fujimoto Lab in Kobe City College of Technology
Undergraduate Student of Electronics Department
@yoidea