{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.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":"import pandas as pd\nfrom os.path import join\nfp = \"/kaggle/input/dog-breed-identification/train\"\nimageFilepaths = [join(fp, filename) for filename in [\n    '0c8fe33bd89646b678f6b2891df8a1c6.jpg',\n    '0c3b282ecbed1ca9eb17de4cb1b6e326.jpg',\n    '04fb4d719e9fe2b6ffe32d9ae7be8a22.jpg',\n    '0e79be614f12deb4f7cae18614b7391b.jpg'\n]]\nimageFilepaths","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-08-29T23:55:14.826764Z","iopub.execute_input":"2023-08-29T23:55:14.827135Z","iopub.status.idle":"2023-08-29T23:55:14.835593Z","shell.execute_reply.started":"2023-08-29T23:55:14.827105Z","shell.execute_reply":"2023-08-29T23:55:14.834615Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Preprocess the images\nimport numpy as np\nfrom tensorflow.keras.applications.resnet50 import preprocess_input\nfrom tensorflow.keras.preprocessing.image import load_img, img_to_array\n\ndef preprocessImages(imageFilepaths, imageHeight=224, imageWidth=224):\n    images = [load_img(path, target_size=(imageHeight, imageWidth)) for path in imageFilepaths]\n    return images\n\nimageArray = np.array([img_to_array(image) for image in preprocessImages(imageFilepaths)])\n\noutput = preprocess_input(imageArray)\noutput","metadata":{"execution":{"iopub.status.busy":"2023-08-30T00:08:04.847939Z","iopub.execute_input":"2023-08-30T00:08:04.848300Z","iopub.status.idle":"2023-08-30T00:08:04.881124Z","shell.execute_reply.started":"2023-08-30T00:08:04.848273Z","shell.execute_reply":"2023-08-30T00:08:04.880201Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Importing the model\nfrom tensorflow.keras.applications import ResNet50\nmodel = ResNet50()","metadata":{"execution":{"iopub.status.busy":"2023-08-30T00:20:51.056600Z","iopub.execute_input":"2023-08-30T00:20:51.057683Z","iopub.status.idle":"2023-08-30T00:20:57.523784Z","shell.execute_reply.started":"2023-08-30T00:20:51.057644Z","shell.execute_reply":"2023-08-30T00:20:57.522696Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Declare the test data\nfp = \"/kaggle/input/dog-breed-identification/test\"\nimport os\nX_test = []\n\nfor filename in os.listdir(fp):\n    filepath = os.path.join(fp, filename)\n    X_test.append(filepath)\n    ","metadata":{"execution":{"iopub.status.busy":"2023-08-30T00:24:35.971965Z","iopub.execute_input":"2023-08-30T00:24:35.972691Z","iopub.status.idle":"2023-08-30T00:24:37.130961Z","shell.execute_reply.started":"2023-08-30T00:24:35.972659Z","shell.execute_reply":"2023-08-30T00:24:37.129885Z"},"trusted":true},"execution_count":null,"outputs":[]}],"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}}