Skip to content

Commit e2ceb4b

Browse files
committed
Files Uploaded
1 parent 68da834 commit e2ceb4b

38 files changed

+2759
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.ckpt filter=lfs diff=lfs merge=lfs -text
2+
modelbest.ckpt filter=lfs diff=lfs merge=lfs -text

Foodimg2Ing/Templates/about.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{% extends "layout.html" %}
2+
{% block content %}
3+
4+
5+
6+
</div>
7+
</div>
8+
</div>
9+
10+
<div id="section-about"onload="sampleFunction()">
11+
<div id="aboutcard" class="card col-md-8">
12+
<div class="card-header ">
13+
<b>ABOUT</b>
14+
</div>
15+
<div class="card-body">
16+
<p class="title">TITLE : Recipe Generation From Food Image</p>
17+
<p class="title">ABSTRACT :</p>
18+
<p class="aboutcontent">People enjoy food photography because they appreciate
19+
food. Behind each meal there is a story described in a complex recipe and, unfortunately, by simply looking at a food
20+
image we do not have access to its preparation process.
21+
Therefore, in this paper we introduce an inverse cooking
22+
system that recreates cooking recipes given food images.
23+
Our system predicts ingredients as sets by means of a novel
24+
architecture, modeling their dependencies without imposing any order, and then generates cooking instructions by
25+
attending to both image and its inferred ingredients simultaneously.
26+
.</p>
27+
<p class="title">Group Members :</p>
28+
<ul>
29+
<li>Navas Sherif I</li>
30+
<li>Sreelakshmi Vinod</li>
31+
<li>Keerthi S</li>
32+
<li>Vismaya</li>
33+
</ul>
34+
<a href="#" class="btn btn-primary">Go somewhere</a>
35+
</div>
36+
</div>
37+
</div>
38+
39+
{% endblock content %}

Foodimg2Ing/Templates/header.html

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0,shrink-to-fit=no">
7+
8+
<!-- CSS -->
9+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
10+
<link rel="stylesheet" href="{{ url_for('static',filename='css/style.css') }}">
11+
12+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
13+
14+
15+
16+
17+
<title>NS Creations</title>
18+
<link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.ico') }}">
19+
</head>
20+
<body>
21+
22+
<!-- Navigation Bar -->
23+
<div id="Section-1">
24+
<nav class="navbar navbar-expand-lg navbar-light bg-grey">
25+
<a class="navbar-brand" href="" style="font-family: 'Times New Roman', Times, serif;">
26+
<img src="{{ url_for('static',filename='images/favicon.ico') }}" width="30" height="30" class="d-inline-block align-top" alt="" style="margin-top: -5.5px;">
27+
NS CREATIONS</a>
28+
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
29+
<span class="navbar-toggler-icon"></span>
30+
</button>
31+
<div class="collapse navbar-collapse " id="navbarNavDropdown">
32+
<ul class="navbar-nav mx-auto">
33+
<li class="nav-item active">
34+
<a class="nav-link" href="{{url_for('home')}}">Home <span class="sr-only">(current)</span></a>
35+
</li>
36+
<li class="nav-item active">
37+
<a class="nav-link" href="{{url_for('about')}}">About</a>
38+
</li>
39+
</ul>
40+
</div>
41+
</nav>
42+
</div>
43+
44+
45+
46+
47+
48+
49+
{% block content %}{% endblock %}
50+
51+
52+
53+
54+
55+
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
56+
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
57+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
58+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
59+
60+
</body>
61+
<footer>
62+
<script src="{{ url_for('static', filename='main.js') }}" type="text/javascript"></script>
63+
</footer>
64+
</html>

Foodimg2Ing/Templates/home.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{% extends "layout.html" %}
2+
{% block home %}
3+
4+
5+
<div id="info" class="col-md-8">
6+
<div class="card m-3">
7+
<img src="{{ url_for('static',filename='images/cover.jpg')}}" class="card-img-top" alt="..." >
8+
<div class="card-body" >
9+
<h5 class="card-title text-center" id=infotitle >Recipe Generation from Food Image</h5>
10+
<br>
11+
<p class="card-text" id="infobody">Upload any Food Image<br>Our Model will predict its Food Name , Ingredients and its Recipe.</p>
12+
<p class="card-text"><small class="text-muted">Processing time : Approx 40s</small></p>
13+
</div>
14+
</div>
15+
</div>
16+
17+
18+
<div id="loading" style="display:none;" class="col-md-8">
19+
<div class="loader">
20+
<div class="inner one"></div>
21+
<div class="inner two"></div>
22+
<div class="inner three"></div>
23+
<h4>Loading</h4>
24+
<h5>Kindly wait for few seconds</h5>
25+
</div>
26+
</div>
27+
</div>
28+
</div>
29+
</div>
30+
31+
{% endblock home %}

Foodimg2Ing/Templates/layout.html

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{% extends "header.html" %}
2+
{% block content %}
3+
4+
<div id="section-2">
5+
<div class="container pt-5">
6+
<div class="row">
7+
<div class="col-md-4">
8+
<div class="wrapper">
9+
<div class="image">
10+
{% if img %}
11+
<img id="foodimage" onload="$(this).data('loaded', 'loaded');" src="{{ url_for('static',filename=img)}}" alt="">
12+
{% else %}
13+
<img id="foodimage" onload="$(this).data('loaded', 'loaded');" src="" alt="">
14+
15+
{% endif %}
16+
17+
18+
</div>
19+
<div class="content">
20+
<div class="icon text-center">
21+
<i class="fas fa-cloud-upload-alt"></i>
22+
</div>
23+
<div class="text">
24+
No file chosen, yet!
25+
</div>
26+
</div>
27+
<div id="cancel-btn">
28+
<i class="fas fa-times"></i>
29+
</div>
30+
<div class="file-name">
31+
File name here
32+
</div>
33+
</div>
34+
<button onclick="defaultBtnActive()" id="custom-btn">Upload a Food Image</button>
35+
<form id='foodimgform'action="/" method="POST" enctype="multipart/form-data">
36+
<input id="default-btn" type="file" hidden name="imagefile">
37+
</form>
38+
<button id="buttonsample" data-toggle="modal" data-target="#myModal">Choose from Sample Image</button>
39+
<div class="modal" id="myModal" tabindex="-1">
40+
<div class="modal-dialog">
41+
<div class="modal-content">
42+
<div class="modal-header">
43+
<h5 class="modal-title">Sample Food Images</h5>
44+
<button id="close" type="button" class="close" data-dismiss="modal" aria-hidden="true">
45+
<i class="fas fa-times"></i>
46+
</button>
47+
</div>
48+
<div class="modal-body">
49+
<div class="container">
50+
<div class="row">
51+
<div class="col">
52+
<div class="card" style="width: 18rem;">
53+
<img src="{{ url_for('static',filename='images/burger.jpg') }}" class="card-img-top" alt="...">
54+
<div class="card-body">
55+
<h5 class="card-title">Burger</h5>
56+
<a href="burger" class="btn btn-primary" onclick="select('burger.jpg')">Select</a>
57+
</div>
58+
</div>
59+
</div>
60+
<div class="col">
61+
<div class="card" style="width: 18rem;">
62+
<img src="{{ url_for('static',filename='images/chocolate-cake.jpg') }}" class="card-img-top" alt="..." >
63+
<div class="card-body">
64+
<h5 class="card-title">Chocolate Cake</h5>
65+
<a href="chocolate-cake" class="btn btn-primary" onclick="select('chocolate-cake.jpg')" >Select</a>
66+
</div>
67+
</div>
68+
</div>
69+
<div class="col">
70+
<div class="card" style="width: 18rem;">
71+
<img src="{{ url_for('static',filename='images/grilled-beef.jpg') }}" class="card-img-top" alt="...">
72+
<div class="card-body">
73+
<h5 class="card-title">Grilled Beef</h5>
74+
<a href="grilled-beef" class="btn btn-primary" onclick="select('grilled-beef.jpg')">Select</a>
75+
</div>
76+
</div>
77+
</div>
78+
</div>
79+
</div>
80+
</div>
81+
<div class="modal-footer">
82+
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
83+
</div>
84+
</div>
85+
</div>
86+
</div>
87+
88+
</div>
89+
90+
{% block home %}{% endblock %}
91+
92+
{% endblock %}
93+

Foodimg2Ing/Templates/predict.html

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{% extends "layout.html" %}
2+
{% block home %}
3+
4+
5+
<div id="info" class="col-md-8">
6+
<div class="card text-center pb-2">
7+
<div class="card-header">
8+
<ul class="nav nav-tabs card-header-tabs">
9+
<li class="nav-item">
10+
<a class="nav-link active " id="tabbtn1" href="#" onclick="javascript:myFunctab1()">Recipe 1</a>
11+
</li>
12+
<li class="nav-item">
13+
<a class="nav-link " id="tabbtn2" href="#" onclick="javascript:myFunctab2()">Recipe 2</a>
14+
</li>
15+
</ul>
16+
</div>
17+
<div id="tab1" >
18+
<div class="card-body" align="left" id="result">
19+
{% if title[0] != "Not a valid recipe!" %}
20+
<h5 class="card-title" align='center'>{{title[0]}}</h5>
21+
<br>
22+
<h6>Ingredients :</h6>
23+
<p class="card-text">{{', '.join(ingredients[0])}}</p>
24+
<br>
25+
<h6>Recipe :</h6>
26+
<ol class="pl-3">
27+
{% for i in recipe[0] %}
28+
<li class="card-text">{{i}}</li>
29+
{% endfor %}
30+
</ol>
31+
32+
{% else %}
33+
<h5 class="card-title" align='center'>{{title[0]}}</h5>
34+
<br>
35+
<h6 class="card-text">{{recipe[0]}}</h6>
36+
{% endif %}
37+
<br>
38+
<p class="card-text"><small class="text-muted">Check both the Recipes</small></p>
39+
</div>
40+
</div>
41+
42+
43+
<div id="tab2" style="display:None">
44+
<div class="card-body" align="left" id="result">
45+
{% if title[1] != "Not a valid recipe!" %}
46+
<h5 class="card-title" align='center'>{{title[1]}}</h5>
47+
<br>
48+
<h6>Ingredients :</h6>
49+
<p class="card-text">{{', '.join(ingredients[1])}}</p>
50+
<br>
51+
<h6>Recipe :</h6>
52+
<ol class="pl-3">
53+
{% for i in recipe[1] %}
54+
<li class="card-text">{{i}}</li>
55+
{% endfor %}
56+
</ol>
57+
58+
{% else %}
59+
<h5 class="card-title" align='center'>{{title[1]}}</h5>
60+
<br>
61+
<h6 class="card-text">{{recipe[1]}}</h6>
62+
{% endif %}
63+
</div>
64+
</div>
65+
66+
</div>
67+
</div>
68+
69+
<div id="loading" style="display:none;" class="col-md-8">
70+
<div class="loader">
71+
<div class="inner one"></div>
72+
<div class="inner two"></div>
73+
<div class="inner three"></div>
74+
<h4>Loading</h4>
75+
<h5>Kindly wait for few seconds</h5>
76+
</div>
77+
</div>
78+
79+
</div>
80+
</div>
81+
</div>
82+
83+
{% endblock home %}

Foodimg2Ing/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from flask import Flask
2+
3+
app = Flask(__name__,template_folder='Templates')
4+
5+
6+
from Foodimg2Ing import routes

0 commit comments

Comments
 (0)