<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Davy Neven on Medium]]></title>
        <description><![CDATA[Stories by Davy Neven on Medium]]></description>
        <link>https://medium.com/@davyneven?source=rss-4045729f2eca------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6qLcPXNAT6By7srvLCKZaA.jpeg</url>
            <title>Stories by Davy Neven on Medium</title>
            <link>https://medium.com/@davyneven?source=rss-4045729f2eca------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:53:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@davyneven/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HowTo: deploying YOLOv8 on AWS Lambda]]></title>
            <link>https://medium.com/@davyneven/howto-deploying-yolov8-on-aws-lambda-9071bbcc40cd?source=rss-4045729f2eca------2</link>
            <guid isPermaLink="false">https://medium.com/p/9071bbcc40cd</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[yolov8]]></category>
            <dc:creator><![CDATA[Davy Neven]]></dc:creator>
            <pubDate>Sat, 11 Nov 2023 14:46:07 GMT</pubDate>
            <atom:updated>2023-11-11T14:46:07.588Z</atom:updated>
            <content:encoded><![CDATA[<h4>A cost-efficient, serverless alternative for cloud deployment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4kI_ixgvAIeECSIHMWHiuQ.jpeg" /></figure><p>Deploying a <a href="https://github.com/ultralytics/ultralytics">YOLOv8</a> model in the cloud presents challenges in balancing speed, cost, and scalability. Utilizing a GPU server offers fast processing but comes at a high cost, especially for sporadic usage. Conversely, opting for a CPU-only server is more economical but sacrifices speed and scalability, requiring complex setups to scale with incoming requests. An effective solution lies in leveraging serverless architectures such as AWS Lambda. Despite its CPU-only setup, AWS Lambda offers seamless scalability, supporting up to 1000 workers in parallel without any complexity. Moreover, you pay solely for the actual compute time, eliminating charges for idle periods.</p><p>In this blog post, I will guide you through deploying a YOLOv8 model on AWS Lambda, with little effort. We will be using the newly introduced “Function URLs” option, which allows us to directly trigger the Lambda function over HTTP, without using AWS Gateway. You can find the accompanying code <a href="https://github.com/trainyolo/YOLOv8-aws-lambda">here</a>.</p><h3>Converting YOLOv8 to ONNX</h3><p>A crucial consideration when working with serverless functions is the need to keep the deployment package as compact as possible. This is important for two key reasons. First, deployment sizes are typically capped at a fixed size (250MB with AWS Lambda when deploying from a Zip package). Second, a smaller package translates to reduced cold-start times for the function. To achieve this, rather than relying on the default Ultralytics package, we’ll export the model to ONNX and use our own ONNX inference library, <a href="https://github.com/trainyolo/YOLO-ONNX/tree/main">YOLO-ONNX</a>. This library is ideal for cloud deployments and embedded devices as it requires only minimal dependencies.</p><p>So, the first step is to convert your YOLOv8 model to ONNX. As an example, we will convert the COCO-pretrained YOLOv8n model. You can follow the same steps to convert your custom model. Want to know how you can train your own custom YOLOv8 detection model, look at my post <a href="https://www.trainyolo.com/blog/how-to-train-yolov8-objection-detection-on-a-custom-dataset">here</a>.</p><pre>from ultralytics import YOLO<br><br># load model<br>model = YOLO(&#39;yolov8n.pt&#39;) # replace with your custom model pt file<br><br># export model<br>model.export(format=&quot;onnx&quot;, dynamic=True)</pre><p>This will result in a new file, “yolov8n.onnx”, which we will deploy using our Lambda function. Note that it is important to set the flag “dynamic”, as this will allow us to run the model with different input sizes, depending on the aspect ratio of the image.</p><h3>The Lambda function</h3><p>There are various methods available for deploying a Lambda function on AWS. In this scenario, I will opt for AWS SAM (Serverless Application Model), which streamlines the process of creating and updating Lambda functions with minimal complexity. Please be aware that you’ll need to install the SAM library, and you can find installation instructions <a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html">here</a>. To follow along, you can download the codebase from <a href="https://github.com/trainyolo/YOLOv8-aws-lambda">this link</a>.</p><p>If using SAM, you need to place your codebase within a designated folder and include a requirements file listing the necessary libraries. Our folder structure looks as follows:</p><pre>|lambda-codebase <br>    |models <br>        yolov8n.onnx <br>    app.py <br>    requirements.txt</pre><p>Within the model’s directory, you should put the ONNX model that we converted before. For increased versatility, an alternative approach could involve uploading the model to an S3 bucket and downloading it at runtime. However, we leave that for another post.</p><p>In the “requirements.txt” file, you’ll list the dependencies necessary for your setup. In this specific case, the sole requirement will be our ONNX inference library.</p><pre>git+https://github.com/trainyolo/YOLO-ONNX.git</pre><p>Next, we define our application in “app.py”</p><pre>from yolo_onnx.yolov8_onnx import YOLOv8<br>import json<br>import base64<br>from io import BytesIO<br>from PIL import Image<br><br># Initialize YOLOv8 object detector as a global param<br>yolov8_detector = YOLOv8(&#39;./models/yolov8n.onnx&#39;)<br><br>def main(event, context):<br><br>    # get payload<br>    body = json.loads(event[&#39;body&#39;])<br><br>    # get params<br>    img_b64 = body[&#39;image&#39;]<br>    size = body.get(&#39;size&#39;, 640)<br>    conf_thres = body.get(&#39;conf_thres&#39;, 0.3)<br>    iou_thres = body.get(&#39;iou_thres&#39;, 0.5)<br><br>    # open image<br>    img =   Image.open(BytesIO(base64.b64decode(img_b64.encode(&#39;ascii&#39;))))<br><br>    # infer result<br>    detections = yolov8_detector(img, size=size, conf_thres=conf_thres, iou_thres=iou_thres)<br><br>    # return result<br>    return {<br>        &quot;statusCode&quot;: 200,<br>        &quot;body&quot;: json.dumps({<br>            &quot;detections&quot;: detections<br>        }),<br>    }</pre><p>Let’s go over it step by step:</p><pre># Initialize YOLOv8 object detector as a global param<br>yolov8_detector = YOLOv8(&#39;./models/yolov8n.onnx&#39;)</pre><p>The YOLOv8 model is initialized as a global variable. This way, the model remains in memory during the lifetime of the function and doesn’t have to be re-initialized with every function call.</p><pre># get payload<br>body = json.loads(event[&#39;body&#39;])<br><br># get params<br>img_b64 = body[&#39;image&#39;]<br>size = body.get(&#39;size&#39;, 640)<br>conf_thres = body.get(&#39;conf_thres&#39;, 0.3)<br>iou_thres = body.get(&#39;iou_thres&#39;, 0.5)</pre><p>The incoming request is parsed and the relevant info is extracted. For this example, I will pass the input image as a b64-encoded string, but another option might be to pass the URL to the image and download the image locally. Optionally, I also provide the option to pass the image size, confidence threshold, and IOU threshold.</p><pre># open image<br>img = Image.open(BytesIO(base64.b64decode(img_b64.encode(&#39;ascii&#39;))))<br><br># infer result<br>detections=yolov8_detector(img, size=size, conf_thres=conf_thres, iou_thres=iou_thres)</pre><p>The image is decoded, after which it is passed to the model and the detected objects are returned.</p><pre># return result<br>return {<br>    &quot;statusCode&quot;: 200,<br>    &quot;body&quot;: json.dumps({<br>        &quot;detections&quot;: detections<br>    }),<br>}</pre><p>Finally, the detections are returned.</p><h3>Deploying the Lambda function</h3><p>Before deploying the lambda function with SAM, you first need to define the template in “template.yaml”:</p><pre>AWSTemplateFormatVersion: &#39;2010-09-09&#39;<br>Transform: AWS::Serverless-2016-10-31<br>Description: &gt;<br>  yolov8-inference<br><br>Resources:<br>  YOLOV8Function:<br>    Type: AWS::Serverless::Function<br>    Properties:<br>      CodeUri: lambda-codebase/<br>      Handler: app.main<br>      Runtime: python3.9<br>      MemorySize: 10240<br>      Timeout: 60<br>      FunctionUrlConfig:<br>        AuthType: NONE<br><br>Outputs:<br>  YOLOV8FunctionUrlEndpoint:<br>      Description: &quot;URL Endpoint&quot;<br>      Value:<br>        Fn::GetAtt: YOLOV8FunctionUrl.FunctionUrl</pre><p>It’s quite straightforward, so I won’t go into much detail. The only thing worth mentioning is that I set the memory size of the function to the maximum value of 10240MB. By doing so, the maximum amount of cores (6) is assigned to the function, increasing its performance. I also set the authentication to NONE, so the API is easily accessible for this demo. However, for a production setting, it is a good idea to add some authentication.</p><p>Now you can build and deploy the function using the command line:</p><pre>$ sam build --use-container<br>$ sam deploy --guided</pre><p>Note that with the flag “use-container”, the function is built within a docker container. When succeeded, the function URL will be printed in the terminal.</p><h3>Test the Lambda function</h3><p>Let’s test our deployed lambda function. For this, I wrote a small Python script, but you can trigger the API using your preferred language. The script encodes an image to a b64-encoded string and queries our endpoint. Next, the returned predictions are displayed on the image using OpenCV.</p><pre>import requests<br>import cv2<br>import base64<br><br>IMG_PATH = &#39;./elevate-nYgy58eb9aw-unsplash.jpg&#39;<br>API_URL = &#39;REPLACE_WITH_YOUR_ENDPOINT_URL&#39;<br><br># encode image to b64<br>with open(IMG_PATH, &#39;rb&#39;) as f:<br>    img_b64 = base64.b64encode(f.read()).decode(&#39;ascii&#39;)<br><br># trigger api<br>result = requests.get(API_URL, json={&quot;image&quot;: img_b64})<br><br># extract detections<br>detections = result.json()[&#39;detections&#39;]<br>print(detections)<br><br># display detections<br>img = cv2.imread(IMG_PATH)<br>for det in detections:<br>    x0,y0,x1,y1 = det[&#39;bbox&#39;]<br>    img = cv2.rectangle(img, (x0,y0), (x1,y1), (255,0,0), 4)<br>cv2.imwrite(&#39;./output.jpg&#39;, img)</pre><p>The API returns 5 detected objects:</p><pre>[<br>  {&quot;bbox&quot;: [0, 264, 473, 1351], &quot;score&quot;: 0.932, &quot;class_id&quot;: 0}, <br>  {&quot;bbox&quot;: [1286, 199, 1918, 1353], &quot;score&quot;: 0.93, &quot;class_id&quot;: 0}, <br>  {&quot;bbox&quot;: [1047, 288, 1534, 1348], &quot;score&quot;: 0.895, &quot;class_id&quot;: 0}, <br>  {&quot;bbox&quot;: [494, 433, 943, 1357], &quot;score&quot;: 0.895, &quot;class_id&quot;: 0}, <br>  {&quot;bbox&quot;: [1021, 748, 1111, 901], &quot;score&quot;: 0.679, &quot;class_id&quot;: 41}<br>]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5d6T1Pa6QFZ9lijA.jpg" /><figcaption>Object detection results, image from <a href="https://unsplash.com/photos/four-women-talking-to-each-other-holding-clear-drinking-glasses-while-standing-near-wall-with-graffiti-during-daytime-oRl7BoX7QCE">Unsplash</a>.</figcaption></figure><h3>Conclusion</h3><p>In this blog post, I’ve demonstrated the deployment of a YOLOv8 detection model on AWS Lambda. When appropriately configured, this setup becomes a powerful inference server, making it well-suited for integration into a production environment where it can efficiently scale to handle a high volume of requests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9071bbcc40cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Train Gold-YOLO object detection on a custom dataset with trainYOLO.]]></title>
            <link>https://medium.com/@davyneven/train-gold-yolo-object-detection-on-a-custom-dataset-with-trainyolo-cfbb3cdc1b05?source=rss-4045729f2eca------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfbb3cdc1b05</guid>
            <category><![CDATA[yolov5]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[yolov8]]></category>
            <category><![CDATA[pytorch]]></category>
            <dc:creator><![CDATA[Davy Neven]]></dc:creator>
            <pubDate>Thu, 28 Sep 2023 09:13:21 GMT</pubDate>
            <atom:updated>2023-09-28T13:25:58.458Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W1SMtlNaxZgUymS5RuDDqg.png" /></figure><p><a href="https://arxiv.org/pdf/2309.11331v3.pdf">Gold-YOLO</a> is the newest addition to the YOLO family and was developed by researchers from <a href="http://dev3.noahlab.com.hk/">Noah’s Ark Lab</a> (Huawei). They scored new highs on the COCO benchmark and surpassed the popular YOLOv8 algorithm, both in accuracy and speed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*EgBMXiSU7MTAiyfAPV3C5Q.png" /><figcaption>Comparison of state-of-the-art efficient object detectors on Tesla T4 GPU. Both latency and throughput (batch size of 32) are given, using TensorRT8. Picture taken from <a href="https://arxiv.org/pdf/2309.11331v3.pdf">original paper</a>.</figcaption></figure><p>How did they do that? Well, they achieved these results by mainly redesigning the mechanism that fuses the features of multiple resolutions in the decoder, which up to now was mostly done with so-called Feature Pyramid Networks. They developed a new mechanism, called Gather-and-Distribute, which boosts the multi-scale feature fusion capabilities and achieves an ideal balance between latency and accuracy across all model scales. Like most YOLO versions, they also release multiple versions, ranging from gold_yolo-n to gold_yolo-l, trading speed for accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ANQUzenS1klL2hGrGjxUEA.png" /><figcaption>The Gold-YOLO architecture. Picture taken from <a href="https://arxiv.org/pdf/2309.11331v3.pdf">original paper</a>.</figcaption></figure><p>In this tutorial, we will first take a look at their COCO-pre-trained model and next, we will guide you through the steps on how to train your own Gold-YOLO detector on your own data. For this, we will use the <a href="https://trainyolo.com/">trainYOLO platform</a>. So if you don’t have an account yet, make sure you create a free account <a href="https://app.trainyolo.com/signup">here</a>.</p><h3>Inference with a pre-trained COCO model</h3><p>Let’s take a look at running Gold-YOLO using a pre-trained COCO model. We start by installing the library, downloading the gold-yolo-n model (the smallest one available), and running the model on some demo images. You can find the Colab Notebook <a href="https://colab.research.google.com/drive/1bdvd_3yo-9bYAeLNIHv3_3pptcxNoa3l?usp=sharing">here</a>.</p><pre># install gold-YOLO<br>!git clone https://github.com/huawei-noah/Efficient-Computing.git<br>%cd Efficient-Computing/Detection/Gold-YOLO<br>%pip install -qr requirements.txt<br><br># Download COCO-pretrained model<br>!wget -O Gold_n_dist.pt &quot;https://drive.google.com/uc?export=download&amp;id=1nJ9x8Q1Ic-DnCs0ruBh-Zy3t9-IyO9LR&quot;<br><br># infer on demo images<br>!sed -i &quot;s/inferer = Inferer(source, weights, device, yaml, img_size, half)/inferer = Inferer(source, False, None, weights, device, yaml, img_size, half)/g&quot; ./tools/infer.py<br>!python tools/infer.py --weights ./Gold_n_dist.pt --source ./data/images --conf-thres 0.4</pre><p>The results are displayed below. We notice that with the default confidence value of 0.4, the horse and football are not detected. When lowering the threshold to 0.2, they are detected, although there also appear some false positives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/0*461l43Z4KgSofq-z" /><figcaption>Results for gold-yolo-n.pt with a confidence of 0.4</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/0*fKCRYy6HjsogQIin" /><figcaption>Results for gold-yolo-n.pt with a confidence of 0.2</figcaption></figure><h3>Training a custom Gold-YOLO model on your own dataset</h3><p>Next, we will go over the steps on how to train your own Gold-YOLO object detector on your own dataset. We will guide you through the steps of labeling your data and training the model using the <a href="https://www.trainyolo.com/">trainYOLO</a> platform. As an example, we will train a Padel player detector for game analysis.</p><h4>1. Create a new project</h4><p>We start by creating a new project, which will hold our images, clicking on the green ‘plus’ icon. We set the name to<strong> padel</strong>, keep the annotation type at <strong>Bounding Boxes,</strong> and set a single category <strong>player</strong>. If you have multiple categories, you can add more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*-aXZHC8n5RyqNEI4" /></figure><h4>2. Upload your images</h4><p>To upload images to our project, go to the data tab and click on the green ‘plus’ icon. Select the images you would like to upload and click upload. In this example, we will upload some images of a Padel game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*PB1hy7msxbWx6Pm7" /></figure><h4>3. Label your images</h4><p>Once we have uploaded the images, we start labeling. By clicking on an image, you enter the labeling editor. By selecting the bounding box tool in the left menu, we can draw a box around each object, in our case each player. Note that if you have multiple object categories, you need to set the right category using the drop-down list on top. Once finished, you can use the arrow keys on top to go to the next image or select a specific one in the carousel at the bottom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*HlxzPo12ggDvPPDB" /></figure><p>Once we have labeled our images, we can start training our object detector.</p><h4>4. Train Gold-YOLO object detector</h4><p>Next, we will be going over all the steps on how to train the Gold-YOLO object detector. You can find all the steps in this <a href="https://colab.research.google.com/drive/1UiG0bTPG-wfbTaDGPUSrGj5e9YRoXasi?usp=sharing">colab notebook</a>. You only need to fill in your trainYOLO API key (which you find under your avatar) and Project Name and run Runtime -&gt; Run all.</p><p>Let’s start by downloading our labeled images. To do so, we need to install the trainYOLO python library and enter our API key (which you can find under your avatar) and Project name. As Gold-YOLO is based on the YOLOv6 codebase, we use the YOLOv6 export format.</p><pre># install trainyolo library<br>%pip install -qU trainyolo-py<br><br># Enter parameters<br>API_KEY = &quot;__YOUR_API_KEY__&quot;<br>PROJECT_NAME = &quot;__YOUR_PROJECT_NAME__&quot;<br><br># Download labeled data<br>from trainyolo.client import Client, Project<br><br>client = Client(API_KEY)<br><br>project = Project.get_by_name(client, PROJECT_NAME)<br>project_location = project.pull(location=&#39;./data&#39;, format=&#39;yolov6&#39;)</pre><p>Once our dataset is downloaded, we clone the Gold-YOLO repository and download the COCO-pre-trained model (version n)</p><pre># install gold-YOLO<br>!git clone https://github.com/huawei-noah/Efficient-Computing.git<br>%cd Efficient-Computing/Detection/Gold-YOLO<br>%pip install -qr requirements.txt<br><br># Download gold_yolo_n.pt<br>!wget -O Gold_n_dist.pt &quot;https://drive.google.com/uc?export=download&amp;id=1nJ9x8Q1Ic-DnCs0ruBh-Zy3t9-IyO9LR&quot;<br><br># modify config to start from pre-trained model<br>!sed -i &quot;s/pretrained=None/pretrained=&#39;.\/Gold_n_dist.pt&#39;/g&quot; ./configs/gold_yolo-n.py</pre><p>Now we have everything ready to start training our model. We can set the image size, number of epochs, and batch_size:</p><pre># train model<br>IM_SIZE = 640<br>N_EPOCHS = 50<br>BATCH_SIZE = 4<br>!python tools/train.py --img-size $IM_SIZE --epoch $N_EPOCHS --batch $BATCH_SIZE --conf configs/gold_yolo-n.py --data &quot;{project_location}/dataset.yaml&quot; --fuse_ab --device 0</pre><p>Once training is finished, we can infer the model on our validation set and visualize the results. Note that there is currently still a small bug in the codebase, which we fix with the sed command:</p><pre># infer results on validation set<br>CONFIDENCE = 0.4<br>!sed -i &quot;s/inferer = Inferer(source, weights, device, yaml, img_size, half)/inferer = Inferer(source, False, None, weights, device, yaml, img_size, half)/g&quot; ./tools/infer.py<br>!python tools/infer.py --weights ./runs/train/exp/weights/best_ckpt.pt --source &quot;{project_location}/images/val&quot; --conf-thres $CONFIDENCE</pre><p>You can find the results under ‘runs/inference/’. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n5kbDFL62NpINwMbXBNyUA.jpeg" /></figure><h3>Conclusion</h3><p>In this tutorial, we went through the steps on how to train your own Gold-YOLO object detector. For more details, you can take a look at their official <a href="https://github.com/huawei-noah/Efficient-Computing/tree/master/Detection/Gold-YOLO">GitHub repository</a>. If you want to compare with YOLOv8, you can check out our tutorial on how to <a href="https://www.trainyolo.com/blog/how-to-train-yolov8-objection-detection-on-a-custom-dataset">train your own YOLOv8 object detector</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfbb3cdc1b05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effortless Semantic Segmentation with trainYOLO]]></title>
            <link>https://medium.com/@davyneven/effortless-semantic-segmentation-with-trainyolo-50b083a0d7d4?source=rss-4045729f2eca------2</link>
            <guid isPermaLink="false">https://medium.com/p/50b083a0d7d4</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[unet]]></category>
            <category><![CDATA[image-labeling]]></category>
            <category><![CDATA[semantic-segmentation]]></category>
            <category><![CDATA[deeplab]]></category>
            <dc:creator><![CDATA[Davy Neven]]></dc:creator>
            <pubDate>Tue, 19 Sep 2023 18:46:35 GMT</pubDate>
            <atom:updated>2023-09-19T18:53:10.868Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKmS08bllQ8SCajIPyiBBQ.png" /></figure><p><a href="https://trainyolo.com/">trainYOLO</a> has been the go-to platform for <a href="https://www.trainyolo.com/blog/how-to-train-yolov8-objection-detection-on-a-custom-dataset">object detection</a>, <a href="https://www.trainyolo.com/blog/how-to-train-yolov8-segmentation-on-a-custom-dataset">instance segmentation</a>, <a href="https://www.trainyolo.com/blog/train-yolov8-pose-keypoint-detection-model-on-your-own-data">keypoint detection</a>, and <a href="https://www.trainyolo.com/blog/accelerating-human-pose-labeling">human pose estimation</a>. Yet, there was one essential task that was missing from our arsenal: semantic segmentation. But worry not, as we are excited to announce the integration of an easy-to-use semantic segmentation interface into our platform. And if that’s not all — we are also excited to share that we have open-sourced <a href="https://github.com/trainyolo/segment">Segment</a>, a semantic segmentation library developed in PyTorch and integrated with our platform. With this integration, you can effortlessly train popular segmentation models like Unet or Deeplab from scratch immediately after labeling your images. And as usual, you can upload your trained models directly to our platform, and take advantage of our built-in model-assisted labeling to boost your labeling speed. You can try it for free <a href="https://trainyolo.com/">here</a>.</p><h3>What is Semantic Segmentation?</h3><p>Semantic segmentation is a computer vision technique that assigns a semantic label to each pixel in an image. Unlike instance segmentation, there is no distinction between different objects. Semantic segmentation is frequently used in the following industries:</p><ul><li>Autonomous driving: Semantic segmentation plays a crucial role in understanding the surrounding environment like free space and road boundaries.</li><li>Medical Imaging: In medical images, semantic segmentation is used for analyzing and interpreting medical scans, such as MRIs, CT scans and histopathology images.</li><li>Robotics: Semantic segmentation is utilized in robotics for various applications, but most importantly for perceiving the environment.</li><li>Agtech: In agtech, semantic segmentation is often used for crop segmentation.</li><li>Satellite Imagery and Remote Sensing: Semantic segmentation is employed in satellite imagery analysis to identify and classify land cover, vegetation, water bodies, buildings, roads, and other geographical features.</li><li>Augmented and Virtual Reality: Semantic segmentation is used in AR and VR applications for real-time scene understanding and virtual object placement. By segmenting the scene into meaningful regions, it enables virtual objects to be seamlessly integrated into the real-world environment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/0*Z8b40YEM7CTX-e2b.jpg" /><figcaption><em>Some applications of semantic segmentation: medical imaging, road scene understanding, crop segmentation and indoor navigation.</em></figcaption></figure><h3>Labeling interface</h3><p>The trainYOLO platform offers a variety of annotation tools to suit different labeling requirements.</p><p>a) Brush Tool: With the brush tool, annotators can easily label or remove regions of interest. With its adaptive size, it is easy to use on both small and large regions and ideal to make small corrections in combination with either SAM or model-assisted labeling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*wQo-GmJUK4iSaoMI.gif" /><figcaption><em>Brush tool</em></figcaption></figure><p>b) Polygon Tool: The polygon tool provides an easy way to label regions with clearly defined contours. It enables annotators to create accurate shapes that align with the object boundaries, ensuring precise masks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*wu3AXt9-CbRbFhTb.gif" /><figcaption><em>Polygon tool</em></figcaption></figure><p>c) SAM (Segment Anything Model): Our integration of Meta’s Segment Anything Model makes it easy to label regions with a few clicks. If more precision is required, you can easily add or remove the mask by making use of the brush tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*dAc7otYHJLVxZkVQ.gif" /><figcaption><em>SAM tool</em></figcaption></figure><h3>Segment library: easily train UNet, DeepLab, and other Segmentation models‍</h3><p>To lower the threshold to get started with semantic segmentation, we are releasing our Segment library, a semantic segmentation training framework written in PyTorch. So after labeling your images, you can directly train popular semantic segmentation networks like UNet or DeepLab(V3+) with all sorts of encoders like Resnet, Resnext, MobileNet, EfficientNet, and even the recently released Mix Vision transformer. This seamless integration eliminates the need for complex setup procedures, enabling users to focus on model development and improvement.‍</p><p>More importantly, is that you can upload your trained segmentation models to our platform for model-assisted labeling. By leveraging the predictions from your trained models, you can significantly reduce annotation time and effort. Annotators can review and refine the model predictions, ensuring high-quality annotations while boosting the labeling process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*FoE8ghVpNMQU2cyR.gif" /><figcaption><em>Model-assisted labeling with Unet (resnet18) for crack segmentation</em></figcaption></figure><h3>Conclusion</h3><p>We have added semantic segmentation to the trainYOLO platform and released our Segment library, which makes it easy to train segmentation models on your labeled images.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50b083a0d7d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accelerating Human Pose Labeling for YOLOv8]]></title>
            <link>https://medium.com/@davyneven/accelerating-human-pose-labeling-dd6d1db8c16e?source=rss-4045729f2eca------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd6d1db8c16e</guid>
            <category><![CDATA[labeling-annotating]]></category>
            <category><![CDATA[human-pose-estimation]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[yolov8]]></category>
            <dc:creator><![CDATA[Davy Neven]]></dc:creator>
            <pubDate>Thu, 25 May 2023 15:05:57 GMT</pubDate>
            <atom:updated>2023-05-30T14:11:10.499Z</atom:updated>
            <content:encoded><![CDATA[<h4>Effortless Efficiency with trainYOLO</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s8Qa_Qffn8OwCDUb2FNkyQ.png" /></figure><p>In computer vision, accurate human pose labeling plays a crucial role in a wide range of applications, from action recognition to sports analytics. While there are already some pre-trained models available, like for example Ultralytics’ YOLOv8, they often require some finetuning on the task at hand. However, the process of manually annotating human pose skeletons is often time-consuming and tedious. Recognizing this challenge, we at <a href="https://trainyolo.com/">trainYOLO</a> have introduced innovative automation tools that significantly streamline the labeling and training of state-of-the-art pose estimation models. In this blog post, we will explore the automation of human pose labeling and unveil trainYOLO’s game-changing features that enhance both accuracy and efficiency. If you like to try it out for yourself, create a free account <a href="https://trainyolo.com/">here</a>.</p><p>‍</p><p><strong>The Challenge of Manual Human Pose Labeling</strong></p><p>Traditionally, labeling human pose skeletons has required manual intervention, where human annotators meticulously mark keypoints on each person’s body. This process involves significant effort and expertise, and as the complexity of the images increases, so does the time and resources required. It is a laborious task that hampers the pace of model development and deployment.</p><p>‍</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*cqM1W9mnsM5ZEOax.gif" /><figcaption>Manually labeling on the trainYOLO platform.</figcaption></figure><p>‍</p><p>To make the labeling process more efficient, we at trainYOLO have developed and integrated two main ways of automation. On the one hand, we introduce our Any-Pose automation tool, which automatically predicts all 17 keypoints given a bounding box. On the other hand, we introduce model-assisted labeling, which directly predicts skeletons for each person in the image. Both tools combined deliver an unprecedented labeling speed-up unseen in any other labeling tool.</p><p>‍</p><p><strong>Any-Pose Automation Tool</strong></p><p>trainYOLO addresses the challenges associated with manual human pose labeling by introducing the revolutionary Any-Pose automation tool. This advanced feature automatically predicts human poses given a bounding box around a person. The Any-Pose automation tool is scale-agnostic, meaning it efficiently handles both large and small individuals within an image.</p><p>‍</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*Z-uhg804w0DM_vzl.gif" /><figcaption>Automatically predict the location of keypoints using our AI Assistant Any-Pose.</figcaption></figure><p>‍</p><p>Any-Pose automation tool revolutionizes the labeling process by accelerating the skeleton annotation almost 10 times compared to manual labeling. By eliminating the need for annotators to individually mark each key point on a person’s body, trainYOLO empowers users to label human poses with remarkable efficiency and accuracy.</p><p>‍</p><p><strong>Model-Assisted Labeling</strong></p><p>trainYOLO takes automation a step further with its model-assisted labeling capabilities. By integrating state-of-the-art pose models like YOLOv8-Pose, the platform drastically accelerates the annotation process for images containing multiple persons. Instead of manually labeling every individual, users can rely on the powerful pose model to detect and label persons automatically.</p><p>‍</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*xOWNTsSboDrcXZ43.gif" /><figcaption>Model-assisted labeling.</figcaption></figure><p>‍</p><p>With model-assisted labeling, users can swiftly review the results and focus on removing false positives and labeling any missing persons. This targeted approach optimizes the labeling workflow, reducing the overall time and effort required while maintaining high annotation quality.</p><p>‍</p><p><strong>Combining Any-Pose and Model-Assisted Labeling</strong></p><p>trainYOLO offers a holistic solution for human pose labeling by allowing users to combine the benefits of Any-Pose automation and model-assisted labeling. Users can leverage the Any-Pose tool to rapidly annotate individual poses within a bounding box, and then employ YOLOv8-Pose to handle images with multiple persons.</p><p>‍</p><p>By leveraging both automation tools, users can significantly reduce the manual effort in labeling human pose skeletons. This not only boosts productivity but also enhances the scalability of the labeling process, enabling faster model development and deployment.</p><p>‍</p><p><strong>Conclusion</strong></p><p>The automation of human pose labeling is a game-changer for computer vision applications, and trainYOLO stands at the forefront of this technological advancement. With the introduction of the Any-Pose automation tool and model-assisted labeling, trainYOLO empowers users to label human pose skeletons with unprecedented speed and accuracy.</p><p>By automating the tedious and time-consuming aspects of the labeling process, trainYOLO enables researchers, developers, and businesses to focus on higher-level tasks, such as model refinement and application development.</p><p>If you like to learn more, check out our other blog posts <a href="https://trainyolo.com/blog">here</a>.</p><p>Originally published at <a href="https://www.trainyolo.com/blog/accelerating-human-pose-labeling">https://www.trainyolo.com/blog</a> on May 24, 2023.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd6d1db8c16e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to train YOLOv8 pose/keypoint detection model on your own data]]></title>
            <link>https://medium.com/@davyneven/how-to-train-yolov8-pose-keypoint-detection-model-on-your-own-data-59ffb5b90ca2?source=rss-4045729f2eca------2</link>
            <guid isPermaLink="false">https://medium.com/p/59ffb5b90ca2</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[yolov8]]></category>
            <category><![CDATA[yolov7]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[pose-estimation]]></category>
            <dc:creator><![CDATA[Davy Neven]]></dc:creator>
            <pubDate>Thu, 11 May 2023 19:45:57 GMT</pubDate>
            <atom:updated>2023-05-11T19:45:57.977Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*ofI07XcJr4exx6K0oevNzg.jpeg" /></figure><p>Keypoint detection is a crucial aspect of computer vision applications, empowering tasks such as human pose estimation and robotic manipulation. In this tutorial, we will guide you through the process of training a custom keypoint detection model using the Ultralytics YOLOv8-pose model and the trainYOLO platform. Specifically, we will train a model to detect whiteboard markers, with separate keypoints for the top and bottom parts. From labeling your dataset to utilizing model-assisted labeling, we’ll cover each step to help you build an accurate keypoint detector. Let’s get started!</p><h3>Step 1: Create a New Project</h3><p>Begin by creating a new project on the trainYOLO platform. Sign in to your trainYOLO account or create a free account <a href="https://trainyolo.com/">here</a> if you don’t have one. Click on the green ‘plus’ icon and set the project visibility to either Public or Private, depending on your preference. For this example, we name the project “Whiteboard Markers” and select the annotation type Keypoints. We add a single object category “Marker” and include two keypoint categories: “Top” and “Bottom.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*T71EXKOJPJ4_gBEOWtFTzw.gif" /></figure><h3>Step 2: Upload Your Images</h3><p>Navigate to the data tab within your project and click on the green ‘plus’ icon to upload your images. Select the images you want to use for training, we will upload 123 images of whiteboard markers in various configurations, and click upload. Keep in mind that for more complex use cases, a larger number of images might be necessary to train an optimal model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*zXq94vYh5Ll3ujniP8aBBg.gif" /></figure><h3>Step 3: Label Your Images</h3><p>Once your images are uploaded, proceed to label each image. By clicking on an image you enter the labeling editor. Use the box tool from the left menu to label each object (in our case each marker) accurately. Before drawing a bounding box, ensure that the correct object category is selected on top, and draw a box around the object by clicking once on the upper-left corner and once on the lower-right corner. Next, label each keypoint by clicking on the corresponding spot. Use the arrow keys or the carousel at the bottom to navigate between images and label them accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*f3F3RgOTQUHT07PMVBcCQQ.gif" /></figure><h3>Step 4: Train the YOLOv8 Model</h3><p>After labeling a sufficient number of images, it’s time to train your custom YOLOv8 keypoint detection model. For simplicity, we will use the preconfigured Google Colab notebooks provided by trainYOLO. Therefore, go to the model’s tab in your project and select the YOLOv8 notebook by clicking the green ‘plus’ icon. This notebook comes preconfigured with the necessary settings. Fill in your API key (available by clicking on your avatar) and project name. Leave the other parameters as default, then start the training session by clicking “Runtime” and selecting “Run all.” The notebook will download your dataset, train the model, and upload the trained model to your project, providing you with a custom keypoint detection model in no time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*bztoW3QmMX4JtTPdi_CUJA.gif" /></figure><p>Once your model is trained, you can refresh your model’s page, and you should see your newly trained model in the list. From here, you can improve your model by labeling more images, or training with other hyperparameters.</p><p>For our example, we got the following metrics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*HPdX0vsJlizZNSBXkys_lA.png" /></figure><h3>Step 5: Model-Assisted Labeling</h3><p>Utilize the power of model-assisted labeling to speed up your labeling. Whenever a new model version is added to your project, it automatically becomes a labeling assistant. Rather than labeling each image from scratch, you can now verify or correct the model predictions. This significantly speeds up the labeling process. Access the labeling assistant by clicking on the magic paintbrush icon in the left menu. It will load the model predictions, From here, you can remove false-positive detections, and modify wrongly placed keypoints. To change a keypoint position, first click on the bounding box to select the object, and next you can simply drag the point to the desired location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*uVcJebGt_9yE_YGASzrR2g.gif" /></figure><h3>Next Steps:</h3><p>Once you have labeled more images, you can train more versions and experiment with hyperparameters like image size and model type to optimize your keypoint detection model. Have fun training models!</p><p><em>Originally published at </em><a href="https://www.trainyolo.com/blog"><em>https://www.trainyolo.com/blog</em></a><em> on May 11, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59ffb5b90ca2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Model-assisted labeling for YOLOv8]]></title>
            <link>https://medium.com/@davyneven/model-assisted-labeling-for-yolov8-896cb51aeaeb?source=rss-4045729f2eca------2</link>
            <guid isPermaLink="false">https://medium.com/p/896cb51aeaeb</guid>
            <category><![CDATA[biomedical]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[yolov8]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Davy Neven]]></dc:creator>
            <pubDate>Tue, 21 Mar 2023 14:11:43 GMT</pubDate>
            <atom:updated>2023-03-21T14:11:43.599Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to save both time and money</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Y-7ZtA7ucMRxFhwTohzgYQ.jpeg" /></figure><p>Object detection and instance segmentation are crucial tasks in computer vision, with numerous applications ranging from self-driving cars to medical image analysis. However, a significant challenge is a need for large labeled datasets to train accurate models. Labeling datasets manually can be a tedious and time-consuming task, often requiring significant effort and resources.</p><p>To address this challenge, model-assisted labeling has emerged as a powerful technique that can save time and money by reducing the number of manual annotations required. In this blog post, we will explore how model-assisted labeling works and how it can accelerate the labeling process for both object detection and instance segmentation. As an example, we will demonstrate how you can use the <a href="https://trainyolo.com/">trainYOLO platform</a> to easily apply this method to your YOLOv8 object detection or instance segmentation training.</p><h3>What is Model-Assisted Labeling?</h3><p>Model-assisted labeling is a process that uses a (pre-)trained machine learning model to generate annotations for a dataset automatically. Specifically, the model is used to predict the labels of the objects in the dataset, and these predictions are then used as a starting point for the manual labeling process. The annotations generated by the model only need to be refined or corrected by human annotators, reducing the total number of annotations required as opposed to labeling from scratch.</p><p>For example, in object detection tasks, a pre-trained model can be used to generate bounding boxes around the objects in an image. These bounding boxes can then be used as a starting point for the manual labeling process, with human annotators refining and correcting the locations of the boxes as necessary. This approach can save significant time and effort compared to manual labeling from scratch. As an example, see the difference between manually labeling an image of pollen versus using a model-assisted method:‍</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*qY0ykktAtngrfBw8.gif" /><figcaption>Left: manual labeling, right: model-assisted labeling. As demonstrated, model-assisted labeling definitely increases labeling speed.</figcaption></figure><p>One of the key benefits of model-assisted labeling is that it enables a feedback loop between training the model and labeling more images. As the model gets better at generating initial annotations, the amount of manual work required decreases, allowing more time to be spent on training and improving the model. This cycle can be repeated multiple times, with each iteration resulting in a more accurate model and fewer manual annotations required. By continually improving both the model and the dataset, the overall accuracy of the object detection system can be significantly improved. Therefore, it is important to keep iterating and fine-tuning the model and dataset to achieve the best results possible.‍</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pe4vMQR52PIHS_lX.png" /><figcaption>After each training iteration, the model’s accuracy increases and the manual labeling time decreases.</figcaption></figure><h3>How to use model-assisted labeling on trainYOLO</h3><p>The <a href="https://trainyolo.com/">trainYOLO</a> platform streamlines the process of model-assisted labeling for object detection and instance segmentation algorithms like YOLOv8 or YOLOv5. After each training iteration, you can upload your model to the platform and generate predictions with a click of a button. No need to upload predictions yourself.</p><p>As an example, let’s take a look at the steps to train a YOLOv8 pollen detector using the model-assisted labeling approach. For a more detailed guide about how to upload, label and train algorithms like YOLOv5 or YOLOv8 using trainYOLO, take a look at our other posts: <a href="https://www.trainyolo.com/blog/how-to-train-yolov5-object-detection-on-a-custom-dataset">YOLOv5 object detection</a>, <a href="https://www.trainyolo.com/blog/how-to-train-yolov8-objection-detection-on-a-custom-dataset">YOLOv8 object detection</a>, <a href="https://www.trainyolo.com/blog/how-to-train-yolov8-segmentation-on-a-custom-dataset">YOLOv8 instance segmentation</a>.‍</p><p><strong>1. Label an initial batch manually</strong></p><p>To kickstart the process of model-assisted labeling, we begin by manually labeling the first batch of images. In this stage, it is crucial to choose a diverse set of images to improve the trained model’s generalization. Also, the number of images that need to be labeled manually in this first batch varies depending on the task. If the images have many objects, fewer are required, and vice versa. In any case, the initial trained model’s performance will indicate if more manual labeling is necessary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*VCzxlhrbUsqGoBsD.gif" /></figure><p>‍‍<strong>2. Train an initial model</strong></p><p>Once the first batch of images is labeled, it’s time to train the initial model. With trainYOLO’s preconfigured Colab notebooks, training a YOLOv5 or YOLOv8 object detection or instance segmentation model is straightforward (see <a href="https://www.trainyolo.com/blog/how-to-train-yolov8-objection-detection-on-a-custom-dataset">here</a> for a detailed guide on how to start training). All you need to do is fill in your <strong>API key</strong> and <strong>Project name</strong> to start the training. Once finished, the model and its metrics are uploaded to our platform, where it is automatically deployed for use in model-assisted labeling. In our case, we labeled 50 images (comprising 1221 pollen) and reach the following accuracy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y5lseEb-Hfn9xC0F.png" /></figure><p>With a score of 96.4 mAP, we have a perfect starting point for our model-assisted labeling. Looking back, we could have started out with a smaller batch of images.‍</p><p><strong>3. Model-assisted labeling</strong></p><p>Now that we have an initial model trained, we can start to utilize it as a labeling assistant. As the model is automatically deployed on trainYOLO, it enables us to generate predictions with a click of a button (the magic paintbrush). Note that the labeling speedup is dependent on the performance of the initial model, but it is expected to improve significantly with additional training iterations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*ZE_wDMMrrh-scBzH.gif" /></figure><p><strong>4. Iterate</strong></p><p>As previously mentioned, one of the significant advantages of model-assisted labeling is the feedback loop it creates between training the model and labeling more images. Therefore, it’s recommended to train a new model each time we label another set of images. This approach enhances the prediction’s accuracy and accelerates the labeling process. A win-win for all.</p><h3>Conclusion</h3><p>Model-assisted labeling is a powerful technique for accelerating the labeling process for object detection tasks. By using the model to jump-start the initial annotations, model-assisted labeling can save significant time and money, while also improving the accuracy of annotations. To make the most of model-assisted labeling, it’s important to focus on challenging images and correct the annotations generated by the model. By following these tips, you can effectively use model-assisted labeling to label datasets faster and more accurately.</p><p>In conclusion, model-assisted labeling is an important technique that can help overcome the challenges of manual labeling in object detection tasks. By leveraging the predictions of trained models combined with human expertise, model-assisted labeling can accelerate the labeling process while improving the accuracy of annotations. As computer vision applications continue to grow in importance and turnover rates continue to rise, model-assisted labeling is likely to become an increasingly valuable tool.</p><p>Originally published at <a href="https://www.trainyolo.com/blog">https://www.trainyolo.com/blog</a> on March 21, 2023.‍</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=896cb51aeaeb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to train YOLOv5 object detection on a custom dataset]]></title>
            <link>https://medium.com/@davyneven/how-to-train-yolov5-object-detection-on-a-custom-dataset-9eff357713c1?source=rss-4045729f2eca------2</link>
            <guid isPermaLink="false">https://medium.com/p/9eff357713c1</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[yolov5]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[ml-so-good]]></category>
            <category><![CDATA[yolo]]></category>
            <dc:creator><![CDATA[Davy Neven]]></dc:creator>
            <pubDate>Mon, 27 Feb 2023 16:43:31 GMT</pubDate>
            <atom:updated>2023-03-01T18:15:53.518Z</atom:updated>
            <content:encoded><![CDATA[<h4>A model-assisted labeling approach</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*BxFnzXnxLEzndAXhYk2B9g.jpeg" /></figure><p>YOLOv5 is a popular YOLO successor developed by the Ultralytics team. Thanks to its clean codebase and variety of pre-trained checkpoints, it’s widely used to tackle many use cases, ranging from car detection in autonomous driving to defect detection in industrial applications.</p><p>In this tutorial, we will guide you through the steps to train your own YOLOv5 object detection algorithm on your own data. As an example, we will develop a car detector for a parking lot analytics application. Before you start, make sure you have a <a href="https://www.trainyolo.com/">trainYOLO</a> account. If not, you can create a free account <a href="https://app.trainyolo.com/signup">here</a>.</p><h3>Create a new project</h3><p>We start by creating a new project, which will hold our images and trained models, by clicking on the green ‘plus’ icon. We will set the project visibility to <strong>Public</strong>, the name to<strong> parking lot car detection</strong>, keep the annotation type at <strong>Bounding Boxes,</strong> and set a single category <strong>car</strong>. If you have multiple categories, you can add more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*vhXEEpDX5au1sMjRHfygyA.gif" /></figure><h3>Upload your images</h3><p>To upload the images to our project, we go to the data tab and click on the green ‘plus’ icon. We select the images we’d like to upload and click upload. In this example, we will upload 100 images of a parking lot at different times and with different occupancy rates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*tH2QS2RmvmxiSAOzLeKXVg.gif" /></figure><h3>Label your images</h3><p>Once we have uploaded the images, we start labeling. By clicking on an image, you enter the labeling editor. By selecting the bounding box tool in the left menu, you can draw a box around each object, in our case each car. Note that if you have multiple object categories, you need to set the right category using the drop-down list on top. Once finished, you can use the arrow keys on top to go to the next image or select a specific one in the carousel at the bottom.</p><p>Once we have labeled around 50 images, we start training the first YOLOv5 model. This way, we can accelerate the labeling of the other images using <strong>model-assisted labeling</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*b2hk-wL-SFX8i17uOYBoPg.gif" /></figure><h3>Train YOLOv5 model</h3><p>Once you have labeled enough images, you can start training your YOLOv5 model. While you can train both locally or using cloud providers like AWS or GCP, we will use our preconfigured google Colab notebooks. Therefore, we go to the model’s tab and choose the YOLOv5 notebook by clicking on the green ‘plus’ icon.</p><p>This will open our preconfigured notebook for YOLOv5 object detection. We fill in our <strong>API key</strong> (which you’ll get by clicking on your avatar next to your username) and our <strong>project name</strong>. We leave the other parameters to their default values and start the training session by clicking on “Runtime” =&gt; “Run all”. This will download your dataset, start training a model and upload the trained model to our platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*3zysUwhGcgSO64U24BsMqw.gif" /></figure><p>After training, you can see the first version added to the model’s tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z51xGFcGZpNPQwg8.png" /></figure><h3>Model-assisted labeling</h3><p>We can now use our first trained model as a labeling assistant, using so-called <strong>model-assisted labeling</strong>. Each time you add a new model (version) to your project, this latest version will be used as the labeling assistant. Instead of labeling an image from scratch, you now only need to verify or correct the model predictions. This dramatically speeds up the labeling process.</p><p>To use the labeling assistant, click on the magic paintbrush icon in the left menu. This will load the model predictions. Next, adapt or remove unwanted bounding boxes and label the ones that are not labeled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*IE4zAfPoDnSDyXJw.gif" /></figure><p>After labeling 50 more images using the model-assisted labeling approach, we trained another version, this time on 100 images. As can be seen below, the mAP@50 increased from 0.854 to 0.986, which is already quite good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eqDNHY752J8vxvXj.png" /></figure><h3>Next steps</h3><p>Once you have labeled more images, you can train more versions and change the hyperparameters like image size, model type, etc. to optimize your model. Have fun training models!</p><p>Originally published at <a href="https://www.trainyolo.com/blog">https://www.trainyolo.com/blog</a> on February 24, 2023.</p><h4><a href="https://mlearning.substack.com/about"><strong>BECOME a WRITER at MLearning.ai</strong></a></h4><p><a href="https://medium.com/mlearning-ai/mlearning-ai-submission-suggestions-b51e2b130bfb">Mlearning.ai Submission Suggestions</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9eff357713c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to train YOLOv8 segmentation on a custom dataset]]></title>
            <link>https://medium.com/@davyneven/how-to-train-yolov8-segmentation-on-a-custom-dataset-dc96d9db0117?source=rss-4045729f2eca------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc96d9db0117</guid>
            <category><![CDATA[instance-segmentation]]></category>
            <category><![CDATA[biomedical]]></category>
            <category><![CDATA[yolo]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[yolov8]]></category>
            <dc:creator><![CDATA[Davy Neven]]></dc:creator>
            <pubDate>Mon, 27 Feb 2023 16:25:08 GMT</pubDate>
            <atom:updated>2023-02-27T16:25:08.240Z</atom:updated>
            <content:encoded><![CDATA[<h4>A model-assisted labeling approach</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*4Qn5J1qt7vMW5Z_BhjmuZQ.png" /></figure><p>YOLOv8 is the latest installment of the YOLO family, developed by the same company which is behind the YOLOv5 architecture, the Ultralytics team. They not only set new highs on the COCO benchmark for object detection but also streamlined their instance segmentation algorithm and really hit a home run. With its intuitive CLI, it is one of the user-friendliest instance segmentation implementations we have come across.</p><p>In this tutorial, we are going to train a YOLOv8 instance segmentation model using the <a href="https://www.trainyolo.com/">trainYOLO</a> platform on a custom dataset. As an example, we will develop a nucleus (instance) segmentation model, which can be used to count and analyze nuclei on microscopic images. Before you start, make sure you have a trainYOLO account. If not, you can create a free account <a href="https://app.trainyolo.com/signup">here</a>.</p><h3>Create a new project</h3><p>We start by creating a new project, which will hold our images and trained models, by clicking on the green ‘plus’ icon. We will set the project visibility to <strong>Public</strong>, the name to<strong> nuclei segmentation</strong>, set the annotation type to <strong>Instance Segmentation</strong>, and set a single category <strong>nucleus</strong>. If you have multiple categories, you can add more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*lPARgPn14mrqCk2go07LWA.gif" /></figure><h3>Upload your images</h3><p>To upload the images to our project, we go to the data tab and click on the green ‘plus’ icon. We select the images we’d like to upload and click upload. In this example, we will upload 197 images of microscopic images from the BBBC039 dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*W5PntK3RYjWIC-aYoP0pWw.gif" /></figure><h3>Label your images</h3><p>Once we have uploaded the images, we start labeling. By clicking on an image, you enter the labeling editor. For labeling instances, we provide two tools: the paintbrush and the polygon tool. Depending on the use case, one might be preferred over the other one. In the example below, you can see both paintbrush and polygon in action. You can increase the paintbrush size by scrolling up or down. To confirm an instance, press the <strong>SPACE</strong> bar. Note that if you have multiple object categories, you need to set the right category using the drop-down list on top before confirming. Once finished labeling the entire image, you can use the arrow keys on top to go to the next image or select a specific one in the carousel at the bottom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*eHNolRQUy96nYD3G1aSd_w.gif" /></figure><p>Once we have labeled around 50 images, we start training the first YOLOv8 segmentation model. This way, we can accelerate the labeling of the other images using <strong>model-assisted labeling</strong>.</p><h3>Train YOLOv8 model</h3><p>Once you have labeled enough images, you can start training your YOLOv5 model. While you can train both locally or using cloud providers like AWS or GCP, we will use our preconfigured google Colab notebooks. Therefore, we go to the model’s tab and choose the YOLOv8 notebook by clicking on the green ‘plus’ icon.</p><p>This will open our preconfigured notebook for YOLOv8 instance segmentation. We fill in our <strong>API key</strong> (which you’ll get by clicking on your avatar next to your username) and our <strong>project name</strong>. We leave the other parameters to their default values and start the training session by clicking on “Runtime” =&gt; “Run all”. This will download your dataset, start training a model and upload the trained model to our platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ZheoR6qbeXONdpkrobOdfg.gif" /></figure><p>After training, you can see the first version added to the model’s tab. It has a mask mAP@.5 of 0.921 and a mask mAP@.5-.95 of 0.62.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/0*VWnjU6Tm7z1C1PQp.png" /></figure><h3>Model-assisted labeling</h3><p>We can now use our first trained model as a labeling assistant, using so-called <strong>model-assisted labeling</strong>. Each time you add a new model (version) to your project, this latest version will be used as the labeling assistant. Instead of labeling an image from scratch, you now only need to verify or correct the model predictions. This dramatically speeds up the labeling process.</p><p>To use the labeling assistant, click on the magic paintbrush icon in the left menu. This will load the model predictions. Next, adapt or remove unwanted instances using the paintbrush or polygon tool. Note that you can set the brush (and polygon) on <strong>erase mode</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*rFcJUlw3rBADiO1LbF2vew.gif" /></figure><p>After labeling more images using the model-assisted labeling approach, we trained another version, this time on all 197 images. As can be seen below, the mask mAP@.5 increased from 0.921 to 0.939, and the mask mAP@.5-.95 increased from 0.62 to 0.65.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/0*XZd-aEMStVd6P4BI.png" /></figure><h3>Next steps</h3><p>Once you have labeled more images, you can train more versions and change the hyperparameters like image size, model type, etc. to optimize your model. Have fun training models!</p><p>Originally published at <a href="https://www.trainyolo.com/blog">https://www.trainyolo.com/blog</a> on February 25, 2023.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc96d9db0117" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to train YOLOv8 objection detection on a custom dataset]]></title>
            <link>https://medium.com/@davyneven/how-to-train-yolov8-objection-detection-on-a-custom-dataset-665360f39ec5?source=rss-4045729f2eca------2</link>
            <guid isPermaLink="false">https://medium.com/p/665360f39ec5</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[yolo]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[yolov8]]></category>
            <dc:creator><![CDATA[Davy Neven]]></dc:creator>
            <pubDate>Mon, 27 Feb 2023 15:37:45 GMT</pubDate>
            <atom:updated>2023-02-27T15:37:45.419Z</atom:updated>
            <content:encoded><![CDATA[<h4>A model-assisted labeling approach</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*PPMTP1If_znB6ryh8J5_1w.jpeg" /></figure><p>YOLOv8 is the newest addition to the YOLO family and sets new highs on the COCO benchmark. Developed by the same makers of YOLOv5, the Ultralytics team, they not only optimized the object detection algorithm but also included a highly requested feature: instance segmentation.‍</p><p>In this tutorial, we will take you through the steps on how to train a YOLOv8 object detector on a custom dataset using the <a href="https://www.trainyolo.com/">trainYOLO</a> platform. As an example, we will be developing a tree log detector, which can be used to accelerate the counting of tree logs. Before you start, make sure you have a trainYOLO account. If not, you can create a free account <a href="https://app.trainyolo.com/signup">here.</a></p><h3>Create a new project</h3><p>We start by creating a new project, which will hold our images and trained models, by clicking on the green ‘plus’ icon. We will set the project visibility to <strong>Public</strong>, the name to<strong> tree detection</strong>, keep the annotation type at <strong>Bounding Boxes,</strong> and set a single category <strong>tree log</strong>. If you have multiple categories, you can add more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*jy_uE0k66UbhM_E0fpM77w.gif" /></figure><h3>Upload your images</h3><p>To upload images to our project, go to the data tab and click on the green ‘plus’ icon. Select the images you would like to upload and click upload. In this example, we will upload 57 images containing tree logs in different configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*PD8uu_bsfazJ4dvb9OE7xA.gif" /></figure><h3>Label your images</h3><p>Once we have uploaded the images, we start labeling. By clicking on an image, you enter the labeling editor. By selecting the bounding box tool in the left menu, we can draw a box around each object, in our case each tree log. Note that if you have multiple object categories, you need to set the right category using the drop-down list on top. Once finished, you can use the arrow keys on top to go to the next image or select a specific one in the carousel at the bottom.</p><p>Once we have labeled around 20 images, we will start training a first YOLOv8 version. This way, we can accelerate the labeling of the other images using <strong>model-assisted labeling</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*nxW4MhUFc6oSSBQquualOQ.gif" /></figure><h3>Train YOLOv8 model</h3><p>Once you have labeled enough images, you can start training your YOLOv8 model. While you can train both locally or using cloud providers like AWS or GCP, we will use our preconfigured google Colab notebooks. Therefore, we go to the model’s tab and choose the YOLOv8 notebook by clicking on the green ‘plus’ icon.</p><p>This will open our preconfigured notebook for YOLOv8 object detection. We fill in our <strong>API key</strong> (which you’ll get by clicking on your avatar next to your username) and our <strong>project name</strong>. We leave the other parameters to their default values and start the training session by clicking on “Runtime” =&gt; “Run all”. This will download your dataset, start training a model and upload the trained model to our platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*IjVckYY5smgExFIetDpXzQ.gif" /></figure><p>After training, you can see the first version added to the model’s tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w_-SqnfJFJ598XOL.png" /></figure><h3>Model-assisted labeling</h3><p>We can now use our first trained model as a labeling assistant, using so-called <strong>model-assisted labeling</strong>. Each time you add a new version to your project, this latest version will be used as the labeling assistant. Instead of labeling an image from scratch, we now only need to verify or correct the model predictions. This dramatically speeds up the labeling process.</p><p>To use the labeling assistant, click on the magic paintbrush icon in the left menu. This will load the model predictions. Next, adapt or remove unwanted bounding boxes and label the ones that are not labeled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*URyCwfC1ZR6ADZjUSZDhyQ.gif" /></figure><h3>Next steps</h3><p>Once you have labeled more images, you can train more versions and change the hyperparameters like image size, model type, etc. to optimize your model. Have fun training models!</p><p>Originally published at <a href="https://www.trainyolo.com/blog">https://www.trainyolo.com/blog</a> on February 17, 2023.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=665360f39ec5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>