Spaces:
Sleeping
Sleeping
File size: 21,478 Bytes
b3ec98a |
1 |
{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.7.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n for filename in filenames:\n print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-03-25T09:19:52.795659Z","iopub.execute_input":"2023-03-25T09:19:52.796151Z","iopub.status.idle":"2023-03-25T09:19:52.808798Z","shell.execute_reply.started":"2023-03-25T09:19:52.796108Z","shell.execute_reply":"2023-03-25T09:19:52.807537Z"},"trusted":true},"execution_count":43,"outputs":[]},{"cell_type":"code","source":"#https://www.analyticsvidhya.com/blog/2022/06/building-a-food-image-classifier-using-fastai/\n","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:52.814318Z","iopub.execute_input":"2023-03-25T09:19:52.815228Z","iopub.status.idle":"2023-03-25T09:19:52.820178Z","shell.execute_reply.started":"2023-03-25T09:19:52.815181Z","shell.execute_reply":"2023-03-25T09:19:52.819104Z"},"trusted":true},"execution_count":44,"outputs":[]},{"cell_type":"code","source":"#!pip install -Uqq fastai","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:52.829410Z","iopub.execute_input":"2023-03-25T09:19:52.829743Z","iopub.status.idle":"2023-03-25T09:19:52.834222Z","shell.execute_reply.started":"2023-03-25T09:19:52.829710Z","shell.execute_reply":"2023-03-25T09:19:52.833071Z"},"trusted":true},"execution_count":45,"outputs":[]},{"cell_type":"code","source":"#https://www.analyticsvidhya.com/blog/2022/06/building-a-food-image-classifier-using-fastai/","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:52.841721Z","iopub.execute_input":"2023-03-25T09:19:52.842214Z","iopub.status.idle":"2023-03-25T09:19:52.846989Z","shell.execute_reply.started":"2023-03-25T09:19:52.842178Z","shell.execute_reply":"2023-03-25T09:19:52.845762Z"},"trusted":true},"execution_count":46,"outputs":[]},{"cell_type":"code","source":"from fastai.vision.all import *\nfrom fastai import *\nfrom fastai.learner import load_learner\n","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:52.858270Z","iopub.execute_input":"2023-03-25T09:19:52.858598Z","iopub.status.idle":"2023-03-25T09:19:52.864491Z","shell.execute_reply.started":"2023-03-25T09:19:52.858564Z","shell.execute_reply":"2023-03-25T09:19:52.863250Z"},"trusted":true},"execution_count":47,"outputs":[]},{"cell_type":"code","source":"foodPath = untar_data(URLs.FOOD) #untar_data(URLs.FOOD)","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:52.879187Z","iopub.execute_input":"2023-03-25T09:19:52.879547Z","iopub.status.idle":"2023-03-25T09:19:52.885181Z","shell.execute_reply.started":"2023-03-25T09:19:52.879512Z","shell.execute_reply":"2023-03-25T09:19:52.884101Z"},"trusted":true},"execution_count":48,"outputs":[]},{"cell_type":"code","source":"len(get_image_files(foodPath))","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:52.917105Z","iopub.execute_input":"2023-03-25T09:19:52.917437Z","iopub.status.idle":"2023-03-25T09:19:52.968098Z","shell.execute_reply.started":"2023-03-25T09:19:52.917404Z","shell.execute_reply":"2023-03-25T09:19:52.967087Z"},"trusted":true},"execution_count":49,"outputs":[{"execution_count":49,"output_type":"execute_result","data":{"text/plain":"3000"},"metadata":{}}]},{"cell_type":"code","source":"print(os.listdir(foodPath))","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:52.979628Z","iopub.execute_input":"2023-03-25T09:19:52.982167Z","iopub.status.idle":"2023-03-25T09:19:52.992267Z","shell.execute_reply.started":"2023-03-25T09:19:52.982126Z","shell.execute_reply":"2023-03-25T09:19:52.990991Z"},"trusted":true},"execution_count":50,"outputs":[{"name":"stdout","text":"['h5', 'labels.txt', 'test.json', 'images', 'test.txt', 'train.txt', 'classes.txt', 'train.json']\n","output_type":"stream"}]},{"cell_type":"code","source":"image_dir_path = foodPath/'images'\nimage_categories = os.listdir(image_dir_path)\nprint(image_categories)","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.004782Z","iopub.execute_input":"2023-03-25T09:19:53.005507Z","iopub.status.idle":"2023-03-25T09:19:53.015108Z","shell.execute_reply.started":"2023-03-25T09:19:53.005470Z","shell.execute_reply":"2023-03-25T09:19:53.014099Z"},"trusted":true},"execution_count":51,"outputs":[{"name":"stdout","text":"['fish_and_chips', 'caprese_salad', 'strawberry_shortcake', 'pork_chop', 'edamame', 'macaroni_and_cheese', 'gnocchi', 'lobster_roll_sandwich', 'takoyaki', 'baklava', 'sushi', 'beef_tartare', 'miso_soup', 'steak', 'hot_dog', 'grilled_cheese_sandwich', 'greek_salad', 'crab_cakes', 'falafel', 'beet_salad', 'apple_pie', 'onion_rings', 'chocolate_mousse', 'risotto', 'chicken_wings', 'french_fries', 'pancakes', 'paella', 'chicken_quesadilla', 'gyoza', 'bread_pudding', 'beignets', 'carrot_cake', 'waffles', 'ceviche', 'huevos_rancheros', 'ravioli', 'sashimi', 'bibimbap', 'creme_brulee', 'spaghetti_bolognese', 'cheese_plate', 'oysters', 'filet_mignon', 'baby_back_ribs', 'fried_rice', 'ice_cream', 'tacos', 'cheesecake', 'foie_gras', 'shrimp_and_grits', 'macarons', 'poutine', 'french_onion_soup', 'deviled_eggs', 'grilled_salmon', 'eggs_benedict', 'croque_madame', 'seaweed_salad', 'churros', 'hummus', 'bruschetta', 'club_sandwich', 'ramen', 'clam_chowder', 'cup_cakes', 'hot_and_sour_soup', 'garlic_bread', 'breakfast_burrito', 'guacamole', 'lobster_bisque', 'spring_rolls', 'samosa', 'red_velvet_cake', 'pulled_pork_sandwich', 'escargots', 'chocolate_cake', 'spaghetti_carbonara', 'caesar_salad', 'hamburger', 'tuna_tartare', 'donuts', 'fried_calamari', 'mussels', 'omelette', 'panna_cotta', 'pad_thai', 'beef_carpaccio', 'pizza', 'nachos', 'chicken_curry', 'pho', 'tiramisu', 'frozen_yogurt', 'peking_duck', 'prime_rib', 'cannoli', 'dumplings', 'french_toast', 'lasagna', 'scallops']\n","output_type":"stream"}]},{"cell_type":"code","source":"df_train = pd.read_json('/root/.fastai/data/food-101/train.json')\ndf_test = pd.read_json('/root/.fastai/data/food-101/test.json')\ndf_train.head()\n","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.054152Z","iopub.execute_input":"2023-03-25T09:19:53.054494Z","iopub.status.idle":"2023-03-25T09:19:53.214998Z","shell.execute_reply.started":"2023-03-25T09:19:53.054462Z","shell.execute_reply":"2023-03-25T09:19:53.213925Z"},"trusted":true},"execution_count":52,"outputs":[{"execution_count":52,"output_type":"execute_result","data":{"text/plain":" churros hot_and_sour_soup samosa \\\n0 churros/1004234 hot_and_sour_soup/1002782 samosa/1008131 \n1 churros/1013460 hot_and_sour_soup/1003688 samosa/1011601 \n2 churros/1016791 hot_and_sour_soup/1008185 samosa/101365 \n3 churros/102100 hot_and_sour_soup/1008701 samosa/1015943 \n4 churros/1025494 hot_and_sour_soup/1008924 samosa/1016296 \n\n sashimi pork_chop spring_rolls \\\n0 sashimi/1001239 pork_chop/1000802 spring_rolls/1002160 \n1 sashimi/1001363 pork_chop/1006233 spring_rolls/1003056 \n2 sashimi/1002556 pork_chop/1019530 spring_rolls/1003507 \n3 sashimi/1007253 pork_chop/1019569 spring_rolls/1008736 \n4 sashimi/1010510 pork_chop/1025391 spring_rolls/1012525 \n\n panna_cotta beef_tartare greek_salad \\\n0 panna_cotta/1001332 beef_tartare/1000431 greek_salad/1007149 \n1 panna_cotta/1003460 beef_tartare/1005746 greek_salad/1009138 \n2 panna_cotta/1011097 beef_tartare/1009672 greek_salad/1010520 \n3 panna_cotta/1013000 beef_tartare/1012128 greek_salad/1011665 \n4 panna_cotta/1020036 beef_tartare/1027680 greek_salad/1012989 \n\n foie_gras ... chicken_quesadilla pho \\\n0 foie_gras/1004944 ... chicken_quesadilla/1004279 pho/1005681 \n1 foie_gras/1008577 ... chicken_quesadilla/1009225 pho/1011443 \n2 foie_gras/1011711 ... chicken_quesadilla/1011413 pho/1012513 \n3 foie_gras/1017233 ... chicken_quesadilla/1023828 pho/1019401 \n4 foie_gras/1023512 ... chicken_quesadilla/1024740 pho/1021371 \n\n prime_rib cheesecake ice_cream omelette \\\n0 prime_rib/1001089 cheesecake/1001446 ice_cream/1012277 omelette/1001719 \n1 prime_rib/1006320 cheesecake/1004515 ice_cream/101858 omelette/1007843 \n2 prime_rib/100945 cheesecake/1004807 ice_cream/102595 omelette/1015300 \n3 prime_rib/10120 cheesecake/1017408 ice_cream/1044117 omelette/1029915 \n4 prime_rib/1016126 cheesecake/1021942 ice_cream/104465 omelette/1038109 \n\n grilled_cheese_sandwich lobster_roll_sandwich \\\n0 grilled_cheese_sandwich/1003153 lobster_roll_sandwich/100009 \n1 grilled_cheese_sandwich/10060 lobster_roll_sandwich/1001432 \n2 grilled_cheese_sandwich/1007544 lobster_roll_sandwich/100646 \n3 grilled_cheese_sandwich/1013343 lobster_roll_sandwich/100655 \n4 grilled_cheese_sandwich/1016030 lobster_roll_sandwich/100702 \n\n nachos oysters \n0 nachos/100284 oysters/1008124 \n1 nachos/1009513 oysters/1016229 \n2 nachos/1011394 oysters/1023832 \n3 nachos/1013641 oysters/103236 \n4 nachos/1014846 oysters/1038150 \n\n[5 rows x 101 columns]","text/html":"<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>churros</th>\n <th>hot_and_sour_soup</th>\n <th>samosa</th>\n <th>sashimi</th>\n <th>pork_chop</th>\n <th>spring_rolls</th>\n <th>panna_cotta</th>\n <th>beef_tartare</th>\n <th>greek_salad</th>\n <th>foie_gras</th>\n <th>...</th>\n <th>chicken_quesadilla</th>\n <th>pho</th>\n <th>prime_rib</th>\n <th>cheesecake</th>\n <th>ice_cream</th>\n <th>omelette</th>\n <th>grilled_cheese_sandwich</th>\n <th>lobster_roll_sandwich</th>\n <th>nachos</th>\n <th>oysters</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>churros/1004234</td>\n <td>hot_and_sour_soup/1002782</td>\n <td>samosa/1008131</td>\n <td>sashimi/1001239</td>\n <td>pork_chop/1000802</td>\n <td>spring_rolls/1002160</td>\n <td>panna_cotta/1001332</td>\n <td>beef_tartare/1000431</td>\n <td>greek_salad/1007149</td>\n <td>foie_gras/1004944</td>\n <td>...</td>\n <td>chicken_quesadilla/1004279</td>\n <td>pho/1005681</td>\n <td>prime_rib/1001089</td>\n <td>cheesecake/1001446</td>\n <td>ice_cream/1012277</td>\n <td>omelette/1001719</td>\n <td>grilled_cheese_sandwich/1003153</td>\n <td>lobster_roll_sandwich/100009</td>\n <td>nachos/100284</td>\n <td>oysters/1008124</td>\n </tr>\n <tr>\n <th>1</th>\n <td>churros/1013460</td>\n <td>hot_and_sour_soup/1003688</td>\n <td>samosa/1011601</td>\n <td>sashimi/1001363</td>\n <td>pork_chop/1006233</td>\n <td>spring_rolls/1003056</td>\n <td>panna_cotta/1003460</td>\n <td>beef_tartare/1005746</td>\n <td>greek_salad/1009138</td>\n <td>foie_gras/1008577</td>\n <td>...</td>\n <td>chicken_quesadilla/1009225</td>\n <td>pho/1011443</td>\n <td>prime_rib/1006320</td>\n <td>cheesecake/1004515</td>\n <td>ice_cream/101858</td>\n <td>omelette/1007843</td>\n <td>grilled_cheese_sandwich/10060</td>\n <td>lobster_roll_sandwich/1001432</td>\n <td>nachos/1009513</td>\n <td>oysters/1016229</td>\n </tr>\n <tr>\n <th>2</th>\n <td>churros/1016791</td>\n <td>hot_and_sour_soup/1008185</td>\n <td>samosa/101365</td>\n <td>sashimi/1002556</td>\n <td>pork_chop/1019530</td>\n <td>spring_rolls/1003507</td>\n <td>panna_cotta/1011097</td>\n <td>beef_tartare/1009672</td>\n <td>greek_salad/1010520</td>\n <td>foie_gras/1011711</td>\n <td>...</td>\n <td>chicken_quesadilla/1011413</td>\n <td>pho/1012513</td>\n <td>prime_rib/100945</td>\n <td>cheesecake/1004807</td>\n <td>ice_cream/102595</td>\n <td>omelette/1015300</td>\n <td>grilled_cheese_sandwich/1007544</td>\n <td>lobster_roll_sandwich/100646</td>\n <td>nachos/1011394</td>\n <td>oysters/1023832</td>\n </tr>\n <tr>\n <th>3</th>\n <td>churros/102100</td>\n <td>hot_and_sour_soup/1008701</td>\n <td>samosa/1015943</td>\n <td>sashimi/1007253</td>\n <td>pork_chop/1019569</td>\n <td>spring_rolls/1008736</td>\n <td>panna_cotta/1013000</td>\n <td>beef_tartare/1012128</td>\n <td>greek_salad/1011665</td>\n <td>foie_gras/1017233</td>\n <td>...</td>\n <td>chicken_quesadilla/1023828</td>\n <td>pho/1019401</td>\n <td>prime_rib/10120</td>\n <td>cheesecake/1017408</td>\n <td>ice_cream/1044117</td>\n <td>omelette/1029915</td>\n <td>grilled_cheese_sandwich/1013343</td>\n <td>lobster_roll_sandwich/100655</td>\n <td>nachos/1013641</td>\n <td>oysters/103236</td>\n </tr>\n <tr>\n <th>4</th>\n <td>churros/1025494</td>\n <td>hot_and_sour_soup/1008924</td>\n <td>samosa/1016296</td>\n <td>sashimi/1010510</td>\n <td>pork_chop/1025391</td>\n <td>spring_rolls/1012525</td>\n <td>panna_cotta/1020036</td>\n <td>beef_tartare/1027680</td>\n <td>greek_salad/1012989</td>\n <td>foie_gras/1023512</td>\n <td>...</td>\n <td>chicken_quesadilla/1024740</td>\n <td>pho/1021371</td>\n <td>prime_rib/1016126</td>\n <td>cheesecake/1021942</td>\n <td>ice_cream/104465</td>\n <td>omelette/1038109</td>\n <td>grilled_cheese_sandwich/1016030</td>\n <td>lobster_roll_sandwich/100702</td>\n <td>nachos/1014846</td>\n <td>oysters/1038150</td>\n </tr>\n </tbody>\n</table>\n<p>5 rows × 101 columns</p>\n</div>"},"metadata":{}}]},{"cell_type":"code","source":"labelA = \"cheesecake\"\nlabelB = \"donuts\"\nlabelC = \"panna_cotta\"","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.220089Z","iopub.execute_input":"2023-03-25T09:19:53.222483Z","iopub.status.idle":"2023-03-25T09:19:53.229046Z","shell.execute_reply.started":"2023-03-25T09:19:53.222443Z","shell.execute_reply":"2023-03-25T09:19:53.227804Z"},"trusted":true},"execution_count":53,"outputs":[]},{"cell_type":"code","source":"for img in get_image_files(foodPath):\n if labelA in str(img):\n img.rename(f\"{img.parent}/{labelA}-{img.name}\")\n elif labelB in str(img):\n img.rename(f\"{img.parent}/{labelB}-{img.name}\")\n elif labelC in str(img):\n img.rename(f\"{img.parent}/{labelC}-{img.name}\")\n else:\n os.remove(img)\n\n","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.230723Z","iopub.execute_input":"2023-03-25T09:19:53.231273Z","iopub.status.idle":"2023-03-25T09:19:53.421924Z","shell.execute_reply.started":"2023-03-25T09:19:53.231238Z","shell.execute_reply":"2023-03-25T09:19:53.420842Z"},"trusted":true},"execution_count":54,"outputs":[]},{"cell_type":"code","source":"len(get_image_files(foodPath))","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.424735Z","iopub.execute_input":"2023-03-25T09:19:53.425486Z","iopub.status.idle":"2023-03-25T09:19:53.474506Z","shell.execute_reply.started":"2023-03-25T09:19:53.425444Z","shell.execute_reply":"2023-03-25T09:19:53.471325Z"},"trusted":true},"execution_count":55,"outputs":[{"execution_count":55,"output_type":"execute_result","data":{"text/plain":"3000"},"metadata":{}}]},{"cell_type":"code","source":"def GetLabel(img):\n return img.split('-')[0]\n \n \nGetLabel(\"cheesecake-1092082.jpg\")\n ","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.478685Z","iopub.execute_input":"2023-03-25T09:19:53.479326Z","iopub.status.idle":"2023-03-25T09:19:53.491304Z","shell.execute_reply.started":"2023-03-25T09:19:53.479288Z","shell.execute_reply":"2023-03-25T09:19:53.490233Z"},"trusted":true},"execution_count":56,"outputs":[{"execution_count":56,"output_type":"execute_result","data":{"text/plain":"'cheesecake'"},"metadata":{}}]},{"cell_type":"code","source":"#create data-loader\ndef GetLabel(img):\n return img.split('-')[0]\n\n\n\n","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.494656Z","iopub.execute_input":"2023-03-25T09:19:53.495798Z","iopub.status.idle":"2023-03-25T09:19:53.504827Z","shell.execute_reply.started":"2023-03-25T09:19:53.495761Z","shell.execute_reply":"2023-03-25T09:19:53.503777Z"},"trusted":true},"execution_count":57,"outputs":[]},{"cell_type":"code","source":"dls = ImageDataLoaders.from_name_func(foodPath, get_image_files(foodPath), \n valid_pct=0.2, seed=42, label_func=GetLabel, item_tfms=Resize(224))\n\nlearn = vision.learner(dls, resnet34, metrics = accuracy, pretrained= True)\n","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.506300Z","iopub.execute_input":"2023-03-25T09:19:53.507484Z","iopub.status.idle":"2023-03-25T09:19:53.915748Z","shell.execute_reply.started":"2023-03-25T09:19:53.507450Z","shell.execute_reply":"2023-03-25T09:19:53.912944Z"},"trusted":true},"execution_count":58,"outputs":[{"traceback":["\u001b[0;31m---------------------------------------------------------------------------\u001b[0m","\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)","\u001b[0;32m/tmp/ipykernel_24/2273625372.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 2\u001b[0m valid_pct=0.2, seed=42, label_func=GetLabel, item_tfms=Resize(224))\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mlearn\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvision\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlearner\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresnet34\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmetrics\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0maccuracy\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpretrained\u001b[0m\u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m","\u001b[0;31mTypeError\u001b[0m: 'module' object is not callable"],"ename":"TypeError","evalue":"'module' object is not callable","output_type":"error"}]},{"cell_type":"code","source":"learn.fine_tune(epochs=10)\nlearn.export('/kaggle/working/export1.pkl')\n#dls.train.show_batch()","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.916955Z","iopub.status.idle":"2023-03-25T09:19:53.917796Z","shell.execute_reply.started":"2023-03-25T09:19:53.917533Z","shell.execute_reply":"2023-03-25T09:19:53.917559Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"learn = vision_learner(dls, resnet34, metrics=error_rate, pretrained=True)\nlearn.fine_tune(epochs=10)","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.919164Z","iopub.status.idle":"2023-03-25T09:19:53.920375Z","shell.execute_reply.started":"2023-03-25T09:19:53.920120Z","shell.execute_reply":"2023-03-25T09:19:53.920146Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"learn.export('/kaggle/working/export.pt')","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.927869Z","iopub.status.idle":"2023-03-25T09:19:53.928438Z","shell.execute_reply.started":"2023-03-25T09:19:53.928112Z","shell.execute_reply":"2023-03-25T09:19:53.928137Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"modelPath = get_files(foodPath, '.pkl')[0]\nmodelPath","metadata":{"execution":{"iopub.status.busy":"2023-03-25T09:19:53.932120Z","iopub.status.idle":"2023-03-25T09:19:53.933250Z","shell.execute_reply.started":"2023-03-25T09:19:53.932974Z","shell.execute_reply":"2023-03-25T09:19:53.933000Z"},"trusted":true},"execution_count":null,"outputs":[]}]} |