Skip to content

Instantly share code, notes, and snippets.

@maxoobot
Last active March 23, 2020 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxoobot/2f1975742b52c6c5acdcd44c4c9a3357 to your computer and use it in GitHub Desktop.
Save maxoobot/2f1975742b52c6c5acdcd44c4c9a3357 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MNIST Flask app</title>
</head>
<body>
<h1>MNIST image classifier</h1>
<form id="upload-form" action="{{ url_for('upload_and_predict') }}" method="POST" enctype="multipart/form-data">
<input type="file" name="file" accept="image/*">
<input type="hidden" name="uploaded" value="True">
<input type="submit" value="Predict">
</form>
<br>
{% if uploaded %}
<span style="font-size:18px">Prediction Result: {{ prediction }}</span>
<br><br>
<img src="{{ imgpath }}" width="320">
{% else %}
<span style="font-size:18px">Prediction Result: --upload a picture!--</span>
{% endif %}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment