Skip to content

Commit

Permalink
Merge pull request #266 from roboflow/add-classification-upload
Browse files Browse the repository at this point in the history
Add YOLOv8 classification model weight upload instructions
  • Loading branch information
SkalskiP authored Mar 26, 2024
2 parents 21d6eac + da50087 commit 5e13d82
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion notebooks/train-yolov8-classification-on-custom-dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1173,11 +1173,33 @@
"import glob\n",
"from IPython.display import Image, display\n",
"\n",
"for image_path in glob.glob(f'{HOME}/runs/classify/predict2/*.jpg')[:3]:\n",
"for image_path in glob.glob(f'{HOME}/runs/classify/predict/*.jpg')[:3]:\n",
" display(Image(filename=image_path, width=600))\n",
" print(\"\\n\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Save and Deploy model\n",
"\n",
"Once you have finished training your YOLOv8 model, you’ll have a set of trained weights ready for use. These weights will be in the `/runs/classify/train/weights/best.pt` folder of your project. You can upload and your model weights to Roboflow Deploy for autolabeling, autoscaling inference, and using later.\n",
"\n",
"The `.deploy()` function in the [Roboflow pip package](https://docs.roboflow.com/python) supports uploading YOLOv8 weights.\n",
"\n",
"Run this cell to save your model weights:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"project.version(dataset.version).deploy(model_type=\"yolov8-cls\", model_path=f\"{HOME}/runs/classify/train/\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 5e13d82

Please sign in to comment.