Upload 2 files
Browse filesFiles changed (2)
- README.md+516-1
- food500.pyAdded+102
123---license: unknown---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518---license: unknowntask_categories:- image-classificationlanguage:- enpretty_name: Food-500size_categories:- 100K<n<1Mdataset_info:features:- name: imagedtype: image- name: labeldtype:class_label:names:'0': Abalone'1': Aburaage'2': Æbleflæsk'3': Agedashi_tofu'4': Aligot'5': Almond_biscuit'6': Aloo_gobi'7': Ambrosia_(fruit_salad)'8': Anago'9': Andong_jjimdak'10': Ants_climbing_a_tree'11': Anzac_biscuit'12': Apple_cobbler'13': Apple_crisp'14': Apple_dumpling'15': Apple_pie'16': Apple_sauce'17': Apple_strudel'18': Applesauce_cake'19': Arab_salad'20': Arancini'21': Arròs_negre'22': Asam_pedas'23': Avocado_bread'24': Avocado_fries'25': Avocado_key_lime_pie'26': Avocado_sauce'27': Avocado_toast'28': Ayam_bakar'29': Ayam_betutu'30': Ayam_goreng'31': Babi_panggang'32': Bacon_and_eggs'33': Bacon_egg_and_cheese_sandwich'34': Bacon_explosion'35': Bacon_sandwich'36': Baingan_bharta'37': Baked_beans'38': Banana_bread'39': Banana_pancakes'40': Banana_pudding'41': Banana_salad'42': Banana_split'43': Bandeja_paisa'44': Bangers_and_mash'45': Banh_bo'46': Bánh_canh'47': Bánh_chuối'48': Bean_pie'49': Bean_salad'50': Beef_bun'51': Beef_chow_fun'52': Beef_noodle_soup'53': Beef_Wellington'54': Beignet'55': Bibimbap'56': Bibingka'57': Biryani'58': Bisque_food'59': Bistek'60': Black_Forest_gateau'61': Black_pepper_crab'62': Blackberry_pie'63': Blancmange'64': BLT_sandwich'65': Blueberry_pie'66': Boiled_beef'67': Boiled_peanuts'68': Bon_bon_chicken'69': Borscht'70': Botan-ebi'71': Botifarra'72': Bouillabaisse'73': Bourbon_chicken'74': Bread_roll'75': Broccoli_slaw'76': Brown_stew_chicken'77': Bruschetta'78': Bubur_ayam'79': Bubur_kacang_hijau'80': Bugnes'81': Bun_bo_hue'82': Bún_ốc'83': Bún_riêu'84': Burrito'85': Butadon'86': Butter_cake'87': Butter_pecan'88': Butter_pie'89': Buttercream'90': Buttery_bread'91': Cabbage_soup'92': Caesar_salad'93': Café_liégeois'94': Calamari'95': Caldo_verde'96': Caprese_salad'97': Carpaccio'98': Carrot_bread'99': Carrot_cake'100': Carrot_cake_cookie'101': Carrot_chips'102': Carrot_juice'103': Carrot_salad'104': Carrot_soup'105': Cassoulet'106': Cebolada'107': Ceviche'108': Chakli'109': Champurrado'110': Char_kway_teow'111': Charqui'112': Chazuke'113': Cheese_and_tomato_sandwich'114': Cheese_bun'115': Cheese_fries'116': Cheese_maki'117': Cheese_pudding'118': Cheese_roll'119': Cheesecake'120': Cherry_cake'121': Cherry_ice_cream'122': Cherry_pie'123': Chicken_and_waffles'124': Chicken_cacciatore'125': Chicken_curry'126': Chicken_fingers'127': Chicken_Kiev'128': Chicken_marsala'129': Chicken_noodle_soup'130': Chicken_nugget'131': Chicken_parmigiana'132': Chicken_salad'133': Chicken_soup'134': Chiles_en_nogada'135': Chili_con_carne'136': Chilli_crab'137': Chinese_chicken_salad'138': Chocolate_covered_strawberries'139': Chocolate_marshmallow_pie'140': Chow_mein'141': Chowder'142': Christmas_cake'143': Churro'144': Ciambelle'145': Çiğ_köfte'146': Clam_chowder'147': Claypot_chicken_rice'148': Club_sandwich'149': Cobbler_food'150': Coconut_cake'151': Coconut_cream'152': Coconut_shrimp'153': Coda_alla_vaccinara'154': Coffee_jelly'155': Colcannon'156': Coleslaw'157': Congee'158': Corn_chip'159': Corn_crab_soup'160': Corn_dog'161': Corn_soup'162': Corn_stew'163': Corn_tortilla'164': Corned_beef_sandwich'165': Cotoletta'166': Crab_cake'167': Crab_dip'168': Crab_in_Padang_sauce'169': Crab_puff'170': Crab_rangoon'171': Cream_of_broccoli_soup'172': Cream_of_mushroom_soup'173': Cream_pie'174': Creamed_eggs_on_toast'175': Croissant'176': Crudo'177': Crumble'178': Cucumber_soup'179': Cured_salmon'180': Curry_goat'181': Curry_Mee'182': Curry_rice'183': Currywurst'184': Dandan_noodles'185': Deep-fried_peanuts'186': Denver_omelette'187': Denver_sandwich'188': Dhokla'189': Di_san_xian'190': Dinuguan'191': Dirty_Rice'192': Dong'an_chicken'193': Doufunao'194': Doughnut'195': Drunken_chicken'196': Drunken_shrimp'197': Duck_soup_noodles'198': Edamame'199': Eggplant_omelette'200': Eisbein'201': Es_campur'202': Es_pisang_ijo'203': Filet_mignon'204': Fish_ball'205': Fish_chowder'206': Fish_head_casserole'207': Fish_head_curry'208': Fish_soup'209': Fish_steak'210': Fishcake'211': Fondue'212': Francesinha'213': Frappe'214': French_onion_soup'215': French_toast'216': Fricassee'217': Fried_aubergine'218': Fried_cheese'219': Fried_chicken'220': Fried_noodles'221': Fried_onion'222': Fried_rice'223': Fried_Tofu'224': Fruit_curd'225': Fuqi_feipian'226': Galbi'227': Garlic_bread'228': Gejang'229': Ginger_beef'230': Gołąbki'231': Goulash'232': Gravlax'233': Greek_salad'234': Green_bean_casserole'235': Green_papaya_salad'236': Grits'237': Gulai_Ayam'238': Gyutan'239': Hae_mee'240': Hainanese_chicken_rice'241': Ham_and_cheese_sandwich'242': Ham_salad'243': Ham_sandwich'244': hamburgers'245': Har_gow'246': Hiyayakko'247': Hokkien_mee'248': Hongshao_rou'249': Hoppin'_John'250': Hot_and_sour_soup'251': Huangqiao_sesame_cake'252': Huevos_rancheros'253': Hummus'254': Ikan_bakar'255': Ikan_goreng'256': Israeli_salad'257': Italian_tomato_pie'258': Jajangmyeon'259': Jambalaya'260': Jambonneau'261': Japchae'262': Jewish_apple_cake'263': Jiuniang'264': Kachori'265': Kadhi'266': Kakuni'267': Katsudon'268': kebab'269': Kedgeree'270': Key_lime_pie'271': Konnyaku'272': Korean_fried_chicken'273': Kung_Pao_chicken'274': Kwetiau_goreng'275': Laddu'276': Laksa'277': Lamb_chop'278': Lasagna'279': Lebkuchen'280': Leek_soup'281': Lemon_chicken'282': Lemon_ice_box_pie'283': Lemon_meringue_pie'284': Lemon_tart'285': Lemonade'286': Lentil_soup'287': Lettuce_soup'288': Lo_mein'289': Lobster_bisque'290': Lohikeitto'291': Macaron'292': Mango_pomelo_sago'293': Mango_pudding'294': Mapo_doufu'295': Meatloaf'296': Mee_pok'297': Mee_siam'298': Melt_sandwich'299': Menudo'300': Mì_Quảng'301': Michigan_hot_dog'302': Mie_goreng'303': Milk_Shake'304': Minestrone'305': Mirchi_ka_salan'306': Mission_burrito'307': Mongolian_beef'308': Mousse'309': Mozzarella_sticks'310': Mushroom_gravy'311': Mushy_peas'312': Mutton_handi'313': Mutton_korma'314': Nachos'315': Naengmyeon'316': Nasi_goreng'317': Nasi_kuning'318': Nasi_liwet'319': Nattō'320': Noodle_soup'321': Nuomici'322': Okinawa_soba'323': Olivier_salad'324': Onigiri'325': Onion_ring'326': Orange_chicken'327': Oyster_omelette'328': Oysters_Rockefeller'329': Pączki'330': Paella'331': Pakora'332': Panzanella'333': Pappa_al_pomodoro'334': Parmigiana'335': Pasta'336': Pasta_al_pomodoro'337': Pasta_alla_Norma'338': Pasteis_de_Bacalhau'339': Paupiette'340': Payasam'341': Pea_soup'342': Peanut_butter_cookie'343': Peanut_soup'344': Pho'345': Pickled_cucumber'346': Pig's_ear'347': Pig's_organ_soup'348': Pig's_trotters'349': Pineapple_tart'350': Pipikaula'351': Pizza_carbonara'352': Pizza_pugliese'353': Plateau_de_fruits_de_mer'354': Plum_cake'355': Pommes_dauphine'356': Poori'357': Porchetta'358': Pork_ball'359': Pork_blood_soup'360': Pork_knuckle'361': Pork_Knuckles_and_Ginger_Stew'362': Pork_ribs'363': Pork_tenderloin'364': Pork_tenderloin_sandwich'365': Pot_roast'366': Potato_salad'367': Poutine'368': Prawn_cocktail'369': Prawn_soup'370': Princess_cake'371': Profiterole'372': Pudding_corn'373': Pulled_pork'374': Pumpkin_bread'375': Pumpkin_pie'376': Quesadilla'377': Queso_flameado'378': Quiche_Lorraine'379': Rack_of_lamb'380': Raita'381': Ramen'382': Red_bean_cake'383': Red_bean_ice'384': Red_beans_and_rice'385': Red_slaw'386': Refried_beans'387': Rendang'388': Rice_and_peas'389': Rice_ball'390': Rice_cakes'391': Rice_pudding'392': Rogan_josh'393': Rou_jia_mo'394': Rouladen'395': Salmon_pie'396': Sambar'397': Samgyetang'398': Samosa'399': Sapo_tahu'400': Sardine'401': Sashimi'402': Sauerbraten'403': Sausage_and_peppers'404': Sausage_bun'405': Sausage_roll'406': Sausage_sandwich'407': Sauteed_mushrooms'408': Scampi'409': Schweinshaxe'410': Seafood_boil'411': Seafood_pizza'412': Sesame_chicken'413': Shaker_Lemon_Pie'414': Shanghai_fried_noodles'415': She-crab_soup'416': Sheep's_trotters'417': Shrimp_ball'418': Shrimp_toast'419': Shuizhu'420': Sicilian_orange_salad'421': Sliced_fish_soup'422': Smoked_salmon'423': Soba'424': Soft-shell_crab'425': Sopa_de_Mandioca'426': Soused_herring'427': Spanish_rice'428': Spatzle'429': Spiced_beef'430': Spinach_salad'431': Spinach_soup'432': Squash_soup'433': Steak_tartare'434': Steamed_clams'435': Steamed_meatball'436': Steamed_rice'437': Stew_peas'438': Stinky_tofu'439': Stir-fried_tomato_and_scrambled_eggs'440': Strawberry_cake'441': Strawberry_cheesecake'442': Strawberry_ice_cream'443': Strawberry_jam'444': Strawberry_pie'445': Strawberry_sundae'446': Strawberry_tart'447': Stuffed_avocado'448': Stuffed_eggplant'449': Stuffed_mushrooms'450': Stuffed_peppers'451': Stuffed_tomatoes'452': Suanmeitang'453': Succotash'454': Suckling_pig'455': Svíčková'456': Sweet_potato_pie'457': Sweet_saffron_rice'458': Syrniki'459': Tabbouleh'460': Tacos'461': Tafelspitz'462': Takoyaki'463': Taro_dumpling'464': Tinga_dish'465': Tiramisu'466': Toad_in_the_hole'467': Tobiko'468': Tomato_and_egg_soup'469': Tomato_bredie'470': Tomato_omelette'471': Tomato_soup'472': Tonkatsu'473': Tonkotsu_ramen'474': Torta_caprese'475': Tostada'476': Tourtière'477': Tsukemono'478': Tuna_fish_sandwich'479': Tuna_salad'480': Turnip_cake'481': Twix'482': Unagi'483': Vegetarian_chili'484': Vichyssoise'485': Vindaloo'486': Vitello_tonnato'487': Wakame'488': Wenchang_chicken'489': White_boiled_shrimp'490': White_cut_chicken'491': Whitebait'492': Wonton_noodles'493': Wotou'494': Yeung_Chow_fried_rice'495': Youtiao'496': Yuxiangrousi'497': Zhajiangmian'498': Zongzi'499': Zurcher_Geschnetzeltes---
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102# coding=utf-8# Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License."""Dataset class for ISIA Food-500 dataset."""
import datasetsfrom datasets.tasks import ImageClassification
_BASE_URL = "http://123.57.42.89/Dataset_ict/ISIA_Food500_Dir/dataset/ISIA_Food500.zip"
_METADATA_URL = "http://123.57.42.89/Dataset_ict/ISIA_Food500_Dir/dataset/metadata_ISIAFood_500.zip"
_HOMEPAGE = "http://123.57.42.89/FoodComputing-Dataset/ISIA-Food500.html"
_DESCRIPTION = "ABCDescription"
_CITATION = "ABCCitation"
_LICENSE = "ABCLicense"
_NAMES = ['Abalone', 'Aburaage', 'Æbleflæsk', 'Agedashi_tofu', 'Aligot', 'Almond_biscuit', 'Aloo_gobi', 'Ambrosia_(fruit_salad)', 'Anago', 'Andong_jjimdak', 'Ants_climbing_a_tree', 'Anzac_biscuit', 'Apple_cobbler', 'Apple_crisp', 'Apple_dumpling', 'Apple_pie', 'Apple_sauce', 'Apple_strudel', 'Applesauce_cake', 'Arab_salad', 'Arancini', 'Arròs_negre', 'Asam_pedas', 'Avocado_bread', 'Avocado_fries', 'Avocado_key_lime_pie', 'Avocado_sauce', 'Avocado_toast', 'Ayam_bakar', 'Ayam_betutu', 'Ayam_goreng', 'Babi_panggang', 'Bacon_and_eggs', 'Bacon_egg_and_cheese_sandwich', 'Bacon_explosion', 'Bacon_sandwich', 'Baingan_bharta', 'Baked_beans', 'Banana_bread', 'Banana_pancakes', 'Banana_pudding', 'Banana_salad', 'Banana_split', 'Bandeja_paisa', 'Bangers_and_mash', 'Banh_bo', 'Bánh_canh', 'Bánh_chuối', 'Bean_pie', 'Bean_salad', 'Beef_bun', 'Beef_chow_fun', 'Beef_noodle_soup', 'Beef_Wellington', 'Beignet', 'Bibimbap', 'Bibingka', 'Biryani', 'Bisque_food', 'Bistek', 'Black_Forest_gateau', 'Black_pepper_crab', 'Blackberry_pie', 'Blancmange', 'BLT_sandwich', 'Blueberry_pie', 'Boiled_beef', 'Boiled_peanuts', 'Bon_bon_chicken', 'Borscht', 'Botan-ebi', 'Botifarra', 'Bouillabaisse', 'Bourbon_chicken', 'Bread_roll', 'Broccoli_slaw', 'Brown_stew_chicken', 'Bruschetta', 'Bubur_ayam', 'Bubur_kacang_hijau', 'Bugnes', 'Bun_bo_hue', 'Bún_ốc', 'Bún_riêu', 'Burrito', 'Butadon', 'Butter_cake', 'Butter_pecan', 'Butter_pie', 'Buttercream', 'Buttery_bread', 'Cabbage_soup', 'Caesar_salad', 'Café_liégeois', 'Calamari', 'Caldo_verde', 'Caprese_salad', 'Carpaccio', 'Carrot_bread', 'Carrot_cake', 'Carrot_cake_cookie', 'Carrot_chips', 'Carrot_juice', 'Carrot_salad', 'Carrot_soup', 'Cassoulet', 'Cebolada', 'Ceviche', 'Chakli', 'Champurrado', 'Char_kway_teow', 'Charqui', 'Chazuke', 'Cheese_and_tomato_sandwich', 'Cheese_bun', 'Cheese_fries', 'Cheese_maki', 'Cheese_pudding', 'Cheese_roll', 'Cheesecake', 'Cherry_cake', 'Cherry_ice_cream', 'Cherry_pie', 'Chicken_and_waffles', 'Chicken_cacciatore', 'Chicken_curry', 'Chicken_fingers', 'Chicken_Kiev', 'Chicken_marsala', 'Chicken_noodle_soup', 'Chicken_nugget', 'Chicken_parmigiana', 'Chicken_salad', 'Chicken_soup', 'Chiles_en_nogada', 'Chili_con_carne', 'Chilli_crab', 'Chinese_chicken_salad', 'Chocolate_covered_strawberries', 'Chocolate_marshmallow_pie', 'Chow_mein', 'Chowder', 'Christmas_cake', 'Churro', 'Ciambelle', 'Çiğ_köfte', 'Clam_chowder', 'Claypot_chicken_rice', 'Club_sandwich', 'Cobbler_food', 'Coconut_cake', 'Coconut_cream', 'Coconut_shrimp', 'Coda_alla_vaccinara', 'Coffee_jelly', 'Colcannon', 'Coleslaw', 'Congee', 'Corn_chip', 'Corn_crab_soup', 'Corn_dog', 'Corn_soup', 'Corn_stew', 'Corn_tortilla', 'Corned_beef_sandwich', 'Cotoletta', 'Crab_cake', 'Crab_dip', 'Crab_in_Padang_sauce', 'Crab_puff', 'Crab_rangoon', 'Cream_of_broccoli_soup', 'Cream_of_mushroom_soup', 'Cream_pie', 'Creamed_eggs_on_toast', 'Croissant', 'Crudo', 'Crumble', 'Cucumber_soup', 'Cured_salmon', 'Curry_goat', 'Curry_Mee', 'Curry_rice', 'Currywurst', 'Dandan_noodles', 'Deep-fried_peanuts', 'Denver_omelette', 'Denver_sandwich', 'Dhokla', 'Di_san_xian', 'Dinuguan', 'Dirty_Rice', "Dong'an_chicken", 'Doufunao', 'Doughnut', 'Drunken_chicken', 'Drunken_shrimp', 'Duck_soup_noodles', 'Edamame', 'Eggplant_omelette', 'Eisbein', 'Es_campur', 'Es_pisang_ijo', 'Filet_mignon', 'Fish_ball', 'Fish_chowder', 'Fish_head_casserole', 'Fish_head_curry', 'Fish_soup', 'Fish_steak', 'Fishcake', 'Fondue', 'Francesinha', 'Frappe', 'French_onion_soup', 'French_toast', 'Fricassee', 'Fried_aubergine', 'Fried_cheese', 'Fried_chicken', 'Fried_noodles', 'Fried_onion', 'Fried_rice', 'Fried_Tofu', 'Fruit_curd', 'Fuqi_feipian', 'Galbi', 'Garlic_bread', 'Gejang', 'Ginger_beef', 'Gołąbki', 'Goulash', 'Gravlax', 'Greek_salad', 'Green_bean_casserole', 'Green_papaya_salad', 'Grits', 'Gulai_Ayam', 'Gyutan', 'Hae_mee', 'Hainanese_chicken_rice', 'Ham_and_cheese_sandwich', 'Ham_salad', 'Ham_sandwich', 'hamburgers', 'Har_gow', 'Hiyayakko', 'Hokkien_mee', 'Hongshao_rou', "Hoppin'_John", 'Hot_and_sour_soup', 'Huangqiao_sesame_cake', 'Huevos_rancheros', 'Hummus', 'Ikan_bakar', 'Ikan_goreng', 'Israeli_salad', 'Italian_tomato_pie', 'Jajangmyeon', 'Jambalaya', 'Jambonneau', 'Japchae', 'Jewish_apple_cake', 'Jiuniang', 'Kachori', 'Kadhi', 'Kakuni', 'Katsudon', 'kebab', 'Kedgeree', 'Key_lime_pie', 'Konnyaku', 'Korean_fried_chicken', 'Kung_Pao_chicken', 'Kwetiau_goreng', 'Laddu', 'Laksa', 'Lamb_chop', 'Lasagna', 'Lebkuchen', 'Leek_soup', 'Lemon_chicken', 'Lemon_ice_box_pie', 'Lemon_meringue_pie', 'Lemon_tart', 'Lemonade', 'Lentil_soup', 'Lettuce_soup', 'Lo_mein', 'Lobster_bisque', 'Lohikeitto', 'Macaron', 'Mango_pomelo_sago', 'Mango_pudding', 'Mapo_doufu', 'Meatloaf', 'Mee_pok', 'Mee_siam', 'Melt_sandwich', 'Menudo', 'Mì_Quảng', 'Michigan_hot_dog', 'Mie_goreng', 'Milk_Shake', 'Minestrone', 'Mirchi_ka_salan', 'Mission_burrito', 'Mongolian_beef', 'Mousse', 'Mozzarella_sticks', 'Mushroom_gravy', 'Mushy_peas', 'Mutton_handi', 'Mutton_korma', 'Nachos', 'Naengmyeon', 'Nasi_goreng', 'Nasi_kuning', 'Nasi_liwet', 'Nattō', 'Noodle_soup', 'Nuomici', 'Okinawa_soba', 'Olivier_salad', 'Onigiri', 'Onion_ring', 'Orange_chicken', 'Oyster_omelette', 'Oysters_Rockefeller', 'Pączki', 'Paella', 'Pakora', 'Panzanella', 'Pappa_al_pomodoro', 'Parmigiana', 'Pasta', 'Pasta_al_pomodoro', 'Pasta_alla_Norma', 'Pasteis_de_Bacalhau', 'Paupiette', 'Payasam', 'Pea_soup', 'Peanut_butter_cookie', 'Peanut_soup', 'Pho', 'Pickled_cucumber', "Pig's_ear", "Pig's_organ_soup", "Pig's_trotters", 'Pineapple_tart', 'Pipikaula', 'Pizza_carbonara', 'Pizza_pugliese', 'Plateau_de_fruits_de_mer', 'Plum_cake', 'Pommes_dauphine', 'Poori', 'Porchetta', 'Pork_ball', 'Pork_blood_soup', 'Pork_knuckle', 'Pork_Knuckles_and_Ginger_Stew', 'Pork_ribs', 'Pork_tenderloin', 'Pork_tenderloin_sandwich', 'Pot_roast', 'Potato_salad', 'Poutine', 'Prawn_cocktail', 'Prawn_soup', 'Princess_cake', 'Profiterole', 'Pudding_corn', 'Pulled_pork', 'Pumpkin_bread', 'Pumpkin_pie', 'Quesadilla', 'Queso_flameado', 'Quiche_Lorraine', 'Rack_of_lamb', 'Raita', 'Ramen', 'Red_bean_cake', 'Red_bean_ice', 'Red_beans_and_rice', 'Red_slaw', 'Refried_beans', 'Rendang', 'Rice_and_peas', 'Rice_ball', 'Rice_cakes', 'Rice_pudding', 'Rogan_josh', 'Rou_jia_mo', 'Rouladen', 'Salmon_pie', 'Sambar', 'Samgyetang', 'Samosa', 'Sapo_tahu', 'Sardine', 'Sashimi', 'Sauerbraten', 'Sausage_and_peppers', 'Sausage_bun', 'Sausage_roll', 'Sausage_sandwich', 'Sauteed_mushrooms', 'Scampi', 'Schweinshaxe', 'Seafood_boil', 'Seafood_pizza', 'Sesame_chicken', 'Shaker_Lemon_Pie', 'Shanghai_fried_noodles', 'She-crab_soup', "Sheep's_trotters", 'Shrimp_ball', 'Shrimp_toast', 'Shuizhu', 'Sicilian_orange_salad', 'Sliced_fish_soup', 'Smoked_salmon', 'Soba', 'Soft-shell_crab', 'Sopa_de_Mandioca', 'Soused_herring', 'Spanish_rice', 'Spatzle', 'Spiced_beef', 'Spinach_salad', 'Spinach_soup', 'Squash_soup', 'Steak_tartare', 'Steamed_clams', 'Steamed_meatball', 'Steamed_rice', 'Stew_peas', 'Stinky_tofu', 'Stir-fried_tomato_and_scrambled_eggs', 'Strawberry_cake', 'Strawberry_cheesecake', 'Strawberry_ice_cream', 'Strawberry_jam', 'Strawberry_pie', 'Strawberry_sundae', 'Strawberry_tart', 'Stuffed_avocado', 'Stuffed_eggplant', 'Stuffed_mushrooms', 'Stuffed_peppers', 'Stuffed_tomatoes', 'Suanmeitang', 'Succotash', 'Suckling_pig', 'Svíčková', 'Sweet_potato_pie', 'Sweet_saffron_rice', 'Syrniki', 'Tabbouleh', 'Tacos', 'Tafelspitz', 'Takoyaki', 'Taro_dumpling', 'Tinga_dish', 'Tiramisu', 'Toad_in_the_hole', 'Tobiko', 'Tomato_and_egg_soup', 'Tomato_bredie', 'Tomato_omelette', 'Tomato_soup', 'Tonkatsu', 'Tonkotsu_ramen', 'Torta_caprese', 'Tostada', 'Tourtière', 'Tsukemono', 'Tuna_fish_sandwich', 'Tuna_salad', 'Turnip_cake', 'Twix', 'Unagi', 'Vegetarian_chili', 'Vichyssoise', 'Vindaloo', 'Vitello_tonnato', 'Wakame', 'Wenchang_chicken', 'White_boiled_shrimp', 'White_cut_chicken', 'Whitebait', 'Wonton_noodles', 'Wotou', 'Yeung_Chow_fried_rice', 'Youtiao', 'Yuxiangrousi', 'Zhajiangmian', 'Zongzi', 'Zurcher_Geschnetzeltes']
_IMAGES_DIR = "ISIA_Food500/images"
_TRAIN_DIR = "train_feature.txt"
_VALID_DIR = "val_feature.txt"
_TEST_DIR = "test_feature.txt"
class Food500(datasets.GeneratorBasedBuilder): """Food-500 Images dataset."""
def _info(self):
return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features( { "image": datasets.Image(), "label": datasets.ClassLabel(names=_NAMES), } ), supervised_keys=("image", "label"), homepage=_HOMEPAGE, citation=_CITATION, license=_LICENSE, task_templates=[ImageClassification(image_column="image", label_column="label")], )
def _split_generators(self, dl_manager): archive_path = dl_manager.download(_BASE_URL) split_metadata_path = dl_manager.download_and_extract(_METADATA_URL) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={ "images": dl_manager.iter_archive(archive_path), "metadata_path": split_metadata_path + _TRAIN_DIR, }, ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, gen_kwargs={ "images": dl_manager.iter_archive(archive_path), "metadata_path": split_metadata_path + _VALID_DIR, }, ), datasets.SplitGenerator( name=datasets.Split.TEST, gen_kwargs={ "images": dl_manager.iter_archive(archive_path), "metadata_path": split_metadata_path + _TEST_DIR, }, ), ]
def _generate_examples(self, images, metadata_path): """Generate images and labels for splits.""" with open(metadata_path, encoding="utf-8") as f: files_to_keep = set(f.read().split("\n")) for file_path, file_obj in images: if file_path.startswith(_IMAGES_DIR): if file_path[len(_IMAGES_DIR) : -len(".jpg")] in files_to_keep: label = file_path.split("/")[2] yield file_path, { "image": {"path": file_path, "bytes": file_obj.read()}, "label": label, }README.md+516-1
food500.pyAdded+102