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
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
import streamlit as st
from transformers import pipeline
from rembg import remove
from PIL import Image
from io import BytesIO
import base64
from transformers import GPT2LMHeadModel, GPT2Tokenizer
from transformers import set_seed
import random

import nltk
from nltk.corpus import stopwords
from nltk.tokenize import sent_tokenize, word_tokenize
from nltk.probability import FreqDist
from nltk import download

# Download NLTK data (if not already downloaded)
download('punkt')
download('stopwords')


# Set seed for reproducibility
set_seed(42)

st.set_page_config(layout="wide", page_title="Image Classification App")
st.write("## Image Food Classification App")
st.sidebar.write("## Upload and download :gear:")

image_classifier = pipeline("image-classification", model="mjsp/sweet")
recipe_model = GPT2LMHeadModel.from_pretrained("gpt2")
recipe_tokenizer = GPT2Tokenizer.from_pretrained("gpt2")

MAX_FILE_SIZE = 5 * 1024 * 1024  # 5MB

def convert_image(img):
    buf = BytesIO()
    img.save(buf, format="PNG")
    byte_im = buf.getvalue()
    return byte_im

def fix_image(upload):
    image = Image.open(upload)
    col1.write("Original Image :camera:")
    col1.image(image)

    fixed = remove(image)
    col2.write("Fixed Image :wrench:")
    col2.image(fixed)
    st.sidebar.markdown("\n")
    st.sidebar.download_button("Download fixed image", convert_image(fixed), "fixed.png", "image/png")


def generate_summary(recipe):
    # Tokenize the text into words and sentences
    sentences = sent_tokenize(recipe)
    words = word_tokenize(recipe)

    # Remove stopwords
    stop_words = set(stopwords.words('english'))
    filtered_words = [word for word in words if word.lower() not in stop_words]

    # Calculate word frequency
    fdist = FreqDist(filtered_words)

    # Sort words by frequency and get the most common
    most_common_words = [word for word, freq in fdist.most_common(10)]

    # Generate a summary by selecting sentences that contain the most common words
    summary = [sentence for sentence in sentences if any(word in sentence for word in most_common_words)]

    return ' '.join(summary)

   
