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: |
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
@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
<form action="/predict" method="POST" enctype="multipart/form-data"> | |
<input type="file" class="btn" name="image" | |
style="font-size: 20px;font-weight: bolder;color: black;border-radius: 10px;" | |
accept="image/*" required> | |
<input type="submit" class="btn" | |
style="font-size: 20px;font-weight: bolder;color: black;border-radius: 10px;"> | |
</form> |
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
<div class="container bg-3" style="color: black;text-align: justify;"> | |
<div class="row"> | |
<div class="col-md-7" style="font-size:inherit"> | |
<h1 style="font-weight: 20px;"> Casued By Pathogen </h1> | |
<p style="font-weight: 15px;">{{Pathogen}} </p> | |
<h1 style="font-weight: 20px;"> Symptoms of Affected plant</h1> | |
<p style="font-weight: 15px;">{{Symptoms}} </p> | |
<h1 style="font-weight: 20px;"> Management </h1> | |
<p style="font-weight: 15px;">{{Management}} </p> | |
</div> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer