From 5c7ce01377c4962c292971010aaf536bc8ebbfa6 Mon Sep 17 00:00:00 2001 From: Simon Plovyt Date: Thu, 28 Mar 2019 11:07:27 -0700 Subject: [PATCH] Namechange Image-Super-Resolution-Generator to Image-Resolution-Enhancer --- .travis.yml | 4 +-- Dockerfile | 2 +- README.md | 24 ++++++++--------- assets/README.md | 2 +- config.py | 2 +- max-image-resolution-enhancer.yaml | 32 +++++++++++++++++++++++ max-image-super-resolution-generator.yaml | 32 ----------------------- tests/test.py | 2 +- 8 files changed, 50 insertions(+), 50 deletions(-) create mode 100755 max-image-resolution-enhancer.yaml delete mode 100755 max-image-super-resolution-generator.yaml diff --git a/.travis.yml b/.travis.yml index 1c59c76..ceaf4df 100755 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 3e75b26..5bb34d4 100755 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index d9ad683..7757e67 100755 --- a/README.md +++ b/README.md @@ -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/). @@ -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) | @@ -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. @@ -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`. @@ -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). @@ -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 diff --git a/assets/README.md b/assets/README.md index da510c9..f514eee 100755 --- a/assets/README.md +++ b/assets/README.md @@ -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) diff --git a/config.py b/config.py index 4834c6d..30d7679 100755 --- a/config.py +++ b/config.py @@ -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' diff --git a/max-image-resolution-enhancer.yaml b/max-image-resolution-enhancer.yaml new file mode 100755 index 0000000..1e961d4 --- /dev/null +++ b/max-image-resolution-enhancer.yaml @@ -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 diff --git a/max-image-super-resolution-generator.yaml b/max-image-super-resolution-generator.yaml deleted file mode 100755 index fba99a0..0000000 --- a/max-image-super-resolution-generator.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: max-image-super-resolution-generator -spec: - selector: - app: max-image-super-resolution-generator - ports: - - port: 5000 - type: NodePort ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: max-image-super-resolution-generator - labels: - app: max-image-super-resolution-generator -spec: - selector: - matchLabels: - app: max-image-super-resolution-generator - replicas: 1 - template: - metadata: - labels: - app: max-image-super-resolution-generator - spec: - containers: - - name: max-image-super-resolution-generator - image: codait/max-image-super-resolution-generator:latest - ports: - - containerPort: 5000 diff --git a/tests/test.py b/tests/test.py index 30ea469..a4d1880 100755 --- a/tests/test.py +++ b/tests/test.py @@ -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():