{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":84969,"databundleVersionId":10033515,"sourceType":"competition"}],"dockerImageVersionId":30804,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!pip download -d ./packages ultralytics\n!tar cfvz archive.tar.gz ./packages","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-03-08T13:02:18.128261Z","iopub.execute_input":"2025-03-08T13:02:18.128653Z","iopub.status.idle":"2025-03-08T13:05:45.649885Z","shell.execute_reply.started":"2025-03-08T13:02:18.128618Z","shell.execute_reply":"2025-03-08T13:05:45.647960Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!tar xfvz archive.tar.gz\n!pip install --no-index --find-links=./packages ultralytics\n!rm -rf ./packages ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-03-08T13:05:45.653871Z","iopub.execute_input":"2025-03-08T13:05:45.654434Z","iopub.status.idle":"2025-03-08T13:06:28.451847Z","shell.execute_reply.started":"2025-03-08T13:05:45.654387Z","shell.execute_reply":"2025-03-08T13:06:28.450478Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import os\nfrom ultralytics import YOLO\n\n# Create a directory to store the weights\nos.makedirs(\"yolov8-weights\", exist_ok=True)\n\n# This will download the YOLOv8 nano weights\nmodel = YOLO(\"yolov8s.pt\")\n\n# Save the downloaded weights to a local file\nmodel.save(\"yolov8-weights/yolov8s.pt\")\n\nprint(f\"YOLOv8 weights saved to: {os.path.abspath('yolov8-weights/yolov8s.pt')}\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-03-08T13:06:28.453489Z","iopub.execute_input":"2025-03-08T13:06:28.453835Z","iopub.status.idle":"2025-03-08T13:06:33.838493Z","shell.execute_reply.started":"2025-03-08T13:06:28.453801Z","shell.execute_reply":"2025-03-08T13:06:33.837319Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"model = YOLO(\"yolov8n.pt\")\nmodel.save(\"yolov8-weights/yolov8n.pt\")\nmodel = YOLO(\"yolov8m.pt\")\nmodel.save(\"yolov8-weights/yolov8m.pt\")","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}