Skip to content

Commit

Permalink
Namechange Image-Super-Resolution-Generator to Image-Resolution-Enhancer
Browse files Browse the repository at this point in the history
  • Loading branch information
splovyt committed Mar 28, 2019
1 parent 986fb34 commit 5c7ce01
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ python:
services:
- docker
install:
- docker build -t max-image-super-resolution-generator .
- docker run -it -d --rm -p 5000:5000 max-image-super-resolution-generator
- docker build -t max-image-resolution-enhancer .
- docker run -it -d --rm -p 5000:5000 max-image-resolution-enhancer
- pip install pytest requests flake8 Pillow
before_script:
- sleep 30
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM codait/max-base:v1.1.0

ARG model_bucket=http://max-assets.s3.us.cloud-object-storage.appdomain.cloud/max-image-super-resolution-generator/1.0
ARG model_bucket=http://max-assets.s3.us.cloud-object-storage.appdomain.cloud/max-image-resolution-enhancer/1.0
ARG model_file=assets.tar.gz

WORKDIR /workspace
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[![Build Status](https://travis-ci.com/IBM/MAX-Image-Super-Resolution-Generator.svg?branch=master)](https://travis-ci.com/IBM/MAX-Image-Super-Resolution-Generator)
[![Build Status](https://travis-ci.com/IBM/MAX-Image-Resolution-Enhancer.svg?branch=master)](https://travis-ci.com/IBM/MAX-Image-Resolution-Enhancer)

# IBM Developer Model Asset Exchange: Image Super-Resolution Generator
# IBM Developer Model Asset Exchange: Image Resolution Enhancer

This repository contains code to instantiate and deploy an image super-resolution generator.
This repository contains code to instantiate and deploy an image resolution enhancer.
This model is able to upscale a pixelated image by a factor of 4, while generating photo-realistic details.

The GAN is based on [this GitHub repository](https://github.com/brade31919/SRGAN-tensorflow) and on [this research article](https://arxiv.org/pdf/1609.04802.pdf).

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
[IBM Cloud Object Storage](http://max-assets.s3.us.cloud-object-storage.appdomain.cloud/max-image-super-resolution-generator/1.0/assets.tar.gz).
[IBM Cloud Object Storage](http://max-assets.s3.us.cloud-object-storage.appdomain.cloud/max-image-resolution-enhancer/1.0/assets.tar.gz).
The code in this repository deploys the model as a web service in a Docker container. This repository was developed
as part of the [IBM Developer Model Asset Exchange](https://developer.ibm.com/exchanges/models/).

Expand Down Expand Up @@ -52,8 +52,8 @@ _NOTE: The SRGAN in the paper was trained on 350k ImageNet samples, whereas this

| Component | License | Link |
| ------------- | -------- | -------- |
| This repository | [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) | [LICENSE](https://github.com/IBM/MAX-Image-Super-Resolution-Generator/blob/master/LICENSE) |
| Model Weights | [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) | [LICENSE](https://github.com/IBM/MAX-Image-Super-Resolution-Generator/blob/master/LICENSE) |
| 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) |
| 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) |
| Model Code (3rd party) | [MIT](https://opensource.org/licenses/MIT) | [LICENSE](https://github.com/brade31919/SRGAN-tensorflow/blob/master/LICENSE.txt) |
| Test assets | [CC BY 2.0](https://creativecommons.org/licenses/by/2.0/) | [Asset README](assets/README.md) |
| | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | [Asset README](assets/README.md) |
Expand All @@ -74,7 +74,7 @@ _NOTE: The SRGAN in the paper was trained on 350k ImageNet samples, whereas this
To run the docker image, which automatically starts the model serving API, run:

```
$ docker run -it -p 5000:5000 codait/max-image-super-resolution-generator
$ docker run -it -p 5000:5000 codait/max-image-resolution-enhancer
```

This will pull a pre-built image from Docker Hub (or use an existing image if already cached locally) and run it.
Expand All @@ -87,7 +87,7 @@ You can also deploy the model on Kubernetes using the latest docker image on Doc
On your Kubernetes cluster, run the following commands:

```
$ kubectl apply -f https://github.com/IBM/MAX-Image-Super-Resolution-Generator/raw/master/max-image-super-resolution-generator.yaml
$ kubectl apply -f https://github.com/IBM/max-image-resolution-enhancer/raw/master/max-image-resolution-enhancer.yaml
```

The model will be available internally at port `5000`, but can also be accessed externally through the `NodePort`.
Expand All @@ -106,19 +106,19 @@ The model will be available internally at port `5000`, but can also be accessed
Clone this repository locally. In a terminal, run the following command:

```
$ git clone https://github.com/IBM/MAX-Image-Super-Resolution-Generator.git
$ git clone https://github.com/IBM/max-image-resolution-enhancer.git
```

Change directory into the repository base folder:

```
$ cd MAX-Image-Super-Resolution-Generator
$ cd max-image-resolution-enhancer
```

To build the docker image locally, run:

```
$ docker build -t max-image-super-resolution-generator .
$ docker build -t max-image-resolution-enhancer .
```

All required model assets will be downloaded during the build process. _Note_ that currently this docker image is CPU only (we will add support for GPU images later).
Expand All @@ -129,7 +129,7 @@ All required model assets will be downloaded during the build process. _Note_ th
To run the docker image, which automatically starts the model serving API, run:

```
$ docker run -it -p 5000:5000 max-image-super-resolution-generator
$ docker run -it -p 5000:5000 max-image-resolution-enhancer
```

### 3. Use the Model
Expand Down
2 changes: 1 addition & 1 deletion assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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.

_Note: the finetuned model files are hosted on [IBM Cloud Object Storage](http://max-assets.s3.us.cloud-object-storage.appdomain.cloud/max-image-super-resolution-generator/1.0/assets.tar.gz)._
_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)._

## Test Examples (assets/testexamples)

Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SWAGGER_UI_DOC_EXPANSION = 'none'

# API metadata
API_TITLE = 'MAX Image Super-Resolution Generator'
API_TITLE = 'MAX Image Resolution Enhancer'
API_DESC = 'Upscale low-resolution images by a factor of 4x. This model was trained on the OpenImagesV4 dataset.'
API_VERSION = '0.1'

Expand Down
32 changes: 32 additions & 0 deletions max-image-resolution-enhancer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: v1
kind: Service
metadata:
name: max-image-resolution-enhancer
spec:
selector:
app: max-image-resolution-enhancer
ports:
- port: 5000
type: NodePort
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: max-image-resolution-enhancer
labels:
app: max-image-resolution-enhancer
spec:
selector:
matchLabels:
app: max-image-resolution-enhancer
replicas: 1
template:
metadata:
labels:
app: max-image-resolution-enhancer
spec:
containers:
- name: max-image-resolution-enhancer
image: codait/max-image-resolution-enhancer:latest
ports:
- containerPort: 5000
32 changes: 0 additions & 32 deletions max-image-super-resolution-generator.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_swagger():

json = r.json()
assert 'swagger' in json
assert json.get('info') and json.get('info').get('title') == 'MAX Image Super-Resolution Generator'
assert json.get('info') and json.get('info').get('title') == 'MAX Image Resolution Enhancer'


def test_metadata():
Expand Down

0 comments on commit 5c7ce01

Please sign in to comment.