# Your dataset of titles, ingredients, and recipes
dataset =[
    {
        "title": "Gulab Jamun",
        "ingredients": [
            "1 cup milk powder",
            "2 tbsp all-purpose flour",
            "1/4 tsp baking soda",
            "2 tbsp ghee",
            "1/4 cup milk",
            "1/4 tsp cardamom powder",
            "A pinch of saffron strands",
            "For Sugar Syrup:",
            "1 cup sugar",
            "1/2 cup water",
            "A few drops of rose water"
        ],
        "recipe": "Gulab Jamun Recipe:\n"
                  "1. In a mixing bowl, combine milk powder, all-purpose flour, baking soda, ghee, milk, and cardamom powder.\n"
                  "2. Knead the mixture into a soft dough. If it's too dry, add a little more milk.\n"
                  "3. Shape the dough into small balls.\n"
                  "4. Heat ghee in a pan and deep fry the dough balls until golden brown.\n"
                  "5. In a separate saucepan, make sugar syrup by boiling sugar and water until it thickens.\n"
                  "6. Add a few drops of rose water and saffron strands to the sugar syrup.\n"
                  "7. Soak the fried gulab jamun in the sugar syrup for a few hours until they absorb the syrup.\n"
                  "8. Serve warm or chilled. Enjoy!"
    },
    {
        "title": "Jalebi",
        "ingredients": [
            "1 cup all-purpose flour",
            "1/4 cup yogurt",
            "A pinch of baking soda",
            "1/4 tsp cardamom powder",
            "A few saffron strands",
            "1 cup sugar",
            "1/2 cup water",
            "Ghee or oil for frying"
        ],
        "recipe": "Jalebi Recipe:\n"
                  "1. In a mixing bowl, combine all-purpose flour, yogurt, baking soda, and water to form a smooth batter.\n"
                  "2. Allow the batter to ferment for a few hours or overnight.\n"
                  "3. Make a sugar syrup by boiling sugar and water until it forms a one-string consistency.\n"
                  "4. Add cardamom powder and saffron strands to the sugar syrup.\n"
                  "5. Heat ghee or oil in a pan for frying.\n"
                  "6. Pour the batter into a squeeze bottle or a piping bag.\n"
                  "7. Squeeze the batter into hot oil in a spiral shape and deep fry until golden.\n"
                  "8. Drain the jalebi and soak them in the sugar syrup for a few minutes.\n"
                  "9. Serve the sweet and syrupy jalebi."
    },
    {
        "title": "Rasgulla",
        "ingredients": [
            "1 liter full-fat milk",
            "1/4 cup lemon juice",
            "1 cup sugar",
            "4 cups water",
            "A few drops of rose water"
        ],
        "recipe": "Rasgulla Recipe:\n"
                  "1. Boil the milk in a heavy-bottomed pan and add lemon juice to curdle the milk.\n"
                  "2. Drain the whey using a muslin cloth, leaving behind the chhena (paneer).\n"
                  "3. Knead the chhena until it's smooth and make small balls.\n"
                  "4. In a separate pot, combine sugar and water and bring it to a boil to make sugar syrup.\n"
                  "5. Gently add the chhena balls to the boiling sugar syrup.\n"
                  "6. Cover and cook for about 20-25 minutes until the rasgullas double in size.\n"
                  "7. Add a few drops of rose water for flavor.\n"
                  "8. Let the rasgullas cool and refrigerate before serving. Enjoy!"
    },
   
    {
"title": "Adhirasam",
"ingredients": [
"1 cup rice flour",
"1/4 cup jaggery",
"1/4 cup ghee",
"A pinch of cardamom powder",
"A pinch of dry ginger powder",
"Oil for deep frying"
],
"recipe": "Adhirasam Recipe:\n"
"1. Dissolve jaggery in a little water and strain to remove impurities.\n"
"2. Mix rice flour, jaggery syrup, ghee, cardamom powder, and dry ginger powder to form a dough.\n"
"3. Shape the dough into flat round adhirasams.\n"
"4. Heat oil and deep fry the adhirasams until they turn golden brown.\n"
"5. Drain and enjoy the sweet adhirasams."
},
   
{
"title": "Anarsa",
"ingredients": [
"1 cup rice",
"1/2 cup powdered sugar",
"1/4 cup poppy seeds",
"Ghee for deep frying",
],
"recipe": "Anarsa Recipe:\n"
"1. Soak rice overnight and grind it to a fine paste.\n"
"2. Mix the rice paste with powdered sugar and form a smooth dough.\n"
"3. Roll out small discs and coat them with poppy seeds.\n"
"4. Heat ghee and deep fry the anarsas until they are golden brown.\n"
"5. Drain and enjoy these crispy sweets."
},
   
{
"title": "Anjeer Barfi",
"ingredients": [
"1 cup dried figs (anjeer)",
"1/2 cup condensed milk",
"1/4 cup milk",
"2 tbsp ghee",
],
"recipe": "Anjeer Barfi Recipe:\n"
"1. Soak dried figs in warm water until soft, then grind them to a smooth paste.\n"
"2. Heat ghee in a pan and add the fig paste, condensed milk, and milk.\n"
"3. Cook until the mixture thickens and leaves the sides of the pan.\n"
"4. Spread it in a greased plate, let it set, and cut into barfi squares.\n"
"5. Enjoy the delicious anjeer barfi."
},
   
{
"title": "Badam Burfi",
"ingredients": [
"1 cup almonds (badam)",
"1/2 cup sugar",
"1/4 cup water",
"A pinch of cardamom powder",
"Ghee for greasing",
],
"recipe": "Badam Burfi Recipe:\n"
"1. Soak almonds in hot water, remove the skin, and grind them to a fine paste.\n"
"2. Make sugar syrup by boiling sugar and water until it reaches one-string consistency.\n"
"3. Add the almond paste and cook until it thickens.\n"
"4. Add cardamom powder and mix well.\n"
"5. Spread the mixture in a greased plate, let it set, and cut into burfi squares.\n"
"6. Enjoy the sweet and nutty badam burfi."
},
   
{
"title": "Bal Mithai",
"ingredients": [
"1 cup khoya",
"1/2 cup powdered sugar",
"2 tbsp cocoa powder",
"2 tbsp milk",
"2 tbsp ghee",
"A pinch of cardamom powder",
],
"recipe": "Bal Mithai Recipe:\n"
"1. Heat ghee in a pan and add khoya. Cook until it's light brown.\n"
"2. Add powdered sugar, cocoa powder, and milk. Cook until it thickens.\n"
"3. Add cardamom powder and mix well.\n"
"4. Spread it in a greased plate, let it set, and cut into squares.\n"
"5. Enjoy the chocolaty Bal Mithai."
},

    {
        "title": "Balushahi",
        "ingredients": [
            "1 cup all-purpose flour",
            "1/4 cup yogurt",
            "1/4 cup ghee",
            "1/4 tsp baking soda",
            "1/4 cup water",
            "For Sugar Syrup:",
            "1 cup sugar",
            "1/2 cup water",
            "A pinch of cardamom powder",
        ],
        "recipe": "Balushahi Recipe:\n"
                  "1. In a mixing bowl, combine all-purpose flour, yogurt, ghee, baking soda, and water to form a smooth dough.\n"
                  "2. Cover and let the dough rest for 30 minutes.\n"
                  "3. Make small discs and create a dent in the center.\n"
                  "4. Heat ghee and deep fry the balushahi until golden brown.\n"
                  "5. Make sugar syrup by boiling sugar, water, and cardamom powder until it thickens.\n"
                  "6. Dip the balushahi in the sugar syrup and let it soak for a while.\n"
                  "7. Enjoy the sweet and flaky balushahi."
    },

   
   
     {
        "title": "Basundi",
        "ingredients": [
            "1 liter full-fat milk",
            "1/2 cup sugar",
            "1/4 cup chopped nuts (almonds, pistachios)",
            "A pinch of saffron strands",
            "1/4 tsp cardamom powder",
        ],
        "recipe": "Basundi Recipe:\n"
                  "1. Boil milk in a heavy-bottomed pan and simmer until it reduces to half.\n"
                  "2. Add sugar, saffron strands, cardamom powder, and chopped nuts.\n"
                  "3. Cook until it thickens and has a creamy consistency.\n"
                  "4. Chill and serve the delicious basundi."
    },
    {
        "title": "Besan Laddu",
        "ingredients": [
            "2 cups besan (gram flour)",
            "1 cup powdered sugar",
            "1/2 cup ghee",
            "A pinch of cardamom powder",
            "Chopped nuts for garnish",
        ],
        "recipe": "Besan Laddu Recipe:\n"
                  "1. Heat ghee in a pan and roast besan on low heat until it turns aromatic and golden brown.\n"
                  "2. Let it cool slightly and add powdered sugar and cardamom powder.\n"
                  "3. Mix well and shape into laddus. Garnish with chopped nuts.\n"
                  "4. Enjoy the sweet and nutty besan laddu."
    },

    {
        "title": "Bobbatlu",
        "ingredients": [
            "1 cup chana dal",
            "1 cup jaggery",
            "1 cup maida (all-purpose flour)",
            "1/4 cup ghee",
            "A pinch of turmeric powder",
            "A pinch of cardamom powder"
        ],
        "recipe": "Bobbatlu Recipe:\n"
                  "1. Cook chana dal until it's soft and can be mashed easily.\n"
                  "2. Drain excess water and grind the cooked dal with jaggery into a smooth paste.\n"
                  "3. Heat ghee in a pan, add the dal-jaggery mixture, and cook until it thickens.\n"
                  "4. Add turmeric and cardamom powder, mix well, and let it cool.\n"
                  "5. Make small balls of the mixture and set them aside.\n"
                  "6. In a separate bowl, prepare a soft dough with maida and water.\n"
                  "7. Take a small portion of the dough, flatten it, and place a dal-jaggery ball in the center.\n"
                  "8. Seal the edges and flatten the stuffed dough into a circle.\n"
                  "9. Heat a griddle and cook the bobbatlu until they are golden and cooked on both sides.\n"
                  "10. Serve the delicious bobbatlu."
    },

    {
"title": "Boondi",
"ingredients": [
"2 cups besan (gram flour)",
"A pinch of baking soda",
"1/4 tsp cardamom powder",
"A pinch of saffron strands",
"Oil for frying",
"For Sugar Syrup:",
"1 cup sugar",
"1/2 cup water"
],
"recipe": "Boondi Recipe:\n"
"1. Prepare a batter with besan, baking soda, and water. The consistency should be thin.\n"
"2. Heat oil in a pan for frying.\n"
"3. Hold a perforated ladle or slotted spoon over the hot oil.\n"
"4. Pour a ladleful of batter onto the ladle, and tiny droplets (boondi) will fall into the oil.\n"
"5. Fry until they are crisp but not brown.\n"
"6. Make sugar syrup by boiling sugar and water until it reaches a one-string consistency.\n"
"7. Add cardamom powder and saffron strands to the sugar syrup.\n"
"8. Immerse the boondi in the sugar syrup, let it soak, and serve."
},
   
{
"title": "Boondi Ladoo",
"ingredients": [
"2 cups boondi (prepared as per the previous recipe)",
"1/2 cup powdered sugar",
"1/4 cup chopped nuts (cashews, almonds)",
"A pinch of cardamom powder",
"2-3 tbsp ghee"
],
"recipe": "Boondi Ladoo Recipe:\n"
"1. Take the prepared boondi and add powdered sugar, cardamom powder, and chopped nuts.\n"
"2. Mix well and ensure that the sugar is evenly coated.\n"
"3. Heat ghee in a small pan and add it to the mixture for binding.\n"
"4. Shape the mixture into small round ladoos while it's still warm.\n"
"5. Let them cool and solidify before serving."
},

    {
"title": "Cham Cham",
"ingredients": [
"1 liter milk",
"1/2 cup lemon juice",
"1/4 cup sugar",
"A pinch of cardamom powder",
"2-3 drops of rose water",
"A few pistachios for garnish"
],
"recipe": "Cham Cham Recipe:\n"
"1. Boil the milk and add lemon juice to curdle it.\n"
"2. Drain the whey using a muslin cloth and collect the chhena (paneer).\n"
"3. Knead the chhena until smooth and divide it into small cylindrical shapes (cham cham).\n"
"4. Boil sugar and water to make sugar syrup. Add cardamom powder and rose water.\n"
"5. Boil the cham cham in the sugar syrup for 20-25 minutes until they expand in size.\n"
"6. Let them cool, garnish with pistachios, and serve."
},

    {
"title": "Chena Murki",
"ingredients": [
"2 cups chhena (paneer)",
"1 cup sugar",
"1/4 cup water",
"A pinch of cardamom powder",
"A few strands of saffron",
"2-3 drops of rose water"
],
"recipe": "Chena Murki Recipe:\n"
"1. Take chhena and shape it into small, flat rectangles or any desired shape.\n"
"2. Prepare sugar syrup by boiling sugar and water until it reaches a one-string consistency.\n"
"3. Add cardamom powder, saffron strands, and rose water to the syrup.\n"
"4. Immerse the chena pieces in the syrup, ensuring they are well coated.\n"
"5. Let them cool and absorb the flavors before serving."
},

    {
"title": "Chenna Poda",
"ingredients": [
"2 cups chhena (paneer)",
"1 cup sugar",
"2-3 tbsp semolina",
"1/4 cup ghee",
"A pinch of cardamom powder",
"A few raisins and cashews for garnish"
],
"recipe": "Chenna Poda Recipe:\n"
"1. Take chhena and add sugar, semolina, ghee, and cardamom powder.\n"
"2. Mix well and let it rest for a few hours.\n"
"3. Preheat the oven to 180°C (350°F).\n"
"4. Grease a cake tin and transfer the chenna mixture to it.\n"
"5. Garnish with raisins and cashews.\n"
"6. Bake for about 45-50 minutes until it's browned and firm.\n"
"7. Let it cool, slice, and enjoy the chenna poda."
},

    {
"title": "Chikki",
"ingredients": [
"1 cup peanuts",
"1/2 cup jaggery",
"1/4 cup ghee",
"A pinch of cardamom powder"
],
"recipe": "Chikki Recipe:\n"
"1. Dry roast the peanuts until they are crisp and remove the skins.\n"
"2. Crush the peanuts coarsely.\n"
"3. Heat ghee in a pan and add jaggery. Cook until it melts and forms a one-string consistency.\n"
"4. Add the crushed peanuts and cardamom powder to the melted jaggery.\n"
"5. Mix quickly and transfer it to a greased plate. Flatten it with a greased rolling pin.\n"
"6. Let it cool, break it into pieces, and enjoy the chikki."
},

    {
"title": "Chiroti",
"ingredients": [
"1 cup maida (all-purpose flour)",
"1/4 cup ghee",
"A pinch of salt",
"Oil for deep frying",
"For Sugar Syrup:",
"1 cup sugar",
"1/2 cup water"
],
"recipe": "Chiroti Recipe:\n"
"1. Prepare a soft and smooth dough with maida, ghee, and a pinch of salt.\n"
"2. Divide the dough into small portions and roll them into thin sheets.\n"
"3. Fold the sheets into layers and roll them again to form a spiral shape.\n"
"4. Heat oil in a pan and deep fry the chiroti until they are golden and crisp.\n"
"5. Make sugar syrup by boiling sugar and water until it reaches a one-string consistency.\n"
"6. Immerse the fried chiroti in the sugar syrup for a few minutes.\n"
"7. Serve the sweet and flaky chiroti."
},

    {
"title": "Coconut Ladoo",
"ingredients": [
"2 cups desiccated coconut",
"1 cup condensed milk",
"1/4 cup milk",
"1/4 tsp cardamom powder",
"A few cashews and raisins for garnish"
],
"recipe": "Coconut Ladoo Recipe:\n"
"1. Heat a pan and add desiccated coconut. Roast it until it's aromatic but not brown.\n"
"2. Add condensed milk and milk. Mix well and cook until the mixture thickens.\n"
"3. Add cardamom powder and mix.\n"
"4. Let it cool slightly and shape it into small ladoos.\n"
"5. Garnish with cashews and raisins.\n"
"6. Let the ladoos cool completely before serving."
},

   {
"title": "Dhondas",
"ingredients": [
"1 cup semolina (rava)",
"1/2 cup grated jaggery",
"1/4 cup grated coconut",
"1/4 cup milk",
"A pinch of cardamom powder",
"A pinch of nutmeg powder",
"1/4 cup ghee",
"1/4 tsp baking soda",
"1/4 cup chopped nuts (cashews, almonds)"
],
"recipe": "Dhondas Recipe:\n"
"1. In a mixing bowl, combine semolina, grated jaggery, grated coconut, and milk.\n"
"2. Mix well and let it rest for about 2 hours to allow the semolina to absorb the liquid.\n"
"3. Add cardamom powder, nutmeg powder, ghee, and baking soda to the mixture.\n"
"4. Mix in the chopped nuts.\n"
"5. Transfer the batter to a greased pan and steam it for about 30-40 minutes until it's cooked.\n"
"6. Let it cool, cut into pieces, and enjoy the dhondas."
},

 
    {
"title": "Double ka Meetha",
"ingredients": [
"4 slices of bread",
"1/2 cup milk",
"1/4 cup condensed milk",
"A pinch of cardamom powder",
"1/4 cup ghee",
"2-3 tbsp sugar",
"A few cashews and raisins"
],
"recipe": "Double ka Meetha Recipe:\n"
"1. Cut the bread slices into triangles or pieces of your choice.\n"
"2. Heat ghee in a pan and fry the bread pieces until they are golden and crisp.\n"
"3. In another pan, heat milk and add condensed milk and sugar.\n"
"4. Let it simmer until it thickens and add cardamom powder.\n"
"5. Pour the milk mixture over the fried bread pieces and let them soak it up.\n"
"6. Garnish with cashews and raisins.\n"
"7. Serve the delicious double ka meetha."
},
   

    {
"title": "Dry Fruits Chikki",
"ingredients": [
"1 cup mixed dry fruits (almonds, cashews, pistachios)",
"1 cup jaggery",
"1/4 cup ghee",
"A pinch of cardamom powder"
],
"recipe": "Dry Fruits Chikki Recipe:\n"
"1. Dry roast the mixed dry fruits until they are crisp and remove the skins.\n"
"2. Crush the dry fruits coarsely.\n"
"3. Heat ghee in a pan and add jaggery. Cook until it melts and forms a one-string consistency.\n"
"4. Add the crushed dry fruits and cardamom powder to the melted jaggery.\n"
"5. Mix quickly and transfer it to a greased plate. Flatten it with a greased rolling pin.\n"
"6. Let it cool, break it into pieces, and enjoy the dry fruits chikki."
},
    {
"title": "Gajar ka Halwa",
"ingredients": [
"2 cups grated carrots",
"2 cups milk",
"1/2 cup sugar",
"1/4 cup ghee",
"A pinch of cardamom powder",
"A few cashews and raisins"
],
"recipe": "Gajar ka Halwa Recipe:\n"
"1. In a heavy-bottomed pan, heat ghee and add grated carrots. Cook until they are soft and aromatic.\n"
"2. Add milk and simmer until the mixture thickens.\n"
"3. Add sugar and cook until it dissolves and the halwa thickens further.\n"
"4. Add cardamom powder and mix well.\n"
"5. Garnish with cashews and raisins.\n"
"6. Serve the warm and delightful gajar ka halwa."
},

    {
"title": "Ghevar",
"ingredients": [
"1 cup all-purpose flour",
"1/4 cup ghee",
"A pinch of cardamom powder",
"A pinch of saffron strands",
"2 cups sugar syrup",
"Ghee for frying",
"A few chopped nuts for garnish"
],
"recipe": "Ghevar Recipe:\n"
"1. In a mixing bowl, combine all-purpose flour and ghee to form a crumbly mixture.\n"
"2. Gradually add water and knead the mixture into a smooth batter.\n"
"3. Heat ghee in a wide, shallow pan with a hole in the center.\n"
"4. Pour the batter through a perforated spoon into the hot ghee, forming a lacy pattern.\n"
"5. Fry until it's crisp and golden.\n"
"6. Soak the ghevar in saffron-infused sugar syrup for a few minutes.\n"
"7. Garnish with chopped nuts and enjoy the delightful ghevar."
},

    {
"title": "Gud Papdi",
"ingredients": [
"1 cup whole wheat flour",
"1/2 cup ghee",
"1/2 cup jaggery",
"A pinch of cardamom powder"
],
"recipe": "Gud Papdi Recipe:\n"
"1. In a heavy-bottomed pan, heat ghee and add whole wheat flour.\n"
"2. Roast the flour until it's golden and aromatic.\n"
"3. Add jaggery and cardamom powder. Mix well.\n"
"4. Transfer the mixture to a greased plate and flatten it.\n"
"5. Let it cool and set before cutting into papdi pieces."
},

    {
"title": "Gudanna",
"ingredients": [
"1 cup broken wheat (dalia)",
"1/2 cup jaggery",
"4 cups milk",
"1/4 cup ghee",
"A pinch of cardamom powder",
"A few chopped nuts"
],
"recipe": "Gudanna Recipe:\n"
"1. Dry roast the broken wheat until it's aromatic and browned.\n"
"2. Heat ghee in a pan and add the roasted broken wheat. Cook for a few minutes.\n"
"3. Add milk and simmer until the broken wheat is soft and cooked.\n"
"4. Add jaggery and cardamom powder. Mix well and cook until the gudanna thickens.\n"
"5. Garnish with chopped nuts and serve the delicious gudanna."
},

    {
"title": "Gujiya",
"ingredients": [
"2 cups all-purpose flour",
"1/4 cup ghee",
"1/2 cup milk",
"For Filling:",
"1 cup khoya (mawa)",
"1/2 cup powdered sugar",
"1/4 cup chopped nuts (almonds, cashews, pistachios)",
"A pinch of cardamom powder",
"Oil for deep frying"
],
"recipe": "Gujiya Recipe:\n"
"1. Prepare a soft dough by combining all-purpose flour, ghee, and milk.\n"
"2. Divide the dough into small portions and roll them into thin rounds.\n"
"3. In a mixing bowl, combine khoya, powdered sugar, chopped nuts, and cardamom powder for the filling.\n"
"4. Place a portion of the filling on one half of the dough round and fold it over to form a half-moon shape.\n"
"5. Seal the edges by pressing or crimping.\n"
"6. Heat oil in a pan and deep fry the gujiyas until they are golden brown.\n"
"7. Drain and let them cool before serving the sweet gujiyas."
},

    {
"title": "Halwa",
"ingredients": [
"1 cup semolina (rava)",
"1/2 cup ghee",
"1 cup sugar",
"2 cups water",
"A pinch of cardamom powder",
"A pinch of saffron strands",
"A few chopped nuts (cashews, almonds)"
],
"recipe": "Halwa Recipe:\n"
"1. In a pan, heat ghee and add semolina. Roast until it's golden and aromatic.\n"
"2. In a separate pot, combine sugar and water to make sugar syrup.\n"
"3. Add the sugar syrup to the roasted semolina while stirring continuously.\n"
"4. Add cardamom powder and saffron strands for flavor.\n"
"5. Cook until the halwa thickens and leaves the sides of the pan.\n"
"6. Garnish with chopped nuts and serve the delightful halwa."
},

   
   
{
"title": "Kaju Anjeer Barfi",
"ingredients": [
"1 cup cashews",
"1/2 cup anjeer (figs)",
"1/2 cup sugar",
"1/4 cup ghee",
"A pinch of cardamom powder",
"A few chopped pistachios for garnish"
],
"recipe": "Kaju Anjeer Barfi Recipe:\n"
"1. Grind cashews and anjeer to a smooth paste separately.\n"
"2. Heat ghee in a pan and add the anjeer paste. Cook until it thickens.\n"
"3. Add the cashew paste and continue to cook.\n"
"4. Add sugar and cardamom powder. Mix well and cook until the mixture leaves the sides of the pan.\n"
"5. Transfer the mixture to a greased plate, garnish with chopped pistachios, and let it cool before cutting into barfi pieces."
},
   
{
"title": "Kaju Katli",
"ingredients": [
"1 cup cashews",
"1/2 cup sugar",
"1/4 cup water",
"A pinch of cardamom powder",
"A few silver leaf (varak) for garnish"
],
"recipe": "Kaju Katli Recipe:\n"
"1. Grind cashews to a fine powder.\n"
"2. Make a sugar syrup by boiling sugar and water until it forms a one-string consistency.\n"
"3. Add the cashew powder and cardamom powder to the sugar syrup. Mix well and cook until it thickens.\n"
"4. Transfer the mixture to a greased plate, press with a flat spatula, and let it cool.\n"
"5. Cut into diamond-shaped pieces and garnish with silver leaf (varak)."
},
   
{
"title": "Kala Jamun",
"ingredients": [
"1 cup milk powder",
"1/4 cup all-purpose flour",
"1/4 cup khoya (mawa)",
"A pinch of baking soda",
"1/4 cup milk",
"A few drops of rose water",
"Ghee for frying",
"For Sugar Syrup:",
"1 cup sugar",
"1/2 cup water",
"A pinch of cardamom powder"
],
"recipe": "Kala Jamun Recipe:\n"
"1. In a mixing bowl, combine milk powder, all-purpose flour, khoya, baking soda, milk, and rose water.\n"
"2. Knead the mixture into a soft dough. If it's too dry, add a little more milk.\n"
"3. Shape the dough into small balls and deep fry them in ghee until they are dark brown (kala).\n"
"4. Make sugar syrup by boiling sugar and water until it forms a one-string consistency. Add cardamom powder.\n"
"5. Soak the fried kala jamun in the sugar syrup for a few hours until they absorb the syrup.\n"
"6. Serve the delicious kala jamun."
},
   
{
"title": "Kalakand",
"ingredients": [
"1 liter milk",
"1/2 cup sugar",
"1/4 cup khoya (mawa)",
"A pinch of cardamom powder",
"A few chopped nuts (almonds, pistachios)"
],
"recipe": "Kalakand Recipe:\n"
"1. Boil the milk in a heavy-bottomed pan and reduce it to half while stirring continuously.\n"
"2. Add sugar and continue to cook until it thickens.\n"
"3. Add khoya and cardamom powder. Mix well and cook until it thickens further.\n"
"4. Transfer the mixture to a greased plate, flatten it, and garnish with chopped nuts.\n"
"5. Let it cool and set before cutting into kalakand pieces."
},
   
{
"title": "Khaja",
"ingredients": [
"2 cups all-purpose flour",
"1/2 cup ghee",
"1/2 cup water",
"For Sugar Syrup:",
"1 cup sugar",
"1/2 cup water",
"A pinch of cardamom powder"
],
"recipe": "Khaja Recipe:\n"
"1. In a mixing bowl, combine all-purpose flour and ghee to form a crumbly mixture.\n"
"2. Gradually add water and knead the mixture into a smooth dough.\n"
"3. Roll out the dough into thin sheets and cut them into diamond-shaped pieces.\n"
"4. Heat oil in a pan and deep fry the dough pieces until they are golden and crisp.\n"
"5. Make sugar syrup by boiling sugar and water until it forms a one-string consistency. Add cardamom powder.\n"
"6. Dip the fried khaja in the sugar syrup for a few seconds and let them cool before serving."
},
   
{
"title": "Kheer",
"ingredients": [
"1/2 cup rice",
"4 cups milk",
"1/2 cup sugar",
"A pinch of cardamom powder",
"A few chopped nuts (cashews, almonds, pistachios)",
"A few saffron strands"
],
"recipe": "Kheer Recipe:\n"
"1. Wash and soak rice for about 30 minutes.\n"
"2. Cook the rice in milk until it's soft and the mixture thickens.\n"
"3. Add sugar and continue to cook until the kheer thickens further.\n"
"4. Add cardamom powder, chopped nuts, and saffron strands. Mix well.\n"
"5. Serve the creamy and delicious kheer."
},

{
"title": "Kheer Kadam",
"ingredients": [
"1/2 cup chhena (paneer)",
"1/2 cup khoya (mawa)",
"1/4 cup sugar",
"1/4 cup milk",
"A pinch of cardamom powder",
"A few chopped nuts (cashews, pistachios)"
],
"recipe": "Kheer Kadam Recipe:\n"
"1. In a mixing bowl, combine chhena and khoya. Knead them together to form a smooth mixture.\n"
"2. Roll the mixture into small balls (kadam) and keep aside.\n"
"3. In a separate saucepan, heat sugar and milk to make a sugar syrup of one-string consistency.\n"
"4. Add cardamom powder to the sugar syrup.\n"
"5. Place the khoya-chhena balls (kadam) in the sugar syrup and let them soak for some time.\n"
"6. Garnish with chopped nuts and serve the delightful kheer kadam."
},
   


 {
"title": "Lavang Latika",
"ingredients": [
"1 cup all-purpose flour",
"2 tbsp ghee",
"1/4 cup sugar",
"A pinch of cardamom powder",
"A few cloves (lavang)"
],
"recipe": "Lavang Latika Recipe:\n"
"1. In a mixing bowl, combine all-purpose flour and ghee to form a crumbly mixture.\n"
"2. Add sugar, cardamom powder, and a little water to make a firm dough.\n"
"3. Roll out the dough into small rectangles and wrap a clove (lavang) in each.\n"
"4. Deep fry the latikas until they are golden brown.\n"
"5. Drain and serve these sweet, clove-studded treats."
},
   
{
"title": "Malpua",
"ingredients": [
"1 cup all-purpose flour",
"1/4 cup semolina (rava)",
"1/2 cup milk",
"1/4 cup sugar",
"A pinch of cardamom powder",
"Ghee for frying",
"For Sugar Syrup:",
"1/2 cup sugar",
"1/2 cup water"
],
"recipe": "Malpua Recipe:\n"
"1. In a mixing bowl, combine all-purpose flour, semolina, milk, sugar, and cardamom powder to make a smooth batter.\n"
"2. Heat ghee in a pan and pour a small portion of the batter to make small pancakes (malpua).\n"
"3. Fry them until they are golden brown on both sides.\n"
"4. Make sugar syrup by boiling sugar and water until it forms a one-string consistency.\n"
"5. Dip the malpua in the sugar syrup for a few seconds and serve."
},
   
{
"title": "Meethi Seviyan",
"ingredients": [
"1 cup vermicelli (seviyan)",
"1/4 cup ghee",
"1/2 cup sugar",
"1 cup milk",
"A pinch of cardamom powder",
"A few raisins and cashews"
],
"recipe": "Meethi Seviyan Recipe:\n"
"1. In a pan, roast the vermicelli in ghee until it's golden brown.\n"
"2. Add sugar and continue to cook until it melts and caramelizes.\n"
"3. Add milk and cook until the seviyan are soft and the mixture thickens.\n"
"4. Add cardamom powder and garnish with raisins and cashews.\n"
"5. Serve the sweet meethi seviyan."
},
   
{
"title": "Modak",
"ingredients": [
"1 cup rice flour",
"1/2 cup jaggery",
"1/2 cup grated coconut",
"1/4 tsp cardamom powder",
"Ghee for greasing"
],
"recipe": "Modak Recipe:\n"
"1. Heat jaggery with a little water to make a syrup and strain it.\n"
"2. In a pan, combine rice flour and grated coconut. Add the jaggery syrup and cardamom powder.\n"
"3. Cook until the mixture leaves the sides of the pan.\n"
"4. Cool the mixture a bit, then shape it into modak (dumplings) while it's still warm.\n"
"5. Grease the modak molds with ghee and press the mixture into the molds.\n"
"6. Remove the modak from the molds when set and serve."
},
   

   
{
"title": "Mysore Pak",
"ingredients": [
"1 cup besan (gram flour)",
"1 cup sugar",
"1/2 cup ghee",
"1/4 cup water"
],
"recipe": "Mysore Pak Recipe:\n"
"1. In a pan, combine sugar and water and make a sugar syrup.\n"
"2. Heat ghee in a separate pan and add besan. Roast it until it's aromatic and changes color.\n"
"3. Add the sugar syrup to the roasted besan and cook, stirring continuously.\n"
"4. The mixture will thicken and start leaving the sides of the pan.\n"
"5. Transfer the mixture to a greased plate, let it set, and cut into pieces."
},
   
{
"title": "Nankhatai",
"ingredients": [
"1 cup all-purpose flour",
"1/2 cup besan (gram flour)",
"1/2 cup ghee",
"1/2 cup powdered sugar",
"1/4 tsp cardamom powder"
],
"recipe": "Nankhatai Recipe:\n"
"1. In a mixing bowl, combine all-purpose flour, besan, ghee, powdered sugar, and cardamom powder.\n"
"2. Knead the mixture into a dough.\n"
"3. Roll the dough into small round cookies and place them on a baking tray.\n"
"4. Bake in a preheated oven at 180°C (350°F) for 15-20 minutes until they are golden brown.\n"
"5. Let the nankhatai cool before serving."
},


 {
"title": "Paniyaram",
"ingredients": [
"2 cups dosa batter",
"1/2 cup finely chopped onions",
"2-3 green chilies, finely chopped",
"1/4 cup grated coconut",
"A few curry leaves",
"1 tsp mustard seeds",
"1 tsp urad dal",
"Oil for frying"
],
"recipe": "Paniyaram Recipe:\n"
"1. Heat oil in a paniyaram pan and add mustard seeds and urad dal. Let them splutter.\n"
"2. Add finely chopped onions, green chilies, and curry leaves. Saute until onions turn translucent.\n"
"3. In a bowl, mix the dosa batter and grated coconut. Add the sauteed mixture and mix well.\n"
"4. Grease the paniyaram pan with oil, pour the batter into the cavities, and cook until they turn golden and crispy.\n"
"5. Serve hot with chutney or sambar."
},

{
"title": "Papad Roll",
"ingredients": [
"Papads (as needed)",
"1/2 cup boiled and mashed potatoes",
"1/4 cup finely chopped onions",
"1/4 cup finely chopped tomatoes",
"1/4 cup grated cheese",
"1/4 cup chopped bell peppers",
"1/4 cup boiled corn",
"1/4 tsp chaat masala",
"1/4 tsp red chili powder",
"Salt to taste"
],
"recipe": "Papad Roll Recipe:\n"
"1. Roast the papads until crisp and set aside.\n"
"2. In a bowl, combine boiled and mashed potatoes, onions, tomatoes, cheese, bell peppers, boiled corn, chaat masala, red chili powder, and salt.\n"
"3. Place a portion of this mixture on each roasted papad and roll it up.\n"
"4. Secure the rolls with toothpicks and serve as a crispy snack."
},

{
"title": "Patishapta",
"ingredients": [
"1 cup rice flour",
"1/2 cup all-purpose flour",
"1 cup milk",
"1/2 cup jaggery",
"1/4 cup grated coconut",
"1/4 tsp cardamom powder",
"Ghee for frying"
],
"recipe": "Patishapta Recipe:\n"
"1. In a mixing bowl, combine rice flour, all-purpose flour, milk, and water to make a smooth batter.\n"
"2. Heat a non-stick pan and pour a ladleful of batter to make a thin pancake.\n"
"3. Cook until it's golden and crispy.\n"
"4. In another pan, heat jaggery with a little water to make a syrup.\n"
"5. Add grated coconut and cardamom powder to the syrup.\n"
"6. Place the coconut-jaggery mixture in the center of the pancake and roll it up.\n"
"7. Serve the delicious patishapta."
},

{
"title": "Peda",
"ingredients": [
"1 cup milk powder",
"1/2 cup condensed milk",
"2 tbsp ghee",
"1/4 tsp cardamom powder",
"A few chopped pistachios or almonds"
],
"recipe": "Peda Recipe:\n"
"1. In a non-stick pan, combine milk powder, condensed milk, and ghee.\n"
"2. Cook on low heat, stirring continuously, until the mixture thickens.\n"
"3. Add cardamom powder and mix well.\n"
"4. Allow the mixture to cool slightly.\n"
"5. Grease your hands with ghee and shape the mixture into small pedas.\n"
"6. Garnish with chopped pistachios or almonds and let them cool completely before serving."
},

{
"title": "Petha",
"ingredients": [
"500g petha (ash gourd)",
"1 cup sugar",
"1/4 cup water",
"A few saffron strands",
"1/2 tsp cardamom powder"
],
"recipe": "Petha Recipe:\n"
"1. Peel and deseed the petha, then cut it into small pieces.\n"
"2. In a pan, make sugar syrup by heating sugar and water until it thickens.\n"
"3. Add petha pieces to the sugar syrup and cook until they become translucent.\n"
"4. Add saffron strands and cardamom powder.\n"
"5. Let it cool and serve the sweet petha."
},



{
"title": "Puran Poli",
"ingredients": [
"1 cup chana dal (split chickpeas)",
"1 cup jaggery",
"1 cup wheat flour",
"A pinch of turmeric powder",
"A pinch of cardamom powder",
"Ghee for frying"
],
"recipe": "Puran Poli Recipe:\n"
"1. Cook chana dal until soft, then drain and mash it.\n"
"2. In a pan, heat jaggery with a little water to make a syrup. Strain it.\n"
"3. Add the mashed chana dal to the jaggery syrup, then add cardamom powder and mix well.\n"
"4. In a separate bowl, make a dough with wheat flour, turmeric powder, and water.\n"
"5. Make small balls of the dough and roll them into small circles.\n"
"6. Place a portion of the chana dal-jaggery mixture in the center and seal the edges.\n"
"7. Roll it out gently and fry with ghee on a griddle until it's golden brown.\n"
"8. Serve the delicious puran poli."
},

{
"title": "Puri Unde",
"ingredients": [
"1 cup powdered jaggery",
"2 cups puffed rice",
"1/4 cup grated coconut",
"A pinch of cardamom powder",
"Ghee for greasing palms"
],
"recipe": "Puri Unde Recipe:\n"
"1. In a mixing bowl, combine powdered jaggery, puffed rice, grated coconut, and cardamom powder.\n"
"2. Grease your palms with ghee and shape the mixture into small ladoos (unde).\n"
"3. Let them cool and enjoy these quick and easy sweet treats."
 },

 {
"title": "Qubani Ka Meetha",
"ingredients": [
"1 cup dried apricots (qubani)",
"1/2 cup sugar",
"1 cup water",
"1/4 cup ghee",
"2-3 cardamom pods",
"A few chopped nuts for garnish"
],
"recipe": "Qubani Ka Meetha Recipe:\n"
"1. Soak dried apricots in water overnight or until they become soft.\n"
"2. Remove the seeds from the apricots and make a smooth paste.\n"
"3. In a pan, heat ghee and add the apricot paste. Cook for a few minutes.\n"
"4. Add sugar, cardamom pods, and water. Simmer until it thickens and the ghee separates.\n"
"5. Garnish with chopped nuts and serve the sweet qubani ka meetha."
},

{
"title": "Rabri",
"ingredients": [
"1 liter full-fat milk",
"1/2 cup sugar",
"1/4 tsp cardamom powder",
"A few saffron strands",
"A few chopped nuts for garnish"
],
"recipe": "Rabri Recipe:\n"
"1. In a heavy-bottomed pan, boil the milk and let it simmer on low heat, stirring occasionally.\n"
"2. Add sugar, cardamom powder, and saffron strands. Continue to cook until it thickens.\n"
"3. Scrape the cream formed on the sides and add it back to the rabri.\n"
"4. Garnish with chopped nuts and serve chilled."
},

{
"title": "Rajbhog",
"ingredients": [
"1 cup paneer (cottage cheese)",
"1/4 cup sugar",
"A few saffron strands",
"A pinch of cardamom powder",
"A few chopped nuts for garnish"
],
"recipe": "Rajbhog Recipe:\n"
"1. In a mixing bowl, crumble the paneer and knead it until smooth.\n"
"2. Add sugar, saffron strands, and cardamom powder. Mix well.\n"
"3. Shape the mixture into round balls.\n"
"4. Garnish with chopped nuts and serve."
},

{
"title": "Ras Malai",
"ingredients": [
"6 rasgullas",
"4 cups milk",
"1/2 cup sugar",
"A pinch of saffron strands",
"A pinch of cardamom powder",
"A few chopped nuts for garnish"
],
"recipe": "Ras Malai Recipe:\n"
"1. Squeeze the sugar syrup from rasgullas and flatten them slightly.\n"
"2. Boil milk with sugar, saffron strands, and cardamom powder.\n"
"3. Add the flattened rasgullas to the milk and simmer until they absorb the flavors.\n"
"4. Garnish with chopped nuts and serve chilled."
},

{
"title": "Rava Kesari",
"ingredients": [
"1 cup semolina (rava)",
"1/2 cup sugar",
"1/4 cup ghee",
"1/4 tsp cardamom powder",
"A few saffron strands",
"A few chopped nuts for garnish"
],
"recipe": "Rava Kesari Recipe:\n"
"1. In a pan, heat ghee and roast semolina until it turns golden and aromatic.\n"
"2. In a separate pan, make sugar syrup with sugar, saffron strands, and cardamom powder.\n"
"3. Add the roasted semolina to the sugar syrup and mix well until it thickens.\n"
"4. Garnish with chopped nuts and serve the sweet rava kesari."
},

{
"title": "Sandesh",
"ingredients": [
"1 cup paneer (cottage cheese)",
"1/4 cup sugar",
"1/4 tsp cardamom powder",
"A few saffron strands",
"A few chopped nuts for garnish"
],
"recipe": "Sandesh Recipe:\n"
"1. Crumble paneer in a mixing bowl.\n"
"2. Add sugar, cardamom powder, and saffron strands. Mix well.\n"
"3. Shape the mixture into small sandesh and garnish with chopped nuts."
},

{
"title": "Sannas",
"ingredients": [
"1 cup rice",
"1/4 cup grated coconut",
"1/4 cup sugar",
"1/4 tsp salt",
"1/2 tsp yeast",
"1/4 cup water"
],
"recipe": "Sannas Recipe:\n"
"1. Soak rice in water for about 4 hours or overnight.\n"
"2. Grind the soaked rice, grated coconut, sugar, and salt to a smooth batter.\n"
"3. Dissolve yeast in warm water and add it to the batter. Mix well.\n"
"4. Ferment the batter for a few hours until it doubles in volume.\n"
"5. Steam the sannas in idli molds for about 15-20 minutes.\n"
"6. Serve the fluffy and slightly sweet sannas."
},

{
"title": "Shahi Tukda",
"ingredients": [
"4 slices of bread",
"2 cups milk",
"1/2 cup sugar",
"1/4 tsp cardamom powder",
"A few saffron strands",
"Ghee for frying",
"A few chopped nuts for garnish"
],
"recipe": "Shahi Tukda Recipe:\n"
"1. Trim the edges of bread slices and cut them into triangles.\n"
"2. Heat ghee in a pan and fry the bread triangles until golden brown.\n"
"3. Boil milk with sugar, cardamom powder, and saffron strands until it thickens.\n"
"4. Arrange the fried bread triangles in a serving dish and pour the thickened milk over them.\n"
"5. Garnish with chopped nuts and serve the royal shahi tukda."
 },

 {
"title": "Shakarpara",
"ingredients": [
"2 cups all-purpose flour",
"1/2 cup semolina (sooji)",
"1/2 cup sugar",
"1/4 cup ghee",
"1/4 tsp cardamom powder",
"A pinch of baking soda",
"Oil for deep frying"
],
"recipe": "Shakarpara Recipe:\n"
"1. In a mixing bowl, combine all-purpose flour, semolina, sugar, ghee, cardamom powder, and baking soda.\n"
"2. Knead the mixture into a stiff dough using water.\n"
"3. Roll out the dough into a thin sheet and cut it into diamond or square shapes.\n"
"4. Heat oil in a pan and deep fry the shakarpara until they are golden and crisp.\n"
"5. Drain and cool before serving."
},


{
"title": "Shrikhand",
"ingredients": [
"2 cups hung curd (strained yogurt)",
"1/2 cup sugar",
"1/4 tsp cardamom powder",
"A few saffron strands",
"A few chopped nuts for garnish"
],
"recipe": "Shrikhand Recipe:\n"
"1. In a mixing bowl, combine hung curd, sugar, and cardamom powder.\n"
"2. Mix well until you get a smooth and creamy consistency.\n"
"3. Add saffron strands and mix.\n"
"4. Garnish with chopped nuts and chill before serving."
},

{
"title": "Shufta",
"ingredients": [
"1 cup mixed nuts (almonds, cashews, walnuts)",
"1/2 cup sugar",
"1/4 cup ghee",
"1/4 tsp cardamom powder",
"A pinch of saffron strands",
"1/4 cup desiccated coconut"
],
"recipe": "Shufta Recipe:\n"
"1. Heat ghee in a pan and roast mixed nuts until they turn golden.\n"
"2. Add sugar and cook until it caramelizes.\n"
"3. Add cardamom powder, saffron strands, and desiccated coconut. Mix well.\n"
"4. Cool and break into pieces before serving."
},

{
"title": "Singuare Atte Ki Barfi",
"ingredients": [
"1 cup water chestnut flour (singhare atta)",
"1/2 cup sugar",
"1/4 cup ghee",
"A pinch of cardamom powder",
"A few chopped nuts for garnish"
],
"recipe": "Singhare Atte Ki Barfi Recipe:\n"
"1. In a pan, heat ghee and roast water chestnut flour until it turns aromatic.\n"
"2. Add sugar and cardamom powder. Mix well and cook until it thickens.\n"
"3. Transfer to a greased plate, garnish with chopped nuts, and let it cool before cutting into barfi."
},

{
"title": "Sohan Papdi",
"ingredients": [
"1 cup besan (gram flour)",
"1 cup sugar",
"1/2 cup ghee",
"A pinch of cardamom powder",
"A few chopped nuts for garnish"
],
"recipe": "Sohan Papdi Recipe:\n"
"1. Heat ghee in a pan and add besan. Roast until it turns golden and aromatic.\n"
"2. Add sugar and cardamom powder. Mix well and quickly transfer to a greased plate.\n"
"3. Flatten it, garnish with chopped nuts, and let it cool before breaking into pieces."
},

{
"title": "Sutarfeni",
"ingredients": [
"1 cup fine vermicelli",
"1/2 cup ghee",
"1/2 cup sugar",
"A pinch of cardamom powder",
"A few saffron strands",
"A few chopped nuts for garnish"
],
"recipe": "Sutarfeni Recipe:\n"
"1. Heat ghee in a pan and roast fine vermicelli until it turns golden.\n"
"2. In a separate pan, make sugar syrup with sugar, cardamom powder, and saffron strands.\n"
"3. Add the roasted vermicelli to the sugar syrup and mix well.\n"
"4. Garnish with chopped nuts and serve the delicate sutarfeni."
}  

   
   
]

