This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/predict', methods=['GET', 'POST']) | |
def upload(): | |
# Get the file from post request | |
if request.method == 'POST': | |
# Save the file to ./uploads | |
f = request.files['image'] | |
# path to save image file | |
basepath = os.path.dirname(__file__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import Flask | |
from flask import Flask, render_template. | |
# create instance of the class | |
app=Flask(__name__) | |
# Guides flask which url should be running first. | |
# '/' ==> root page | |
@app.route('/') | |
def index(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Two ways of doing it. | |
""" | |
1.Using pickle a python library. | |
2.With keras. | |
""" | |
""" 1.Serialzing with pickle.""" | |
with open("path/name.pkl","wb") as file: |
NewerOlder