{"cells":[{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","execution":{"iopub.execute_input":"2024-09-08T06:52:15.629296Z","iopub.status.busy":"2024-09-08T06:52:15.628873Z","iopub.status.idle":"2024-09-08T06:52:35.266264Z","shell.execute_reply":"2024-09-08T06:52:35.265350Z","shell.execute_reply.started":"2024-09-08T06:52:15.629258Z"},"trusted":true},"outputs":[],"source":["!pip install roboflow\n","\n","from roboflow import Roboflow\n","rf = Roboflow(api_key=\"ZvM6LUyWI7hiVw6K64bt\")\n","project = rf.workspace(\"capitaletech-wrnth\").project(\"annotation-moxcs\")\n","version = project.version(2)\n","dataset = version.download(\"yolov8\")\n"," "]},{"cell_type":"code","execution_count":4,"metadata":{"execution":{"iopub.execute_input":"2024-09-08T06:52:38.656706Z","iopub.status.busy":"2024-09-08T06:52:38.655712Z","iopub.status.idle":"2024-09-08T06:52:38.661352Z","shell.execute_reply":"2024-09-08T06:52:38.660330Z","shell.execute_reply.started":"2024-09-08T06:52:38.656651Z"},"trusted":true},"outputs":[],"source":["import os\n","os.environ[\"WANDB_DISABLED\"] = \"true\""]},{"cell_type":"code","execution_count":null,"metadata":{"execution":{"iopub.execute_input":"2024-09-08T06:52:39.882023Z","iopub.status.busy":"2024-09-08T06:52:39.881309Z","iopub.status.idle":"2024-09-08T06:52:54.091799Z","shell.execute_reply":"2024-09-08T06:52:54.090833Z","shell.execute_reply.started":"2024-09-08T06:52:39.881985Z"},"trusted":true},"outputs":[],"source":["!pip install ultralytics==8.0.28"]},{"cell_type":"code","execution_count":13,"metadata":{"execution":{"iopub.execute_input":"2024-09-08T06:56:25.315009Z","iopub.status.busy":"2024-09-08T06:56:25.314467Z","iopub.status.idle":"2024-09-08T06:56:25.322391Z","shell.execute_reply":"2024-09-08T06:56:25.321282Z","shell.execute_reply.started":"2024-09-08T06:56:25.314961Z"},"trusted":true},"outputs":[],"source":["yaml_text = \"\"\"train: /kaggle/working/annotation-2/train\n","val: /kaggle/working/annotation-2/valid\n","test: /kaggle/working/annotation-2/test\n","\n","names:\n","- Certifications\n","- Community\n","- Contact\n","- Education\n","- Experience\n","- Interests\n","- Languages\n","- Name\n","- Profil\n","- Projects\n","- skills\n","nc: 11\n","roboflow:\n"," license: CC BY 4.0\n"," project: annotation-moxcs\n"," url: https://universe.roboflow.com/capitaletech-wrnth/annotation-moxcs/dataset/2\n"," version: 2\n"," workspace: capitaletech-wrnth\n","\"\"\"\n","with open(\"./data.yaml\", 'w') as file:\n"," file.write(yaml_text),\n"]},{"cell_type":"code","execution_count":null,"metadata":{"execution":{"iopub.execute_input":"2024-09-08T06:56:26.844555Z","iopub.status.busy":"2024-09-08T06:56:26.844168Z","iopub.status.idle":"2024-09-08T09:22:07.888695Z","shell.execute_reply":"2024-09-08T09:22:07.887404Z","shell.execute_reply.started":"2024-09-08T06:56:26.844520Z"},"trusted":true},"outputs":[],"source":["!yolo task=segment mode=train model=yolov8m-seg.pt data=/kaggle/working/data.yaml epochs=100 imgsz=640\n","# !ls {HOME}/runs/segment/train/\n"]},{"cell_type":"code","execution_count":null,"metadata":{"execution":{"iopub.execute_input":"2024-09-08T09:22:07.892085Z","iopub.status.busy":"2024-09-08T09:22:07.891230Z","iopub.status.idle":"2024-09-08T09:22:25.963401Z","shell.execute_reply":"2024-09-08T09:22:25.962222Z","shell.execute_reply.started":"2024-09-08T09:22:07.892036Z"},"trusted":true},"outputs":[],"source":["!yolo export model=/kaggle/working/runs/segment/train4/weights/best.pt format=onnx "]},{"cell_type":"code","execution_count":null,"metadata":{"execution":{"iopub.execute_input":"2024-09-08T06:53:10.988929Z","iopub.status.busy":"2024-09-08T06:53:10.988489Z","iopub.status.idle":"2024-09-08T06:53:11.045752Z","shell.execute_reply":"2024-09-08T06:53:11.044376Z","shell.execute_reply.started":"2024-09-08T06:53:10.988883Z"},"trusted":true},"outputs":[],"source":["from PIL import Image\n","Image(filename=f'/kaggle/working/runs/segment/train/train_batch0.jpg', width=600)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":[]}],"metadata":{"kaggle":{"accelerator":"gpu","dataSources":[],"dockerImageVersionId":30762,"isGpuEnabled":true,"isInternetEnabled":true,"language":"python","sourceType":"notebook"},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.14"}},"nbformat":4,"nbformat_minor":4}