{"id":6623,"date":"2023-07-20T15:28:09","date_gmt":"2023-07-20T23:28:09","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=6623"},"modified":"2025-04-29T14:02:40","modified_gmt":"2025-04-29T14:02:40","slug":"fine-tuning-yolov8-for-image-segmentation-with-comet","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/","title":{"rendered":"Fine-tuning YOLOv8 for Image Segmentation with Comet"},"content":{"rendered":"\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1370\" height=\"1142\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-14-at-4.31.46-PM.png\" alt=\"\" class=\"wp-image-6685\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-14-at-4.31.46-PM.png 1370w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-14-at-4.31.46-PM-300x250.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-14-at-4.31.46-PM-1024x854.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-14-at-4.31.46-PM-768x640.png 768w\" sizes=\"auto, (max-width: 1370px) 100vw, 1370px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Today, AI developers use computer vision (CV) to incorporate solutions to identify, classify, and respond to objects in real time. Some common tasks include image classification, facial detection, pose estimation, segmentation, etc. With models like <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/arxiv.org\/pdf\/2304.00501.pdf\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/arxiv.org\/pdf\/2304.00501.pdf\">YOLOv8<\/a> achieving state-of-the-art results on various object detection and semantic segmentation benchmarks, CV has gained remarkable accuracy and efficiency.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Let\u2019s explore image segmentation, the limitations of segmentation models, and the process of fine-tuning YOLOv8 for image segmentation.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote graf graf--blockquote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><a class=\"markup--anchor markup--blockquote-anchor\" href=\"https:\/\/colab.research.google.com\/drive\/1b6UdiQMXRmOTtNv3ueIqAM0dRxSsjapY?usp=sharing\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/colab.research.google.com\/drive\/1b6UdiQMXRmOTtNv3ueIqAM0dRxSsjapY?usp=sharing\"><strong class=\"markup--strong markup--blockquote-strong\">Follow along with the full-code tutorial here!<\/strong><\/a><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">What is Image Segmentation?<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Image segmentation is a process of dividing a digital image into multiple segments or regions at the pixel level. It enables CV models to understand the content of an image on a detailed level and perform relevant actions based on the segmented regions.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Image segmentation is widely applied in areas such as medical imaging for tasks like, tumor detection, disease diagnosis, and organ segmentation. Moreover, it is used in robotics for object recognition and manipulation, and autonomous vehicles for detecting and classifying objects.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Some commonly used image segmentation techniques in computer vision include instance segmentation, panoptic segmentation, region-based segmentation, and thresholding segmentation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Why Fine-tune a&nbsp;Model?<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Fine-tuning a model involves taking a pre-trained model and adapting it to perform well on a new, specific task or data set. This process helps enhance model performance on previously unseen data. For instance, an image segmentation model trained on horizontally taken smartphone images may not perform well on vertical satellite imagery.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">By fine-tuning the model, we can leverage the model\u2019s pre-training on general object segmentation to develop a more precise model. This helps deliver an optimized model without going through the entire training process, saving time and computing resources.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Moreover, since our custom dataset may not contain millions of examples, fine-tuning becomes a favorable approach compared to training the model from scratch.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Fine-tuning a model provides the following benefits:<\/p>\n\n\n\n<ul class=\"wp-block-list postList\">\n<li>Enhances the model\u2019s performance.<\/li>\n\n\n\n<li>Saves computational resources and reduces training time.<\/li>\n\n\n\n<li>Allows the model to leverage pre-trained knowledge for the target task.<\/li>\n\n\n\n<li>Enables the model to adapt to previously unseen or new data distributions.<\/li>\n\n\n\n<li>Customizes the model for specific use cases, optimizing its performance.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Limitations of Image Segmentation Models<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">While image segmentation models have made significant progress in recent years, they still have some limitations. Some of them include the following.<\/p>\n\n\n\n<ul class=\"wp-block-list postList\">\n<li><strong class=\"markup--strong markup--li-strong\">Handling unstructured and unevenly distributed 3D data:<\/strong> With the rise of image acquisition equipment such as LiDAR cameras, there is a growing need for segmentation techniques in 3D data, such as point clouds, voxels, etc. However, the representation and processing of these unstructured, disordered, redundant, and unevenly distributed 3D data remain a significant challenge for segmentation algorithms.<\/li>\n\n\n\n<li><strong class=\"markup--strong markup--li-strong\">Limited availability of labeled datasets:<\/strong> In some domains, there is a scarcity of datasets with fine-grained annotations, making it difficult to train segmentation networks using supervised learning algorithms.<\/li>\n\n\n\n<li><strong class=\"markup--strong markup--li-strong\">Computational complexity and real-time performance: <\/strong>Deep learning networks used in image segmentation require significant computing resources due to their computational complexity during training. Achieving real-time segmentation, necessary in various domains like video processing, which aims for at least 25 frames per second, remains challenging.<\/li>\n\n\n\n<li><strong class=\"markup--strong markup--li-strong\">Limited ability to handle noise and variations in image quality:<\/strong> Many image segmentation algorithms are sensitive to noise and variations in image quality, making it difficult to achieve accurate results on images with poor quality or low resolution.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">What is YOLOv8: A Brief Explanation<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">YOLOv8, short for \u201cYou Only Look Once version 8,\u201d is a state-of-the-art model that can be used for image classification, object detection, and instance segmentation tasks. It is an evolution of the YOLO family of models, renowned for their real-time object detection capabilities.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">YOLOv8 introduces significant architectural advancements and developer experience that distinguish it from its predecessor, YOLOv5. The key improvements of YOLOv8 include:<\/p>\n\n\n\n<ul class=\"wp-block-list postList\">\n<li>An anchor-free detection system departing from the anchor-based approach.<\/li>\n\n\n\n<li>Modifications to the convolutional blocks utilized within the model enhance its overall performance.<\/li>\n\n\n\n<li>Implementation of mosaic augmentation during training, which is disabled in the final 10 epochs.<\/li>\n<\/ul>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">YOLOv8 can be executed from the command line interface (CLI) or installed as a PIP package to facilitate usage. Furthermore, it provides multiple integrations for labeling, training, and deployment, further streamlining the workflow.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">When evaluated on the MS COCO dataset test-dev 2017, YOLOv8x attained an impressive average precision (AP) of <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/arxiv.org\/pdf\/2304.00501.pdf\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/arxiv.org\/pdf\/2304.00501.pdf\">53.9%<\/a> with an image size of 640 pixels, surpassing the 50.7% achieved by YOLOv5 on the same input size. Moreover, YOLOv8x exhibits a speed of 280 FPS on an NVIDIA A100 and TensorRT, highlighting its efficiency and computational performance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Fine-tuning YOLOv8 Model with&nbsp;Comet<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Despite its impressive performance, pre-trained models like the YOLOv8 struggle against case-specific and niche tasks. To alter these models to your need, it is important to fine-tune them against a custom dataset. Let\u2019s see how we can fine-tune YOLOv8 for instance segmentation!<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">We will use the <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/storage.googleapis.com\/openimages\/web\/visualizer\/index.html?type=segmentation&amp;set=train&amp;r=false&amp;c=%2Fm%2F09ddx\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/storage.googleapis.com\/openimages\/web\/visualizer\/index.html?type=segmentation&amp;set=train&amp;r=false&amp;c=%2Fm%2F09ddx\">open images dataset<\/a> for fine-tuning and the Comet platform integration for experiment tracking, logging, and model storage.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">This experiment has been run inside a <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/colab.research.google.com\/drive\/1b6UdiQMXRmOTtNv3ueIqAM0dRxSsjapY?usp=sharing\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/colab.research.google.com\/drive\/1b6UdiQMXRmOTtNv3ueIqAM0dRxSsjapY?usp=sharing\">Google Colab<\/a> environment with a GPU runtime.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/colab.research.google.com\/drive\/1b6UdiQMXRmOTtNv3ueIqAM0dRxSsjapY?usp=sharing\" target=\"_blank\" rel=\"noreferrer noopener\">Follow along with the Colab!<\/a><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Data Exploration<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">We will fine-tune the model to segment \u2018ducks\u2019 within an image. The relevant dataset and annotations are from the open images dataset. This dataset consists of 400 images for this experiment, with 50 images for the validation set. The sample dataset is publicly available on <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.kaggle.com\/datasets\/haziqasajid5122\/yolov8-finetuning-dataset-ducks\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.kaggle.com\/datasets\/haziqasajid5122\/yolov8-finetuning-dataset-ducks\">Kaggle<\/a>. Here is a glimpse of the training set:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6642\"><img loading=\"lazy\" decoding=\"async\" width=\"1507\" height=\"604\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_ZG9dkFoSeP7vYPFAI-xu2w.png\" alt=\"\" class=\"wp-image-6642\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_ZG9dkFoSeP7vYPFAI-xu2w.png 1507w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_ZG9dkFoSeP7vYPFAI-xu2w-300x120.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_ZG9dkFoSeP7vYPFAI-xu2w-1024x410.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_ZG9dkFoSeP7vYPFAI-xu2w-768x308.png 768w\" sizes=\"auto, (max-width: 1507px) 100vw, 1507px\" \/><figcaption class=\"wp-element-caption\">Dataset from OpenImages<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">The annotation file for an image segmentation task consists of the class label followed by the pixel coordinates that form the segmentation mask.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6641\"><img loading=\"lazy\" decoding=\"async\" width=\"1545\" height=\"858\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_zNtiWqVb8cFkHysEPAejEQ.png\" alt=\"\" class=\"wp-image-6641\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_zNtiWqVb8cFkHysEPAejEQ.png 1545w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_zNtiWqVb8cFkHysEPAejEQ-300x167.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_zNtiWqVb8cFkHysEPAejEQ-1024x569.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_zNtiWqVb8cFkHysEPAejEQ-768x427.png 768w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_zNtiWqVb8cFkHysEPAejEQ-1536x853.png 1536w\" sizes=\"auto, (max-width: 1545px) 100vw, 1545px\" \/><figcaption class=\"wp-element-caption\">Annotation File<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Baseline experiment with the pre-trained model<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Before moving on with the custom dataset training, let\u2019s see what the pre-trained model outputs for our custom dataset.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">First, we install the required libraries.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pre--content\">!pip install ultralytics comet_ml torch torchvision kaggle --quiet<\/span><\/pre>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">The <code class=\"markup--code markup--p-code\">ultralytics<\/code> package will allow us to access the YOLOv8 models, <code class=\"markup--code markup--p-code\">comet_ml<\/code> will allow us to initiate experiments within the comet platform while <code class=\"markup--code markup--p-code\">torch<\/code> and <code class=\"markup--code markup--p-code\">torchvision<\/code> are required for necessary imports within YOLOv8.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Next, we import the necessary packages.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pre--content\"><span class=\"hljs-keyword\">import<\/span> comet_ml\n<span class=\"hljs-keyword\">from<\/span> ultralytics <span class=\"hljs-keyword\">import<\/span> YOLO\n<span class=\"hljs-keyword\">import<\/span> os\n<span class=\"hljs-keyword\">from<\/span> google.colab <span class=\"hljs-keyword\">import<\/span> files<\/span><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Importing our data<\/h3>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">We import our dataset from Kaggle. For this we will require the Kaggle API token and the relevant dataset URI. To access the dataset, you will have to create and upload your own Kaggle token to the Colab workspace. Once that is done, you can access the dataset by running the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pre--content\">!kaggle datasets download haziqasajid5122\/yolov8-finetuning-dataset-ducks\n!unzip yolov8-finetuning-dataset-ducks -d \/content\/Data\n!<span class=\"hljs-built_in\">cp<\/span> \/content\/Data\/config.yaml \/content\/config.yaml<\/span><\/pre>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">To run experiments with <code class=\"markup--code markup--p-code\">comet_ml<\/code> we need an API key. Grab your API key from a <a class=\"markup--anchor markup--p-anchor\" href=\"\/signup\" target=\"_blank\" rel=\"noopener\" data-href=\"\/signup\">free Comet account<\/a>. You can find the API key under the <code class=\"markup--code markup--p-code u-paddingRight0 u-marginRight0\"><strong class=\"markup--strong markup--p-strong\">Account<\/strong> <strong class=\"markup--strong markup--p-strong\">Settings<\/strong><\/code> -&gt; <code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">API Keys<\/strong><\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6640\"><img loading=\"lazy\" decoding=\"async\" width=\"790\" height=\"276\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_g61wpUHvfSdnBU-_UXq4zw.png\" alt=\"\" class=\"wp-image-6640\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_g61wpUHvfSdnBU-_UXq4zw.png 790w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_g61wpUHvfSdnBU-_UXq4zw-300x105.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_g61wpUHvfSdnBU-_UXq4zw-768x268.png 768w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><figcaption class=\"wp-element-caption\">Comet API Key<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">The easiest way to use this key is to set it as an environment variable.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pre--content\">os.environ[\u201cCOMET_API_KEY\u201d] = \u201c&lt;YOUR_API_KEY_HERE&gt;\u201d<\/span><\/pre>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Now, when we initialize the Comet project, it will automatically detect this key and proceed with the setup.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pre--content\">comet_ml.login(\u201cYOLOv8-With-Comet\u201d)<\/span><\/pre>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Next, we need to choose a pre-trained YOLO model. By default, ultralytics includes several models for each task with varying sizes. The segmentation module includes<\/p>\n\n\n\n<ul class=\"wp-block-list postList\">\n<li>YOLOv8n-seg<\/li>\n\n\n\n<li>YOLOv8s-seg<\/li>\n\n\n\n<li>YOLOv8m-seg<\/li>\n\n\n\n<li>YOLOv8l-seg<\/li>\n\n\n\n<li>YOLOv8x-seg<\/li>\n<\/ul>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Complete details of the models can be found in the <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/docs.ultralytics.com\/tasks\/segment\/#models\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/docs.ultralytics.com\/tasks\/segment\/#models\">official documentation<\/a>.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">We will use the <code class=\"markup--code markup--p-code\">YOLOv8m-seg<\/code> (medium) model since it should provide us with a balance between training performance and results.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pre--content\">model = YOLO(\u2018yolov8m-seg.pt\u2019)<\/span><\/pre>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">When the model is first invoked, it will be automatically downloaded to your local device.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Now let\u2019s see how this model works on our custom dataset.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pre--content\">results = model.predict(<span class=\"hljs-string\">\"\/content\/Data\/images\/val\/0a411d151f978818.png\"<\/span>, save=<span class=\"hljs-literal\">True<\/span>)<\/span><\/pre>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Our experiments are run in the Google Colab environment with a mounted Google Drive, which is why the path looks like this. You will have to change the path according to your system. Now back to the results.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6639\"><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"549\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_7mjB3dfVxBKo3EKAogYrmA.png\" alt=\"Instance segmentation with Yolov8 and Comet ML\" class=\"wp-image-6639\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_7mjB3dfVxBKo3EKAogYrmA.png 734w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_7mjB3dfVxBKo3EKAogYrmA-300x224.png 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><figcaption class=\"wp-element-caption\">Segmentation results before fine-tuning<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">The image is correctly segmented as a \u2018bird\u2019, which is expected since the pre-trained model is trained on the <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/cocodataset.org\/#home\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/cocodataset.org\/#home\">COCO dataset<\/a>. However, we wish to teach the model what type of bird this is, i.e., a duck in this case.<\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Fine-tuning<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">For custom dataset training, YOLO expects the data to be in a certain format. The directory structure for training and validation images and labels is shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6638 size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"294\" height=\"219\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_nFwn6jIa3N_7NzJ2_1ZH7Q.png\" alt=\"\" class=\"wp-image-6638\"\/><figcaption class=\"wp-element-caption\">Dataset directory structure<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">The subfolder for `images` contains all the \u2018.png\u2019 files, and the labels directory contains annotations in \u2018.txt\u2019 format.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">YOLO also expects a `.yaml` file which contains the details of the paths for the dataset and the class labels in the dataset. You can find the complete details of custom datasets in the <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/docs.ultralytics.com\/datasets\/segment\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/docs.ultralytics.com\/datasets\/segment\/\">dataset guide<\/a>. Since we only have one class in the dataset, our \u2018.yaml\u2019 has the following information:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pre--content\"><span class=\"hljs-attr\">path:<\/span> <span class=\"hljs-string\">\/content\/Data<\/span>\n<span class=\"hljs-attr\">train:<\/span> <span class=\"hljs-string\">images\/train<\/span>\n<span class=\"hljs-attr\">val:<\/span> <span class=\"hljs-string\">images\/val<\/span>\n\n<span class=\"hljs-attr\">nc:<\/span> <span class=\"hljs-number\">1<\/span>\n<span class=\"hljs-attr\">names:<\/span>\n  <span class=\"hljs-attr\">0:<\/span> <span class=\"hljs-string\">duck<\/span><\/span><\/pre>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Note that the path configurations for the dataset differ according to your system.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Now that we have all the necessary details in place, we simply need to start the training:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pre--content\">results = model.train(\n    data=<span class=\"hljs-string\">\"\/content\/config.yaml\"<\/span>,\n    project=<span class=\"hljs-string\">\"YOLOv8-With-Comet\"<\/span>,\n    batch=<span class=\"hljs-number\">12<\/span>,\n    save_json=<span class=\"hljs-literal\">True<\/span>,\n    epochs=<span class=\"hljs-number\">15<\/span>,\n    pretrained=<span class=\"hljs-literal\">True<\/span>\n)<\/span><\/pre>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">As soon as the training is submitted, Comet will automatically create an experiment in your comet workspace to track the run.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Before moving on to the experiment logs, let\u2019s see if our fine-tuned model performs as expected.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pre--content\">results = model.predict(<span class=\"hljs-string\">\"\/content\/Data\/images\/val\/0a411d151f978818.png\"<\/span>, save=<span class=\"hljs-literal\">True<\/span>)<\/span><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6637\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"533\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_MLHMcEA6xHI8dh9pEWTNqw.png\" alt=\"\" class=\"wp-image-6637\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_MLHMcEA6xHI8dh9pEWTNqw.png 709w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_MLHMcEA6xHI8dh9pEWTNqw-300x226.png 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><figcaption class=\"wp-element-caption\">Segmentation results after fine-tuning<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">The model recognizes the duck accurately. This fine-tuned model is now ready for task-specific implementation. Although further training with hyperparameter optimization and a larger dataset is advisable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Logging With Comet<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Comet will track as many experiments as we choose to log and will display metrics for each run.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6636 size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"673\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_wU0Hds92b-WNDOa4vyA2yw.png\" alt=\"\" class=\"wp-image-6636\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_wU0Hds92b-WNDOa4vyA2yw.png 1600w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_wU0Hds92b-WNDOa4vyA2yw-300x126.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_wU0Hds92b-WNDOa4vyA2yw-1024x431.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_wU0Hds92b-WNDOa4vyA2yw-768x323.png 768w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_wU0Hds92b-WNDOa4vyA2yw-1536x646.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><figcaption class=\"wp-element-caption\">Comet Experiments<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">The left panel displays all the experiments (if no name is specified, Comet will assign a random one) and different metrics for each experiment. Now, let&#8217;s take a look at our latest run.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6635 size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"662\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_I20ts7j995-D86-BvtWYaw.png\" alt=\"\" class=\"wp-image-6635\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_I20ts7j995-D86-BvtWYaw.png 1600w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_I20ts7j995-D86-BvtWYaw-300x124.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_I20ts7j995-D86-BvtWYaw-1024x424.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_I20ts7j995-D86-BvtWYaw-768x318.png 768w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_I20ts7j995-D86-BvtWYaw-1536x636.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><figcaption class=\"wp-element-caption\">Experiment metrics automatically logged to Comet<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">First of all, we see some common metrics auto-logged against each epoch. Some of these common metrics include:<\/p>\n\n\n\n<ul class=\"wp-block-list postList\">\n<li>Segment Mask Loss (<code class=\"markup--code markup--li-code\">seg_loss<\/code>)<\/li>\n\n\n\n<li>Class Loss (<code class=\"markup--code markup--li-code\">cls_loss<\/code>)<\/li>\n\n\n\n<li>Precision<\/li>\n\n\n\n<li>Mean Average Precision (<code class=\"markup--code markup--li-code\">mAP50\u201395<\/code>)<\/li>\n<\/ul>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">From this bird\u2019s-eye-view, we can see that the loss has been decreasing and mAP has been increasing, but haven&#8217;t yet leveled off. This means increasing the number of epochs may potentially lead to a better model. It&#8217;s certainly worth checking in further experiment runs!<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">For a more tabular view, we can also view the metrics in a separate pane, as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6634 size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"553\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_FNAkQKq9o02wRRSCJh4gDw.png\" alt=\"\" class=\"wp-image-6634\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_FNAkQKq9o02wRRSCJh4gDw.png 1600w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_FNAkQKq9o02wRRSCJh4gDw-300x104.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_FNAkQKq9o02wRRSCJh4gDw-1024x354.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_FNAkQKq9o02wRRSCJh4gDw-768x265.png 768w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_FNAkQKq9o02wRRSCJh4gDw-1536x531.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><figcaption class=\"wp-element-caption\">Comet automatically logs experiment metrics<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Interactive Confusion Matrix<\/h3>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Comet also automatically logs a confusion matrix of our predictions, which you can find in the Confusion Matrix tab. For more details on how to use the confusion matrix, check out <a href=\"https:\/\/www.comet.com\/site\/blog\/debugging-image-classifiers-with-confusion-matrices\/\">this blog post<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6633\"><img loading=\"lazy\" decoding=\"async\" width=\"1546\" height=\"792\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_h-Nf-tCm8HbsvVK0d6rTng.png\" alt=\"\" class=\"wp-image-6633\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_h-Nf-tCm8HbsvVK0d6rTng.png 1546w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_h-Nf-tCm8HbsvVK0d6rTng-300x154.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_h-Nf-tCm8HbsvVK0d6rTng-1024x525.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_h-Nf-tCm8HbsvVK0d6rTng-768x393.png 768w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_h-Nf-tCm8HbsvVK0d6rTng-1536x787.png 1536w\" sizes=\"auto, (max-width: 1546px) 100vw, 1546px\" \/><figcaption class=\"wp-element-caption\">Confusion matrix automatically logged to Comet<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">From this graphic, we can see that our fine-tuned model detected and segmented 45 ducks from our validation dataset correctly, which represents a 79% success rate over the positive label category.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">System Metrics<\/h3>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Moreover, Comet also keeps a log of system metrics so that we can identify bottlenecks in our process and work to improve them.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-6632 size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"709\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_B7dmqqUMyOtyH9XsVMr58Q.png\" alt=\"\" class=\"wp-image-6632\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_B7dmqqUMyOtyH9XsVMr58Q.png 1600w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_B7dmqqUMyOtyH9XsVMr58Q-300x133.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_B7dmqqUMyOtyH9XsVMr58Q-1024x454.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_B7dmqqUMyOtyH9XsVMr58Q-768x340.png 768w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/1_B7dmqqUMyOtyH9XsVMr58Q-1536x681.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><figcaption class=\"wp-element-caption\">Comet automatically logs system metrics<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">These auto-logged metrics include information like:<\/p>\n\n\n\n<ul class=\"wp-block-list postList\">\n<li>GPU Utilization<\/li>\n\n\n\n<li>GPU Memory Utilization<\/li>\n\n\n\n<li>CPU Utilization<\/li>\n\n\n\n<li>RAM Utilization<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Final Thoughts<\/h2>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Overall, Comet provides a great platform to track and version control your machine learning tasks. It provides an interactive birds-eye view of the entire run to understand model performance and helps take measures for improvement.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">It also stores all experiment details (run configurations, hyper-parameters), graphics, and models, which can contribute to better team collaboration.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">Model fine-tuning is an important part of the machine learning ecosystem. It allows machine learning engineers to skip the hassle of training entire models from scratch and build high-performing task-specific applications. Fine-tuning is performed by loading pre-trained weights from an existing model and training them further to learn the patterns specific to our needs.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">However, the experimentation procedure remains complex. The <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.comet.com\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.comet.com\/\">Comet<\/a> platform automatically tracks all your machine learning runs. It logs all necessary metrics for model evaluation and stores experiment details and trained models for collaboration and future reference.<\/p>\n\n\n\n<p class=\"graf graf--p wp-block-paragraph\">To experience Comet\u2019s full potential, create a <a class=\"markup--anchor markup--p-anchor\" href=\"\/signup\" target=\"_blank\" rel=\"noopener\" data-href=\"\/signup\">free account<\/a> today.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Today, AI developers use computer vision (CV) to incorporate solutions to identify, classify, and respond to objects in real time. Some common tasks include image classification, facial detection, pose estimation, segmentation, etc. With models like YOLOv8 achieving state-of-the-art results on various object detection and semantic segmentation benchmarks, CV has gained remarkable accuracy and efficiency. [&hellip;]<\/p>\n","protected":false},"author":54,"featured_media":6982,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,7],"tags":[40,14,29,47,48],"coauthors":[156],"class_list":["post-6623","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machine-learning","category-tutorials","tag-comet","tag-comet-ml","tag-computer-vision","tag-image-segmentation","tag-yolov8"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fine-tuning YOLOv8 for Image Segmentation with Comet - Comet<\/title>\n<meta name=\"description\" content=\"Learn how to fine-tune Yolov8 for image segmentation and automatically log your results with Comet, a free experiment tracking tool.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fine-tuning YOLOv8 for Image Segmentation with Comet\" \/>\n<meta property=\"og:description\" content=\"Learn how to fine-tune Yolov8 for image segmentation and automatically log your results with Comet, a free experiment tracking tool.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-20T23:28:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-29T14:02:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-28-at-11.51.59-AM.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"304\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Haziqa Sajid\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Haziqa Sajid\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Fine-tuning YOLOv8 for Image Segmentation with Comet - Comet","description":"Learn how to fine-tune Yolov8 for image segmentation and automatically log your results with Comet, a free experiment tracking tool.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/","og_locale":"en_US","og_type":"article","og_title":"Fine-tuning YOLOv8 for Image Segmentation with Comet","og_description":"Learn how to fine-tune Yolov8 for image segmentation and automatically log your results with Comet, a free experiment tracking tool.","og_url":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-07-20T23:28:09+00:00","article_modified_time":"2025-04-29T14:02:40+00:00","og_image":[{"width":300,"height":304,"url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-28-at-11.51.59-AM.png","type":"image\/png"}],"author":"Haziqa Sajid","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Haziqa Sajid","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/"},"author":{"name":"Haziqa Sajid","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/b8e568abee61cd8fd0c5d73b672779da"},"headline":"Fine-tuning YOLOv8 for Image Segmentation with Comet","datePublished":"2023-07-20T23:28:09+00:00","dateModified":"2025-04-29T14:02:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/"},"wordCount":1916,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/#primaryimage"},"thumbnailUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-28-at-11.51.59-AM.png","keywords":["Comet","Comet ML","Computer Vision","image segmentation","YOLOv8"],"articleSection":["Machine Learning","Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/","url":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/","name":"Fine-tuning YOLOv8 for Image Segmentation with Comet - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/#primaryimage"},"thumbnailUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-28-at-11.51.59-AM.png","datePublished":"2023-07-20T23:28:09+00:00","dateModified":"2025-04-29T14:02:40+00:00","description":"Learn how to fine-tune Yolov8 for image segmentation and automatically log your results with Comet, a free experiment tracking tool.","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/#primaryimage","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-28-at-11.51.59-AM.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-28-at-11.51.59-AM.png","width":300,"height":304,"caption":"YOLOv8 + Comet logos with an image of a duck"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/fine-tuning-yolov8-for-image-segmentation-with-comet\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"Fine-tuning YOLOv8 for Image Segmentation with Comet"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/b8e568abee61cd8fd0c5d73b672779da","name":"Haziqa Sajid","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/817879efa0771c090195dd1888fca759","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/cropped-1585931859188-96x96.jpg","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/cropped-1585931859188-96x96.jpg","caption":"Haziqa Sajid"},"url":"https:\/\/www.comet.com\/site\/blog\/author\/haziqa5122gmail-com\/"}]}},"jetpack_featured_media_url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/07\/Screen-Shot-2023-07-28-at-11.51.59-AM.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/6623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/54"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=6623"}],"version-history":[{"count":2,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/6623\/revisions"}],"predecessor-version":[{"id":15811,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/6623\/revisions\/15811"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media\/6982"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=6623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=6623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=6623"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=6623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}