Home

Awesome

Computer Vision Models As Service (Docker Hackathon)

This project implements different Computer Vision Deep Learning Models as a service. It presents the capabilities of these models for creating ML applications.

It contains 3 pre-trained DL models which can be used in image processing and recognition.

The DL models are deployed as microservices and you can embed them on any application with one line of code using the provided Models API endpoints.

Models

Currently, Deployed Deep Learning Models:

Image Super Resolution

superresulotion

Super Resolution service is a Deep Learning model to enhance low resolution image to high quality image.

The service is based on Single Image Super Resolution (SISR) deep learning model which is available on Open Model Zoo, check this page for more info.

Super Resolution is the process of enhancing the quality of an image by increasing the pixel count using deep learning.

In brief:

It has applications in a number of domains including surveillance and security, medical imagery and enhancing Satellite images from the space.

You can use image samples in the /sample_images directory to test it on the model.

Layout Parser

layout_parser

Layout Parser is a Deep Learning model for Document Image Analysis.

It provides the following functionality:

You can check full documentation of the project on this GitHub repository.

Project Structure

The project consists of the following:

How to call it

Super Resolution Model

You can call the model by sending post request to this Models API endpoint with the input image as paramater

<pre> endpoint = "http://localhost:5000/models/super_resolution" image_source = "images/space.jpg" image = cv2.imread(image_source) res = requests.post(endpoint, json={'image': image.tolist()}) </pre>

It will return response in json format containing the key super for result image.

Layout Parser Model

You can call the model detect layout inference by sending post request to this Models API endpoint with the input image as paramater

<pre> endpoint = "http://localhost:5000/models/layout_parser" image_source = "images/newspaper.jpg" image = cv2.imread(image_source) res = requests.post(endpoint, json={'image': image.tolist()}) </pre>

It will return response in json format containing the key layout for result image.

Also You can extract the text data from layout using OCR agent by sending post request to this Models API endpoint with the input image as paramater

<pre> endpoint = "http://localhost:5000/models/layout_parser/get_text" image_source = "images/newspaper.jpg" image = cv2.imread(image_source) res = requests.post(endpoint, json={'image': image.tolist()}) </pre>

It will return response in json format containing the key layout_text for result text.

You can check this notebook for live demo of calling models inference by Models API endpoints.

Models Containerizing using Docker [MLOps]

The project root directory containing different docker-compose files for running each model application.

Each service has its own Dockerfile for deploying and running it using Docker engine.

The docker compose files:

Note:

Models API service listen to port 5000 using the url:

http://localhost:5000

Streamlit application listen to the port 8501 using the url:

http://localhost:8501

References

Single Image Super Resolution Research Paper

Layout Parser Toolkit

Layout Parser Documentation

Layout Parser Research Paper