- Team member
- Our report: Report team 2
- Web demo with Flask:
- Download source code Web-app and run
app.py
- Download source code Web-app and run
Original paper: Photo-Realistic Single Image Super- Resolution Using a Generative Adversarial Network.
Figure 1: SRGAN architecture
- We use
DIV2K
dataset for training the model, you can download here. - Then doing random crop the image with size
96x96
for HR image and resize to24x24
for LR image. - After cropping, we scale HR and LR images to range
[-1, 1]
.
- You can download
Set5
,Set14
, andUrban100
datasets here.
Change the choice
variable in train_test_model.py
to run the model
1: Train model
2: Validate model
3: Test model
4: Test on video
- 📁 Set the train data path
hr_train_path = Dataset/DIV2K
and the LR image sizelr_size = (24, 24)
, then the HR image size equals LR image size times 4hr_size = (96, 96)
. - You can use other dataset with different LR image size for training by set up:
hr_train_path = 'Dataset/your_images_folder'
lr_size = your_size
- 📁 Set your weight path to save weights in every epoch with HR and LR image size. Your directory will be
weight/(LR_size)_(HR_size)
save_path = 'weight'
You should set the HR and LR valid image paths for comparing the SR image with HR and LR images
hr_valid_path = 'Dataset/your_HR_image'
lr_valid_path = 'Dataset/your_LR_image'
weight_path = 'weight/e_77.h5' # You can change the path
Set the LR test image paths for comparing the SR image with HR and LR images
lr_test_path = 'Your_image'
weight_path = 'weight/e_77.h5' # You can change the path
NOTE:
Make sure the height and width are under 500 pixels because of running out of memory on GPU
Figure 2: Set14 and Set5 dataset
Figure 3: Urban dataset