app module

app.allowed_file(filename)

Check if file is allowed to be uploaded (filetypes is either png, jpg or jpeg)

Parameters

filename (str) – name of the file to be uploaded (e.g. myimage.jpg)

Returns

Whether the file is allowed to be uploaded or not

Return type

bool

app.application()

Host the App on local IP Address (port 5000 by default)

app.display_image(filename)

Display the uploaded image

Parameters

filename (str) – Filename of uploaded file

app.docs()

Redirect the user to the documentation page (/docs)

app.resize(im)

Resizes image to a width of 500 so that it can be displayed on the webpage

Parameters

im (numpy arr) – Input image as an array

Returns

Resized image

Return type

numpy arr

app.upload_form()

Displays the main page with the file upload form

app.upload_image()

Upload the image selected by the user

Returns

filename of the image uploaded str: predictions of the image uploaded

Return type

str