col1, col2 = st.columns(2)
my_upload = st.sidebar.file_uploader("Upload an image", type=["png", "jpg", "jpeg"])

st.write()
st.markdown("""---""")
st.write()

if my_upload is not None:
    st.image(my_upload, caption="Uploaded Image", use_column_width=True)

    if st.sidebar.button("Classify"):
        st.sidebar.text("Classifying...")

        image = Image.open(my_upload)

        try:
            classification_result = image_classifier(image)
            top_prediction = classification_result[0]
            label = top_prediction['label']
            #score = top_prediction['score']
            st.sidebar.text("Top Prediction:")
            # st.sidebar.text(f"Label: {label}, Score: {score:.3f}")
            st.sidebar.text(f"Label: {label}")
        except Exception as e:
            st.error(f"Error during classification: {str(e)}")

    if my_upload.size > MAX_FILE_SIZE:
        st.error("The uploaded file is too large. Please upload an image smaller than 5MB.")
    else:
        fix_image(upload=my_upload)
else:
    fix_image("jalebi.jpg")
   
# Recipe generation based on selected item
st.write("## Recipe Generation")

selected_item = st.selectbox("Select a food item", [entry["title"] for entry in dataset])
if st.button("Generate Recipe"):
    matching_entries = [entry for entry in dataset if entry["title"] == selected_item]

    if matching_entries:
        selected_entry = random.choice(matching_entries)
        title = selected_entry["title"]
        ingredients = selected_entry["ingredients"]
        recipe = selected_entry["recipe"]
    else:
        title = "Default Recipe Title"
        ingredients = []
        recipe = "No recipe found for this item."

    st.write(f"Generated Recipe for {title}:\n")
    st.write(f"Ingredients: {', '.join(ingredients)}")
    st.write(f"Instructions: {recipe}")

    # Generate and display the recipe summary
    st.write("Recipe Summary:")
    recipe_summary = generate_summary(recipe)
    st.write(recipe_summary)

# Add some descriptions and instructions
st.sidebar.markdown("### Instructions")
st.sidebar.markdown("1. Upload an image.")
st.sidebar.markdown("2. Click the 'Classify' button to get the classification results.")
st.sidebar.markdown("3. Select a food item to generate a recipe.")
st.sidebar.markdown("4. Click the 'Generate Recipe' button to get the recipe.")

# Display a placeholder for the main content
st.write("Please upload an image and use the sidebar to classify it and generate a recipe.")