{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[],"dockerImageVersionId":28755,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"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\n\n# Use the kagglehub client library to attach Kaggle resources like competitions, datasets, and models to your session\n# Learn more about kagglehub: https://github.com/Kaggle/kagglehub/blob/main/README.md\n\nimport kagglehub\n# kagglehub.dataset_download('<owner>/<dataset-slug>')","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import os\n\ndef check_dir_size(path):\n    total_size = 0\n    for root, _, files in os.walk(path):\n        for f in files:\n            fp = os.path.join(root, f)\n            if not os.path.islink(fp):\n                total_size += os.path.getsize(fp)\n    return total_size\n\n# Update base_path if your dataset is located elsewhere\nbase_path = \"/kaggle/input/3d-object-detection-for-autonomous-vehicles\"\n\nlidar_dirs = [\"train_lidar\", \"test_lidar\"]\nall_dirs = [\n    \"train_lidar\", \"test_lidar\",\n    \"train_images\", \"test_images\",\n    \"train_data\", \"test_data\",\n    \"train_maps\", \"test_maps\"\n]\n\nlidar_bytes = 0\ntotal_bytes = 0\n\nprint(\"Calculating directory sizes...\\n\")\n\nfor d in all_dirs:\n    dir_path = os.path.join(base_path, d)\n    if os.path.exists(dir_path):\n        size = check_dir_size(dir_path)\n        total_bytes += size\n        if d in lidar_dirs:\n            lidar_bytes += size\n        print(f\"{d:15s}: {size / (1024**3):6.2f} GB\")\n\nif total_bytes > 0:\n    lidar_percentage = (lidar_bytes / total_bytes) * 100\n    print(\"-\" * 35)\n    print(f\"Total LiDAR Size: {lidar_bytes / (1024**3):.2f} GB\")\n    print(f\"Total Dataset Size: {total_bytes / (1024**3):.2f} GB\")\n    print(f\"LiDAR Proportion:  {lidar_percentage:.2f}%\")\nelse:\n    print(\"No valid directories found. Please check the `base_path`.\")","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}