May 2020
Intermediate to advanced
404 pages
10h 52m
English
We will now be creating a bare-bones web Client to call the API. To do so, we must modify our current code. In flask_app.py, first change the import statement for Flask in order to extend it to another module—render_template—as shown:
from flask import Flask, request, render_template
Now, we create a folder, templates, in the working directory and add a file, index.html, to it with the following code:
<!DOCTYPE html><html lang="en"> <head> <title>MNIST CNN</title> </head> <body> <h1>MNIST Handwritten Digits Prediction</h1> <form> <input type="file" name="img"></input> <input type="submit"></input> </form> <hr> <h3>Prediction: <span id="result"></span></h3> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> ...
Read now
Unlock full access