Django View for Finnegan Web App

guess.views.parse_data(request, *args, **kwargs)

As a request comes from the home page via POST, parse the canvas image, downsize it to match the dims of the training data, and then pass it to the pre-trained neural network for it make a prediction.

The results of the prediction (value and confidence), as well as the array representations of the images themselves are stored in the model, and hence the PostgresQL database.

guess.views.show_data(request)

Sends a render of image as drawn and the network’s guess and confidence via the report template.

guess.views.drawing_obj

Drawing model instance

The last line from the database (specifically the most recent entry).

guess.views.stats_work(request)

Work out statistics for results

guess.views.valid_info(request, *args, **kwargs)

Stores the users validation (or dis-validation) of the network’s guess in the database along with what the user intended it to be, in the case of an incorrect guess.