{"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":"markdown","source":"# You must run this code on google colab.\n# You can use this code for download any dataset on kaggle.\n\n# **feel free to upvote this kernel:)**","metadata":{"id":"TMFqDfiw2tAi"}},{"cell_type":"code","source":"from google.colab import drive\nimport os\n\ndrive.mount('/content/drive')","metadata":{"id":"A0z03gB0uugs","outputId":"d9e4b955-ea10-42f2-c55d-dfd477bc6b70"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install -p kaggle","metadata":{"id":"xGcgWBNaJdb2","outputId":"6929dcb1-627c-4a4b-fb4f-1d5b6d1058f3"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# You must get kaggle.json from your account/API and upload here.","metadata":{"id":"hGJcEWI_3NG3"}},{"cell_type":"code","source":"from google.colab import files\nfiles.upload()","metadata":{"id":"aXFRJfZyJo-g"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! mkdir ~/.kaggle\n\n! cp kaggle.json ~/.kaggle/","metadata":{"id":"58pfX_n_u5f2","outputId":"94bedbf1-0cc7-44da-ddaf-5a8936c98cfe"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! chmod 600 ~/.kaggle/kaggle.json","metadata":{"id":"LVxux4KJvHoP"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! kaggle datasets list","metadata":{"id":"uEEuADiMvKz-","outputId":"67561ffe-d6b8-4828-f7df-5dbdd9c71fd8"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**I used this data set rsna-png-256x256x36-images from below link.**\n\nhttps://www.kaggle.com/smoschou55/pngtest","metadata":{"id":"jY5VO9o63gk6"}},{"cell_type":"code","source":"! kaggle datasets download -d smoschou55/pngtest","metadata":{"id":"_uBoHzDdvaUb","outputId":"050aca1d-2d10-437b-d5e8-026b9fab1ce8"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"create new folder in google drive ","metadata":{}},{"cell_type":"code","source":"! mkdir /content/drive/MyDrive/rsna","metadata":{"id":"FYiNRDPIwBOd","outputId":"12f6eaee-877d-4602-9cf5-ebedc4de1359"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! unzip pngtest.zip -d /content/drive/MyDrive/rsna","metadata":{"id":"SJbBThHVwLTY","outputId":"7f6f03e9-3f8a-467e-f7f1-fcf6c17ad291"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Import the os module\nimport os\n\n# Print the current working directory\nprint(\"Current working directory: {0}\".format(os.getcwd()))\n\n# Change the current working directory\nos.chdir('/content/drive/MyDrive/rsna')\n\n# Print the current working directory\nprint(\"Current working directory: {0}\".format(os.getcwd()))","metadata":{"id":"Ze6xApFrPIV-","outputId":"3b571d63-7775-4df6-c03d-238765a4310b"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"show number of content in folder","metadata":{}},{"cell_type":"code","source":"os.chdir('/content/drive/MyDrive/rsna/png_voxel_converted_ds/train')\n!find . -type f -printf . | wc -c","metadata":{"id":"y8GRWRSF0bdq","outputId":"0dd8e53c-a20c-4c02-aa23-07c13c01cd99"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls '/content/drive/MyDrive/rsna/png_voxel_converted_ds/test'","metadata":{"id":"HBKCQS2t0rKF","outputId":"49c432f3-db7c-4d3c-c72d-e1a932db7385"},"execution_count":null,"outputs":[]}]}