Setting up a web application

We will use the Flask framework to build a simple application to detect the car's damage.

To learn more about Flask, please refer to https://www.fullstackpython.com/flask.html.

We are not going to go deeper into Flask basics here. Instead, we are simply adding our model with an existing file upload example from Flask.

The file's structure is shown in the following screenshot:

Here is a list of the contents in app.py:

import osimport globfrom classify import predictionimport tensorflow as tfimport threadimport timefrom flask import Flask, render_template, request, redirect, url_for, send_from_directory,flashfrom ...

Get Mobile Artificial Intelligence Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.