You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+91-34Lines changed: 91 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,50 +1,26 @@
1
1
## Super Resolution Examples
2
2
3
+
🔥🔥🔥🔥🔥🔥**Now, we update this script under [TensorLayerX](https://github.com/tensorlayer/TensorLayerX)! For earlier version, please check [srgan release](https://github.com/tensorlayer/srgan/releases) and [tensorlayer](https://github.com/tensorlayer/TensorLayer).**
3
4
4
5
5
-
6
-
We run this script under [TensorFlow](https://www.tensorflow.org) 2.0 and the [**TensorLayer2.0+**](https://github.com/tensorlayer/tensorlayer). For TensorLayer 1.4 version, please check [release](https://github.com/tensorlayer/srgan/releases).
7
-
8
-
<!---
9
-
⚠️ This repo will be merged into example folder of [tensorlayer](https://github.com/zsdonghao/tensorlayer) soon.
10
-
-->
11
-
🚀🚀🚀🚀🚀🚀 **THIS PROJECT WILL BE CLOSED AND MOVED TO [THIS FOLDER](https://github.com/tensorlayer/tensorlayer/tree/master/examples) IN A MONTH.**
12
-
13
-
🚀🚀🚀🚀🚀🚀 **THIS PROJECT WILL BE CLOSED AND MOVED TO [THIS FOLDER](https://github.com/tensorlayer/tensorlayer/tree/master/examples) IN A MONTH.**
14
-
15
-
🚀🚀🚀🚀🚀🚀 **THIS PROJECT WILL BE CLOSED AND MOVED TO [THIS FOLDER](https://github.com/tensorlayer/tensorlayer/tree/master/examples) IN A MONTH.**
16
-
17
-
<!--More cool Computer Vision applications such as pose estimation and style transfer can be found in this [organization](https://github.com/tensorlayer).**
18
-
-->
19
-
20
6
### SRGAN Architecture
21
7
22
-
TensorFlow Implementation of ["Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network"](https://arxiv.org/abs/1609.04802)
8
+
TensorLayerX Implementation of ["Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network"](https://arxiv.org/abs/1609.04802)
-1. You need to download the pretrained VGG19 model in [here](https://github.com/tensorlayer/pretrained-models/tree/master/models) as [tutorial_models_vgg19.py](https://github.com/tensorlayer/tensorlayer/blob/master/examples/pretrained_cnn/tutorial_models_vgg19.py) show.
23
+
-1. You need to download the pretrained VGG19 model weights in [here](https://github.com/tensorlayer/pretrained-models/tree/master/models).
48
24
-2. You need to have the high resolution images for training.
49
25
- In this experiment, I used images from [DIV2K - bicubic downscaling x4 competition](http://www.vision.ee.ethz.ch/ntire17/), so the hyper-paremeters in `config.py` (like number of epochs) are seleted basic on that dataset, if you change a larger dataset you can reduce the number of epochs.
50
26
- If you dont want to use DIV2K dataset, you can also use [Yahoo MirFlickr25k](http://press.liacs.nl/mirflickr/mirdownload.html), just simply download it using `train_hr_imgs = tl.files.load_flickr25k_dataset(tag=None)` in `main.py`.
@@ -53,34 +29,106 @@ TensorFlow Implementation of ["Photo-Realistic Single Image Super-Resolution Usi
53
29
54
30
55
31
### Run
32
+
33
+
#### Train
56
34
- Set your image folder in `config.py`, if you download [DIV2K - bicubic downscaling x4 competition](http://www.vision.ee.ethz.ch/ntire17/) dataset, you don't need to change it.
57
35
- Other links for DIV2K, in case you can't find it : [test\_LR\_bicubic_X4](https://data.vision.ee.ethz.ch/cvl/DIV2K/validation_release/DIV2K_test_LR_bicubic_X4.zip), [train_HR](https://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_train_HR.zip), [train\_LR\_bicubic_X4](https://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_train_LR_bicubic_X4.zip), [valid_HR](https://data.vision.ee.ethz.ch/cvl/DIV2K/validation_release/DIV2K_valid_HR.zip), [valid\_LR\_bicubic_X4](https://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_valid_LR_bicubic_X4.zip).
58
36
59
37
```python
60
38
config.TRAIN.img_path ="your_image_folder/"
61
39
```
40
+
Your directory structure should look like this:
41
+
42
+
```
43
+
srgan/
44
+
└── config.py
45
+
└── srgan.py
46
+
└── train.py
47
+
└── vgg.py
48
+
└── model
49
+
└── vgg19.npy
50
+
└── DIV2K
51
+
└── DIV2K_train_HR
52
+
├── DIV2K_train_LR_bicubic
53
+
├── DIV2K_valid_HR
54
+
└── DIV2K_valid_LR_bicubic
55
+
56
+
```
62
57
63
58
- Start training.
64
59
65
60
```bash
66
61
python train.py
67
62
```
68
63
69
-
- Start evaluation.
64
+
🔥Just modify a line of code in **train.py**, easily change to any framework!
0 commit comments