{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.13","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,"execution":{"iopub.status.busy":"2026-09-14T01:01:36.081769Z","iopub.execute_input":"2026-09-14T01:01:36.082176Z","iopub.status.idle":"2026-09-14T01:01:42.677903Z","shell.execute_reply.started":"2026-09-14T01:01:36.082131Z","shell.execute_reply":"2026-09-14T01:01:42.676822Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import os\n\nprint(os.listdir(\"/kaggle/input\"))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-14T01:02:27.693692Z","iopub.execute_input":"2026-09-14T01:02:27.694098Z","iopub.status.idle":"2026-09-14T01:02:27.702069Z","shell.execute_reply.started":"2026-09-14T01:02:27.694067Z","shell.execute_reply":"2026-09-14T01:02:27.700987Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import os\n\nfor root, dirs, files in os.walk(\"/kaggle/input/competitions\"):\n    print(\"📁\", root)\n    for file in files[:10]:\n        print(\"   \", file)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-14T01:02:56.235309Z","iopub.execute_input":"2026-09-14T01:02:56.235637Z","iopub.status.idle":"2026-09-14T01:02:58.413295Z","shell.execute_reply.started":"2026-09-14T01:02:56.235605Z","shell.execute_reply":"2026-09-14T01:02:58.412143Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import pandas as pd\n\nBASE_PATH = \"/kaggle/input/competitions/nexar-collision-prediction\"\n\ntrain_csv = pd.read_csv(f\"{BASE_PATH}/train.csv\")\n\nprint(train_csv.head())\nprint(\"\\nShape:\", train_csv.shape)\nprint(\"\\nColumns:\", train_csv.columns.tolist())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-14T01:03:38.386373Z","iopub.execute_input":"2026-09-14T01:03:38.387804Z","iopub.status.idle":"2026-09-14T01:03:38.433676Z","shell.execute_reply.started":"2026-09-14T01:03:38.387736Z","shell.execute_reply":"2026-09-14T01:03:38.432257Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import cv2\nimport os\n\nVIDEO_PATH = f\"{BASE_PATH}/train/02059.mp4\"\n\ncap = cv2.VideoCapture(VIDEO_PATH)\n\nif not cap.isOpened():\n    print(\"❌ Không mở được video\")\nelse:\n    fps = cap.get(cv2.CAP_PROP_FPS)\n    frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))\n    width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))\n    height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))\n\n    print(\"✅ Video mở thành công!\")\n    print(\"Resolution:\", width, \"x\", height)\n    print(\"FPS:\", fps)\n    print(\"Frames:\", frames)\n    print(\"Duration:\", round(frames / fps, 2), \"seconds\")\n\ncap.release()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-14T01:03:50.734552Z","iopub.execute_input":"2026-09-14T01:03:50.735001Z","iopub.status.idle":"2026-09-14T01:03:50.874438Z","shell.execute_reply.started":"2026-09-14T01:03:50.734968Z","shell.execute_reply":"2026-09-14T01:03:50.873097Z"}},"outputs":[],"execution_count":null}]}