demo_app

A toy application for demo and testing purposes. We just implement dummy inference, ie. we return the same inputs we are fed.


Model

Published by DEEP-Hybrid-DataCloud Consortium
Created: - Updated:

Model Description

Build Status

It can serve as a reference implementation of current best practices in the project (mirroring the DEEP template).

This demo module implements:

  • dummy inference, ie. we return the same inputs we are fed. If some input is not fed we generate a default one.

  • dummy training, ie. we sleep for some time and output some random monitoring metrics.

The two branches in this repo cover the two main usecases:

  • master: this is a reference implementation on how to return a JSON response for predict().

  • return-files: this is a reference implementation on how to return non-JSON responses for predict().

This is particularly useful when returning:

  • long responses (that could better fit better in a txt file),

  • media files (eg. returning an image),

  • multiple files (for example returning an image and a text file at the same time, packing them into a zip file).

Test this module

You can test and execute this module in various ways.

Excecute locally on your computer using Docker

You can run this module directly on your computer, assuming that you have Docker installed, by following these steps:

$ docker pull deephdc/deep-oc-demo_app
$ docker run -ti -p 5000:5000 deephdc/deep-oc-demo_app

Execute on your computer using udocker

If you do not have Docker available or you do not want to install it, you can use udocker within a Python virtualenv:

$ virtualenv udocker
$ source udocker/bin/activate
(udocker) $ pip install udocker
(udocker) $ udocker pull deephdc/deep-oc-demo_app
(udocker) $ udocker create deephdc/deep-oc-demo_app
(udocker) $ udocker run -p 5000:5000  deephdc/deep-oc-demo_app

In either case, once the module is running, point your browser to http://127.0.0.1:5000/ and you will see the API documentation, where you can test the module functionality, as well as perform other actions (such as training).

For more information, refer to the user documentation.

Categories

docker, api-v2

License

License: MIT

Get the code

Github Docker Hub

Get the data

Dataset Training files

Citing this module

Citation