title: Annotate Images for training YOLO with custom dataset
body: <p>I am using <a href="https://www.vicos.si/Downloads/MODD" rel="nofollow noreferrer">MODD</a> (marine obstacle detection dataset) for detecting marine objects using YOLO. I followed <a href="https://www.youtube.com/watch?v=eFJOGsQ_YTA&amp;list=PLX-LrBk6h3wSGvuTnxB2Kj358XfctL4BM&amp;index=8" rel="nofollow noreferrer">Mark Jay</a> series for training the algorithm with custom dataset. But in the tutorial, detection of square objects is only specified. In my dataset I have three main classes</p>
  
  <ol>
  <li>Large Objects</li>
  <li>Small Objects</li>
  <li>Horizons</li>
  </ol>
  
  <p>A sample image from the dataset:</p>
  
  <p><a href="https://i.stack.imgur.com/gHOe2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gHOe2.png" alt="enter image description here"></a></p>
  
  <p>As you can see the yellow line (with few points) is the horizon. It classifies sea from all other parts (i.e it specifies the range to which the current boat move in the sea). As specified in mark Jay tutorial, for training YOLO with custom objects, I provided the annotations in above format (only for small and large objects):</p>
  
  <pre><code>&lt;annotation&gt;
    &lt;folder&gt;/home/user/Desktop/dataset/modd_dataset1.0/data/01/images/&lt;/folder&gt;
    &lt;filename&gt;17.jpg&lt;/filename&gt;
    &lt;segmented&gt;0&lt;/segmented&gt;
    &lt;size&gt;
      &lt;width&gt;640&lt;/width&gt;
      &lt;height&gt;480&lt;/height&gt;
      &lt;depth&gt;3&lt;/depth&gt;
    &lt;/size&gt;
    &lt;object&gt;
      &lt;name&gt;largeobjects&lt;/name&gt;
      &lt;pose&gt;Unspecified&lt;/pose&gt;
      &lt;truncated&gt;0&lt;/truncated&gt;
      &lt;difficult&gt;0&lt;/difficult&gt;
      &lt;bndbox&gt;
        &lt;xmin&gt;518.9599375650363&lt;/xmin&gt;
        &lt;ymin&gt;145.26586888657653&lt;/ymin&gt;
        &lt;xmax&gt;638.835067637877&lt;/xmax&gt;
        &lt;ymax&gt;219.8548387096775&lt;/ymax&gt;
      &lt;/bndbox&gt;
    &lt;/object&gt;
    &lt;object&gt;
      &lt;name&gt;largeobjects&lt;/name&gt;
      &lt;pose&gt;Unspecified&lt;/pose&gt;
      &lt;truncated&gt;0&lt;/truncated&gt;
      &lt;difficult&gt;0&lt;/difficult&gt;
      &lt;bndbox&gt;
        &lt;xmin&gt;239.91727367325706&lt;/xmin&gt;
        &lt;ymin&gt;22.7268470343393&lt;/ymin&gt;
        &lt;xmax&gt;306.5145681581686&lt;/xmax&gt;
        &lt;ymax&gt;223.18470343392306&lt;/ymax&gt;
      &lt;/bndbox&gt;
    &lt;/object&gt;
    &lt;object&gt;
      &lt;name&gt;largeobjects&lt;/name&gt;
      &lt;pose&gt;Unspecified&lt;/pose&gt;
      &lt;truncated&gt;0&lt;/truncated&gt;
      &lt;difficult&gt;0&lt;/difficult&gt;
      &lt;bndbox&gt;
        &lt;xmin&gt;2.1649323621228262&lt;/xmin&gt;
        &lt;ymin&gt;196.54578563995847&lt;/ymin&gt;
        &lt;xmax&gt;8.158688865764859&lt;/xmax&gt;
        &lt;ymax&gt;219.18886576482834&lt;/ymax&gt;
      &lt;/bndbox&gt;
    &lt;/object&gt;
    &lt;object&gt;
      &lt;name&gt;smallobjects&lt;/name&gt;
      &lt;pose&gt;Unspecified&lt;/pose&gt;
      &lt;truncated&gt;0&lt;/truncated&gt;
      &lt;difficult&gt;0&lt;/difficult&gt;
      &lt;bndbox&gt;
        &lt;xmin&gt;227.92976066597294&lt;/xmin&gt;
        &lt;ymin&gt;218.52289281997923&lt;/ymin&gt;
        &lt;xmax&gt;240.58324661810616&lt;/xmax&gt;
        &lt;ymax&gt;233.84027055150892&lt;/ymax&gt;
      &lt;/bndbox&gt;
    &lt;/object&gt;
  &lt;/annotation&gt;
  </code></pre>
  
  <p>In the case of horizons, multiple (x,y) points are provided to draw a line (i.e while in case of small and large objects two (x,y) points are being specified so that a box can be drawn around the detected object). Is there any way to provide annotations in the above horizon ?? </p>
  
  <p>If annotations can be provided, how to do that? If not, is there any other algorithm that I can use for this purpose? The model need to be really fast because it will be used on a IOT device for real-time detection.</p>
  
  <p>This is already implemented using semantic segmentation (but in matlab). Can semantic segmentation be used on edge devices(with python &amp; openCV)?</p>