work of nayon
Browse files- .gitattributes +1 -0
- home_page.jpg +0 -0
- image_to_food_model.h5 +3 -0
- image_to_food_model.keras +3 -0
- image_to_food_model1.h5 +3 -0
- labels.txt +80 -0
- main.py +110 -0
- requirements.txt +65 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
image_to_food_model.keras filter=lfs diff=lfs merge=lfs -text
|
home_page.jpg
ADDED
image_to_food_model.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b1c2179ca3751be5bce47fcd79940ac3697099530871a09fa5015711a80c532d
|
3 |
+
size 45028192
|
image_to_food_model.keras
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5fc9bbb79489b2b12e8207fd1c64ced29302b9125b58e1c3259ece747d1f47b9
|
3 |
+
size 45027596
|
image_to_food_model1.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:40c57ca9506bb3762fb6f3ad0bf7b4983c235866c4b34d5f31fc78d0128d0b15
|
3 |
+
size 45028192
|
labels.txt
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
adhirasam
|
2 |
+
aloo_gobi
|
3 |
+
aloo_matar
|
4 |
+
aloo_methi
|
5 |
+
aloo_shimla_mirch
|
6 |
+
aloo_tikki
|
7 |
+
anarsa
|
8 |
+
ariselu
|
9 |
+
bandar_laddu
|
10 |
+
basundi
|
11 |
+
bhatura
|
12 |
+
bhindi_masala
|
13 |
+
biryani
|
14 |
+
boondi
|
15 |
+
butter_chicken
|
16 |
+
chak_hao_kheer
|
17 |
+
cham_cham
|
18 |
+
chana_masala
|
19 |
+
chapati
|
20 |
+
chhena_kheeri
|
21 |
+
chicken_razala
|
22 |
+
chicken_tikka
|
23 |
+
chicken_tikka_masala
|
24 |
+
chikki
|
25 |
+
daal_baati_churma
|
26 |
+
daal_puri
|
27 |
+
dal_makhani
|
28 |
+
dal_tadka
|
29 |
+
dharwad_pedha
|
30 |
+
doodhpak
|
31 |
+
double_ka_meetha
|
32 |
+
dum_aloo
|
33 |
+
gajar_ka_halwa
|
34 |
+
gavvalu
|
35 |
+
ghevar
|
36 |
+
gulab_jamun
|
37 |
+
imarti
|
38 |
+
jalebi
|
39 |
+
kachori
|
40 |
+
kadai_paneer
|
41 |
+
kadhi_pakoda
|
42 |
+
kajjikaya
|
43 |
+
kakinada_khaja
|
44 |
+
kalakand
|
45 |
+
karela_bharta
|
46 |
+
kofta
|
47 |
+
kuzhi_paniyaram
|
48 |
+
lassi
|
49 |
+
ledikeni
|
50 |
+
litti_chokha
|
51 |
+
lyangcha
|
52 |
+
maach_jhol
|
53 |
+
makki_di_roti_sarson_da_saag
|
54 |
+
malapua
|
55 |
+
misi_roti
|
56 |
+
misti_doi
|
57 |
+
modak
|
58 |
+
mysore_pak
|
59 |
+
naan
|
60 |
+
navrattan_korma
|
61 |
+
palak_paneer
|
62 |
+
paneer_butter_masala
|
63 |
+
phirni
|
64 |
+
pithe
|
65 |
+
poha
|
66 |
+
poornalu
|
67 |
+
pootharekulu
|
68 |
+
qubani_ka_meetha
|
69 |
+
rabri
|
70 |
+
ras_malai
|
71 |
+
rasgulla
|
72 |
+
sandesh
|
73 |
+
shankarpali
|
74 |
+
sheer_korma
|
75 |
+
sheera
|
76 |
+
shrikhand
|
77 |
+
sohan_halwa
|
78 |
+
sohan_papdi
|
79 |
+
sutar_feni
|
80 |
+
unni_appam
|
main.py
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# import streamlit as st
|
2 |
+
# import tensorflow as tf
|
3 |
+
# import numpy as np
|
4 |
+
# from flask import Flask, jsonify, request
|
5 |
+
# import requests
|
6 |
+
|
7 |
+
# # Create a Flask app
|
8 |
+
# app = Flask(__name__)
|
9 |
+
|
10 |
+
# # Tensorflow Model Prediction
|
11 |
+
# def model_prediction(test_image):
|
12 |
+
# model = tf.keras.models.load_model("image_to_food_model1.h5")
|
13 |
+
# image = tf.keras.preprocessing.image.load_img(test_image, target_size=(256, 256))
|
14 |
+
# input_arr = tf.keras.preprocessing.image.img_to_array(image)
|
15 |
+
# input_arr = np.array([input_arr]) # convert single image to batch
|
16 |
+
# predictions = model.predict(input_arr)
|
17 |
+
# return np.argmax(predictions) # return index of max element
|
18 |
+
|
19 |
+
|
20 |
+
# # Define an endpoint to handle predictions
|
21 |
+
# @app.route('/', methods=['POST'])
|
22 |
+
# def predict():
|
23 |
+
# test_image = request.files['file']
|
24 |
+
# result_index = model_prediction(test_image)
|
25 |
+
# # Reading Labels
|
26 |
+
# with open("labels.txt") as f:
|
27 |
+
# content = f.readlines()
|
28 |
+
# label = [i.strip() for i in content]
|
29 |
+
# prediction = label[result_index]
|
30 |
+
# return jsonify({"prediction": prediction})
|
31 |
+
|
32 |
+
|
33 |
+
# # Sidebar
|
34 |
+
# st.sidebar.title("Dashboard")
|
35 |
+
# app_mode = st.sidebar.selectbox("Select Page", ["Prediction"])
|
36 |
+
|
37 |
+
# # Main Page
|
38 |
+
# # if app_mode == "Home":
|
39 |
+
# # st.header("Food Recipe")
|
40 |
+
# # image_path = "home_page.jpg"
|
41 |
+
# # st.image(image_path)
|
42 |
+
|
43 |
+
# # Prediction Page
|
44 |
+
# if app_mode == "Prediction":
|
45 |
+
# st.header("Model Prediction")
|
46 |
+
# test_image = st.file_uploader("Choose an Image:")
|
47 |
+
# if st.button("Show Image"):
|
48 |
+
# st.image(test_image, width=4, use_column_width=True)
|
49 |
+
|
50 |
+
# # Predict button
|
51 |
+
# if st.button("Predict"):
|
52 |
+
# st.write("Our Prediction")
|
53 |
+
# # Send image to backend for prediction
|
54 |
+
# files = {'file': test_image.getvalue()}
|
55 |
+
# response = requests.post('http://localhost:8501', files=files)
|
56 |
+
# prediction = response.json()["prediction"]
|
57 |
+
# st.success("Model is Predicting it's a {}".format(prediction))
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
+
|
62 |
+
import streamlit as st
|
63 |
+
import tensorflow as tf
|
64 |
+
import numpy as np
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
#Tensorflow Model Prediction
|
69 |
+
def model_prediction(test_image):
|
70 |
+
model = tf.keras.models.load_model("image_to_food_model1.h5")
|
71 |
+
image = tf.keras.preprocessing.image.load_img(test_image,target_size=(256,256))
|
72 |
+
input_arr = tf.keras.preprocessing.image.img_to_array(image)
|
73 |
+
input_arr = np.array([input_arr]) #convert single image to batch
|
74 |
+
predictions = model.predict(input_arr)
|
75 |
+
return np.argmax(predictions) #return index of max element
|
76 |
+
|
77 |
+
|
78 |
+
#Sidebar
|
79 |
+
st.sidebar.title("Dashboard")
|
80 |
+
app_mode = st.sidebar.selectbox("Select Page",["Prediction"])
|
81 |
+
|
82 |
+
# #Main Page
|
83 |
+
# if(app_mode=="Home"):
|
84 |
+
# st.header("Food Recipe")
|
85 |
+
# image_path = "home_page.jpg"
|
86 |
+
# st.image(image_path)
|
87 |
+
|
88 |
+
|
89 |
+
#Prediction Page
|
90 |
+
if(app_mode=="Prediction"):
|
91 |
+
st.header("Model Prediction")
|
92 |
+
test_image = st.file_uploader("Choose an Image:")
|
93 |
+
if(st.button("Show Image")):
|
94 |
+
st.image(test_image,width=4,use_column_width=True)
|
95 |
+
|
96 |
+
#Predict button
|
97 |
+
if(st.button("Predict")):
|
98 |
+
st.snow()
|
99 |
+
st.write("Our Prediction")
|
100 |
+
result_index = model_prediction(test_image)
|
101 |
+
#Reading Labels
|
102 |
+
with open("labels.txt") as f:
|
103 |
+
content = f.readlines()
|
104 |
+
label = []
|
105 |
+
|
106 |
+
for i in content:
|
107 |
+
label.append(i[:-1])
|
108 |
+
st.success("Model is Predicting it's a {}".format(label[result_index]))
|
109 |
+
|
110 |
+
|
requirements.txt
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
absl-py==2.1.0
|
2 |
+
altair==5.3.0
|
3 |
+
astunparse==1.6.3
|
4 |
+
attrs==23.2.0
|
5 |
+
blinker==1.8.2
|
6 |
+
cachetools==5.3.3
|
7 |
+
certifi==2024.2.2
|
8 |
+
charset-normalizer==3.3.2
|
9 |
+
click==8.1.7
|
10 |
+
colorama==0.4.6
|
11 |
+
flatbuffers==24.3.25
|
12 |
+
gast==0.5.4
|
13 |
+
gitdb==4.0.11
|
14 |
+
GitPython==3.1.43
|
15 |
+
google-pasta==0.2.0
|
16 |
+
grpcio==1.63.0
|
17 |
+
h5py==3.11.0
|
18 |
+
idna==3.7
|
19 |
+
Jinja2==3.1.4
|
20 |
+
jsonschema==4.22.0
|
21 |
+
jsonschema-specifications==2023.12.1
|
22 |
+
keras==3.3.3
|
23 |
+
libclang==18.1.1
|
24 |
+
Markdown==3.6
|
25 |
+
markdown-it-py==3.0.0
|
26 |
+
MarkupSafe==2.1.5
|
27 |
+
mdurl==0.1.2
|
28 |
+
ml-dtypes==0.3.2
|
29 |
+
namex==0.0.8
|
30 |
+
numpy==1.26.4
|
31 |
+
opt-einsum==3.3.0
|
32 |
+
optree==0.11.0
|
33 |
+
packaging==24.0
|
34 |
+
pandas==2.2.2
|
35 |
+
pillow==10.3.0
|
36 |
+
protobuf==4.25.3
|
37 |
+
pyarrow==16.0.0
|
38 |
+
pydeck==0.9.1
|
39 |
+
Pygments==2.18.0
|
40 |
+
python-dateutil==2.9.0.post0
|
41 |
+
pytz==2024.1
|
42 |
+
referencing==0.35.1
|
43 |
+
requests==2.31.0
|
44 |
+
rich==13.7.1
|
45 |
+
rpds-py==0.18.1
|
46 |
+
setuptools==69.5.1
|
47 |
+
six==1.16.0
|
48 |
+
smmap==5.0.1
|
49 |
+
streamlit==1.34.0
|
50 |
+
tenacity==8.3.0
|
51 |
+
tensorboard==2.16.2
|
52 |
+
tensorboard-data-server==0.7.2
|
53 |
+
tensorflow==2.16.1
|
54 |
+
tensorflow-intel==2.16.1
|
55 |
+
termcolor==2.4.0
|
56 |
+
toml==0.10.2
|
57 |
+
toolz==0.12.1
|
58 |
+
tornado==6.4
|
59 |
+
typing_extensions==4.11.0
|
60 |
+
tzdata==2024.1
|
61 |
+
urllib3==2.2.1
|
62 |
+
watchdog==4.0.0
|
63 |
+
Werkzeug==3.0.3
|
64 |
+
wheel==0.43.0
|
65 |
+
wrapt==1.16.0
|