Skip to content

Instantly share code, notes, and snippets.

View Manikanta-Munnangi's full-sized avatar
🎯
Focusing

Manikanta Munnangi Manikanta-Munnangi

🎯
Focusing
View GitHub Profile
@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__)
# 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():
# 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: