Skip to content

Commit 878801c

Browse files
authored
Separate the samples and assets and update the README (#10)
* Separate the samples and assets and update the README * correct sentence in samples README * small changes to the READMEs * Add JPEG and TIFF test cases * rewrite the tiff and jpeg test case * fix test
1 parent 1d5a861 commit 878801c

25 files changed

+58
-41
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[![Build Status](https://travis-ci.com/IBM/MAX-Image-Resolution-Enhancer.svg?branch=master)](https://travis-ci.com/IBM/MAX-Image-Resolution-Enhancer) [![API demo](https://img.shields.io/website/http/max-image-resolution-enhancer.max.us-south.containers.appdomain.cloud/swagger.json.svg?label=API%20demo&down_message=down&up_message=up)](http://max-image-resolution-enhancer.max.us-south.containers.appdomain.cloud/)
22

3+
[<img src="docs/deploy-max-to-ibm-cloud-with-kubernetes-button.png" width="400px">](http://ibm.biz/max-to-ibm-cloud-tutorial)
4+
35
# IBM Developer Model Asset Exchange: Image Resolution Enhancer
46

57
This repository contains code to instantiate and deploy an image resolution enhancer.
@@ -10,7 +12,7 @@ The GAN is based on [this GitHub repository](https://github.com/brade31919/SRGAN
1012
The model was trained on 600,000 images of the [OpenImages V4](https://storage.googleapis.com/openimages/web/index.html) dataset, and the model files are hosted on
1113
[IBM Cloud Object Storage](http://max-assets.s3.us.cloud-object-storage.appdomain.cloud/max-image-resolution-enhancer/1.0/assets.tar.gz).
1214
The code in this repository deploys the model as a web service in a Docker container. This repository was developed
13-
as part of the [IBM Developer Model Asset Exchange](https://developer.ibm.com/exchanges/models/).
15+
as part of the [IBM Developer Model Asset Exchange](https://developer.ibm.com/exchanges/models/) and the public API is powered by [IBM Cloud](https://ibm.biz/Bdz2XM).
1416

1517
## Model Metadata
1618
| Domain | Application | Industry | Framework | Training Data | Input Data Format |
@@ -55,8 +57,8 @@ _NOTE: The SRGAN in the paper was trained on 350k ImageNet samples, whereas this
5557
| This repository | [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) | [LICENSE](https://github.com/IBM/max-image-resolution-enhancer/blob/master/LICENSE) |
5658
| Model Weights | [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) | [LICENSE](https://github.com/IBM/max-image-resolution-enhancer/blob/master/LICENSE) |
5759
| Model Code (3rd party) | [MIT](https://opensource.org/licenses/MIT) | [LICENSE](https://github.com/brade31919/SRGAN-tensorflow/blob/master/LICENSE.txt) |
58-
| Test assets | [CC BY 2.0](https://creativecommons.org/licenses/by/2.0/) | [Asset README](assets/README.md) |
59-
| | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | [Asset README](assets/README.md) |
60+
| Test samples | [CC BY 2.0](https://creativecommons.org/licenses/by/2.0/) | [Asset README](samples/README.md) |
61+
| | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | [Asset README](samples/README.md) |
6062

6163
## Pre-requisites:
6264

@@ -92,6 +94,8 @@ $ kubectl apply -f https://github.com/IBM/max-image-resolution-enhancer/raw/mast
9294

9395
The model will be available internally at port `5000`, but can also be accessed externally through the `NodePort`.
9496

97+
A more elaborate tutorial on how to deploy this MAX model to production on [IBM Cloud](https://ibm.biz/Bdz2XM) can be found [here](http://ibm.biz/max-to-ibm-cloud-tutorial).
98+
9599
## Run Locally
96100

97101
1. [Build the Model](#1-build-the-model)
@@ -136,7 +140,7 @@ $ docker run -it -p 5000:5000 max-image-resolution-enhancer
136140

137141
The API server automatically generates an interactive Swagger documentation page. Go to `http://localhost:5000` to load it. From there you can explore the API and also create test requests.
138142

139-
Use the `model/predict` endpoint to load a test image (you can use one of the test images from the `assets/test_examples/low_resolution` folder) in order to get a high resolution output image returned.
143+
Use the `model/predict` endpoint to load a test image (you can use one of the test images from the `samples/test_examples/low_resolution` folder) in order to get a high resolution output image returned.
140144

141145
The ideal input image is a PNG file with a resolution between 100x100 and 500x500, preferably without any post-capture processing and flashy colors. The model is able to generate details from a pixelated image (low DPI), but is not able to correct a 'blurred' image.
142146

@@ -148,7 +152,7 @@ _Left: input image (106×159). Right: output image (424×636)_
148152
You can also test it on the command line, for example:
149153

150154
```
151-
$ curl -F "image=@assets/test_examples/low_resolution/woman.png" -XPOST http://localhost:5000/model/predict > woman_high_res.png
155+
$ curl -F "image=@samples/test_examples/low_resolution/woman.png" -XPOST http://localhost:5000/model/predict > woman_high_res.png
152156
```
153157

154158
The above command will send the low resolution `woman.png` file to the model, and save the high resolution output image to the `woman_high_res.png` file in the root directory.

assets/README.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,4 @@
44

55
The final SRGAN model was trained on 600k images from the [OpenImages V4](https://storage.googleapis.com/openimages/web/index.html) dataset. The weights are released here under the [Apache2.0](https://www.apache.org/licenses/LICENSE-2.0) license found in the root of this repository.
66

7-
_Note: the finetuned model files are hosted on [IBM Cloud Object Storage](http://max-assets.s3.us.cloud-object-storage.appdomain.cloud/max-image-resolution-enhancer/1.0/assets.tar.gz)._
8-
9-
## Test Examples (assets/testexamples)
10-
11-
This directory contains to subdirectories:
12-
* low_resolution
13-
* original
14-
15-
The low resolution images can be used as input for the model, and the resulting high resolution images can be compared with the 'original' images to measure performance.
16-
17-
The source of the images is the following:
18-
19-
**[OpenImages V4](https://storage.googleapis.com/openimages/web/index.html)**
20-
21-
_[CC BY 2.0](https://creativecommons.org/licenses/by/2.0/) licensed_
22-
23-
- `monkey_and_man.png`
24-
25-
**[Pexels](https://www.pexels.com/royalty-free-images/)**
26-
27-
_[CC0](https://creativecommons.org/publicdomain/zero/1.0/) licensed_
28-
29-
- `airplane.png`
30-
- `astronaut.png`
31-
- `elephant.png`
32-
- `face.png`
33-
- `face_paint.png`
34-
- `food.png`
35-
- `palm_tree.png`
36-
- `penguin.png`
37-
- `woman.png`
7+
_Note: the fine-tuned model files are hosted on [IBM Cloud Object Storage](http://max-assets.s3.us.cloud-object-storage.appdomain.cloud/max-image-resolution-enhancer/1.0/assets.tar.gz)._
55.4 KB
Loading

samples/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Sample Details
2+
3+
## Test Examples
4+
5+
The `samples/test_examples/` folder contains two subfolders:
6+
* low_resolution
7+
* original
8+
9+
The low resolution images can be used as input for the model, and the resulting high resolution images can be compared with the 'original' images to measure performance.
10+
11+
The sources of the images are the following:
12+
13+
**[OpenImages V4](https://storage.googleapis.com/openimages/web/index.html)**
14+
15+
_[CC BY 2.0](https://creativecommons.org/licenses/by/2.0/) licensed_
16+
17+
- `monkey_and_man.png`
18+
19+
**[Pexels](https://www.pexels.com/royalty-free-images/)**
20+
21+
_[CC0](https://creativecommons.org/publicdomain/zero/1.0/) licensed_
22+
23+
- `airplane.png`
24+
- `astronaut.png`
25+
- `elephant.png`
26+
- `face.png`
27+
- `face_paint.png`
28+
- `food.png`
29+
- `palm_tree.png`
30+
- `penguin.png`
31+
- `woman.png`
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)