Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,7 @@ def fertilizer_recommendation():
# render disease prediction input page


@ app.route('/disease')
def disease():
title = 'Harvestify - Disease Detection'

return render_template('disease.html', title=title)

# ===============================================================================================

Expand Down Expand Up @@ -251,15 +247,17 @@ def disease_prediction():
return redirect(request.url)
file = request.files.get('file')
if not file:
return
img = file.read()
return render_template('disease.html', title=title)
try:
img = file.read()

prediction = predict_image(img)
prediction = predict_image(img)

prediction = Markup(str(disease_dic[prediction]))
return render_template('disease-result.html', prediction=prediction, title=title)

return render_template('disease.html')
prediction = Markup(str(disease_dic[prediction]))
return render_template('disease-result.html', prediction=prediction, title=title)
except:
pass
return render_template('disease.html', title=title)


# ===============================================================================================
Expand Down
Binary file added static/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/leaf-h.ico
Binary file not shown.
Binary file added static/images/leaf.ico
Binary file not shown.
3 changes: 2 additions & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ <h4 class="text-wh mx-auto my-4"><strong> Here are some questions we'll answer</
<p class="text-li mx-auto mt-2">
1. What crop to plant here? <br>
2. What fertilizer to use? <br>
3. Which disease do your crop have ?</p>
3. Which disease do your crop have?<br>
4. How to cure the disease?</p>
</div>
</div>
</div>
Expand Down
190 changes: 112 additions & 78 deletions templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,68 +9,90 @@
<meta name="keywords" content="Agro Harvest Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />

<style>
html { font-size: 1rem; }

@media (min-width: 576px) {
html { font-size: 1.25rem; }
}
@media (min-width: 768px) {
html { font-size: 1.5rem; }
}
@media (min-width: 992px) {
html { font-size: 1.75rem; }
}
@media (min-width: 1200px) {
html { font-size: 2rem; }
html {
font-size: 1rem;
}
h1 {
font-size: 1.2rem;
}
h2 {
font-size: 1.1rem;
}

@media (min-width: 768px) {
html {
font-size: 1.1rem;
}
h1 {
font-size: 1.3rem;
}
h2 {
font-size: 1.2rem;
}
}

@media (min-width: 991px) {
html {
font-size: 1.2rem;
}
h1 {
font-size: 1.5rem;
}
h2 {
font-size: 1.4rem;
}
}

@media (min-width: 1200px) {
html {
font-size: 1.2rem;
}
h1 {
font-size: 1.7rem;
}
h2 {
font-size: 1.6rem;
}
}

}
</style>
<style>
html {
font-size: 1rem;
}

@media (min-width: 576px) {
html {
font-size: 1.25rem;
}
}

@media (min-width: 768px) {
html {
font-size: 1.5rem;
}
}

@media (min-width: 992px) {
html {
font-size: 1.75rem;
}
}

@media (min-width: 1200px) {
html {
font-size: 2rem;
}

html {
font-size: 1rem;
}

h1 {
font-size: 1.2rem;
}

h2 {
font-size: 1.1rem;
}

@media (min-width: 768px) {
html {
font-size: 1.1rem;
}

h1 {
font-size: 1.3rem;
}

h2 {
font-size: 1.2rem;
}
}

@media (min-width: 991px) {
html {
font-size: 1.2rem;
}

h1 {
font-size: 1.5rem;
}

h2 {
font-size: 1.4rem;
}
}

@media (min-width: 1200px) {
html {
font-size: 1.2rem;
}

h1 {
font-size: 1.7rem;
}

h2 {
font-size: 1.6rem;
}
}

}
</style>
<script>
addEventListener("load", function () {
setTimeout(hideURLbar, 0);
Expand All @@ -82,23 +104,36 @@

</script>

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
</body>
<!-- css files -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="{{ url_for('static', filename='css/bootstrap.css') }}" rel='stylesheet' type='text/css' />
<!-- bootstrap css -->
<link href="{{ url_for('static', filename='css/style.css') }}" rel='stylesheet' type='text/css' />
<!-- custom css -->
<link href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="stylesheet"><!-- fontawesome css -->
<!-- //css files -->
<!-- <link rel="icon" type="image/png" href="{{ url_for('static', filename='images/favicon.png?') }}"> -->
<link rel="shortcut icon" href="{{ url_for('static', filename='images/leaf-h.ico') }}"/>

<script type="text/JavaScript" src="{{ url_for('static', filename='scripts/cities.js') }}"></script>

<script type="text/JavaScript" src="{{ url_for('static', filename='scripts/cities.js') }}"></script>


<!-- google fonts -->
Expand All @@ -119,14 +154,13 @@
<body>

<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark static-top">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark static-top" style="background-color: #1C00ff00;">
<div class="container">
<a class="navbar-brand" href="{{ url_for('home') }}">
<img src="{{ url_for('static', filename='images/logo.jpg') }}" style="width: 90px; height: 60px"alt="">
<img src="{{ url_for('static', filename='images/logo.jpg') }}" style="width: 90px; height: 55px" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
aria-label="Toggle navigation">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
Expand Down Expand Up @@ -168,18 +202,18 @@ <h2 class="logo2 text-center">
<!-- address -->
<div class="contact-left-footer mt-4">





<!-- <a href="community.html">Community</a> -->


<!-- <a href="community.html">Community</a> -->
</p>
</div>
<div class="w3l-copy text-center">
<p class="text-da">An Environmental Intelligence Startup<br> </p>
</div>
<p class="homelogo">
<p>Made with ❤️ by Atharva</p>
<p>Made with ❤️ by Atharva</p>
</div>
</footer>
<!-- //footer -->
Expand Down