{"metadata":{"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"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import zipfile\nwith zipfile.ZipFile('../input/dogs-vs-cats/train.zip', 'r') as zip_ref:\n    zip_ref.extractall('/kaggle/working/dataset')","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-03-04T06:19:59.574362Z","iopub.execute_input":"2022-03-04T06:19:59.574621Z","iopub.status.idle":"2022-03-04T06:20:08.654713Z","shell.execute_reply.started":"2022-03-04T06:19:59.574592Z","shell.execute_reply":"2022-03-04T06:20:08.653977Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"    !ls /kaggle/working/dataset","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:20:08.656328Z","iopub.execute_input":"2022-03-04T06:20:08.656578Z","iopub.status.idle":"2022-03-04T06:20:09.324849Z","shell.execute_reply.started":"2022-03-04T06:20:08.656545Z","shell.execute_reply":"2022-03-04T06:20:09.324049Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt\nimport cv2\npath='../input/catimage/url'\nimage = cv2.imread(path)\nplt.imshow(image)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:33:06.031684Z","iopub.execute_input":"2022-03-04T06:33:06.032560Z","iopub.status.idle":"2022-03-04T06:33:06.325639Z","shell.execute_reply.started":"2022-03-04T06:33:06.032509Z","shell.execute_reply":"2022-03-04T06:33:06.323314Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img\n\ndatagen = ImageDataGenerator(\n        rotation_range=40,\n        width_shift_range=0.2,\n        height_shift_range=0.2,\n        shear_range=0.2,\n        zoom_range=0.2,\n        horizontal_flip=True,\n        fill_mode='nearest')\n\nimg = load_img('../input/catimage/url',grayscale=False, color_mode='rgb', target_size=None,\n    interpolation='nearest')  # this is a PIL image\nx = img_to_array(img)  # this is a Numpy array with shape (3, 150, 150)\nx = x.reshape((1,) + x.shape)  # this is a Numpy array with shape (1, 3, 150, 150)\n\n# the .flow() command below generates batches of randomly transformed images\n# and saves the results to the `preview/` directory\ni = 0\nfor batch in datagen.flow(x, batch_size=1,save_to_dir='/kaggle/working/preview', save_prefix='cat', save_format='jpeg'):\n    i += 1\n    if i > 20:\n        break  # otherwise the generator would loop indefinitely\n","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:33:25.950330Z","iopub.execute_input":"2022-03-04T06:33:25.950578Z","iopub.status.idle":"2022-03-04T06:33:26.035335Z","shell.execute_reply.started":"2022-03-04T06:33:25.950550Z","shell.execute_reply":"2022-03-04T06:33:26.034378Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:20:42.106485Z","iopub.execute_input":"2022-03-04T06:20:42.106760Z","iopub.status.idle":"2022-03-04T06:20:42.113700Z","shell.execute_reply.started":"2022-03-04T06:20:42.106729Z","shell.execute_reply":"2022-03-04T06:20:42.113038Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}