Tool for creating nanowire tools with the flask structure.
Project description
# Nanowire flask
This library is designed to allow a python developer to easily create a nanowire plugin using the flask APIs structure.
The function you mount, using the class ImagesAPI, must have the arguments <code>img</code> and <code>variables</code> if you want initialise a model or other variables when the sever starts you may make the function to be mounted into a function of a class which is initiated with the desired variables. In this case your variables will be <code>self</code>, <code>img</code> and <code>variables</code>. You should expect <code>img</code> to be a PIL RGB image object and <code>variables</code> to be a dictionary containing the variables sent to the plugin in the curl request.
The curl requests for images may be formatted 2 ways. The first involves sending the image as a file attached to the curl request. For example:
<code>curl -F “image=@./1.jpg” -XPOST http://0.0.0.0:5000/model/predict?threshold=0.5</code>
alternativly the file may be sent as a link using a dictionary eg.
<code>curl -X POST -H “Content-Type:application/json” -d ‘{“contentURL”:”http://127.0.0.1:8000/1.jpg”, “threshold”:0.5}’ http://0.0.0.0:5000/model/predict</code>
At the moment it can only handle images however it will soon be expanded to handle text and eventually video and sound. The currently supported image formats are:
jpg
png
bmp
tif
ppm
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for nanowire_flask-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4fd7b817fb973ac0d0ff8c53ab6eb7ca673510475f257f2b6750ba06fca41a1 |
|
MD5 | 3091e065be587635fc2d1a66d409383a |
|
BLAKE2b-256 | 8e57d71ce08af7a85b68b4e1dd47cfb2b832907f2d18863300264f392e75a3ee |
Hashes for nanowire_flask-0.0.6-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23f68579794f445f79479c24683a0a9ae242b56eb638289f9141bf8055573514 |
|
MD5 | 958ec3de51eb1dbe79ff64398c80a3b4 |
|
BLAKE2b-256 | 47b0d14064ad9e16c6734822d0470dc44680ca36cc2b95da370bcb18faa5bd24 |