{"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-02-28T04:53:13.648653Z","iopub.execute_input":"2025-02-28T04:53:13.649007Z","iopub.status.idle":"2025-02-28T04:56:03.023225Z","shell.execute_reply.started":"2025-02-28T04:53:13.648973Z","shell.execute_reply":"2025-02-28T04:56:03.022065Z"}},"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-02-28T04:56:03.025478Z","iopub.execute_input":"2025-02-28T04:56:03.025810Z"}},"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(\"yolov8n.pt\")\n\n# Save the downloaded weights to a local file\nmodel.save(\"yolov8-weights/yolov8n.pt\")\n\nprint(f\"YOLOv8 weights saved to: {os.path.abspath('yolov8-weights/yolov8n.pt')}\")","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}