Object Detection no results after training

username: maren11
cooked: <p>Hi there,<br>
I would like to train a model on my own data to detect animals. The model is doing the training but if i visualize a prediction after taining the picture of the prediction is black everywhere.<br>
Before the training was running I got the error that the koordinate of my bounding boxes are not korrekt. xmin was higher than xmax. To solve that problem i check wether the xmin value is smaller than the xmax value. I noticed that I have a lot of values where xmin=xmax and ymin=ymax. Do you know why this happend?<br>
Do you have any idea why my model does not predict anything?</p>
<p>If I ignore the error and do not check if the xmin value ist smaller than the xmax value, i can train the model until the error. If I do a prediction then, i get a prediction, which is not very nice, but I get something.<br>
Thanks for your help.</p>

username: Kushaj
cooked: <aside class="quote no-group" data-username="maren11" data-post="1" data-topic="91373">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/m/898d66/48.png" class="avatar"> maren11:</div>
<blockquote>
<p>Before the training was running I got the error that the koordinate of my bounding boxes are not korrekt. xmin was higher than xmax.</p>
</blockquote>
</aside>
<p>There is a bug in the labelling process as per your message. Plot the data before training to see if the bounding boxes are correct without using any <code>if</code> checks.</p>

username: maren11
cooked: <p>How do I print my picture with the boxes?</p>

username: Kushaj
cooked: <p>Use matplotlib. Draw lines between (xmin,ymin) and (xmax,ymax).</p>

username: maren11
cooked: <p>Thanks, now i plotted my masks. I can see a problem now: I get too many bounding boyes. I get abaout 100 bounding boxes on a picture with just 2 Objects. What can be the problem of this issue?</p>

username: Kushaj
cooked: <p>To be on the same page, did you plot the masks as the output of your model, or to test your dataloader?</p>
<p>If you plotted the masks to check the result of your dataloader, then it means that their is either problem with your dataloader or the labels are wrong (check the json file of labels to verify the correctness of the labels).</p>

username: maren11
cooked: <p>I solved the problem: I had some bugs in my Data. The pictures had soft edges.<br>
But now I have a different Problem. I just have one bounding boy for all animals of one class. How can I create a bounding box for every animal in one class?</p>

username: Kushaj
cooked: <p>What do you mean by soft edges? I checked internet, is it related to object being faded into the background.</p>
<aside class="quote no-group" data-username="maren11" data-post="7" data-topic="91373">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/m/898d66/48.png" class="avatar"> maren11:</div>
<blockquote>
<p>How can I create a bounding box for every animal in one class?</p>
</blockquote>
</aside>
<p>I don’t get it. Your json file will contain <code>image_name: bounding_boxes in that image+class of the box</code>. If the annotations in the json file are correct, then you can do a simple <code>for</code> loop, to get the bounding boxes for each class.</p>

username: maren11
cooked: <aside class="quote no-group" data-username="Kushaj" data-post="8" data-topic="91373">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kushaj/48/58838_2.png" class="avatar"> Kushaj:</div>
<blockquote>
<p>What do you mean by soft edges? I checked internet, is it related to object being faded into the background</p>
</blockquote>
</aside>
<p>The edges of the picture are not clear. So if the animal is selected in white and the background is black, then the edges are in different grey colors.</p>
<aside class="quote no-group" data-username="Kushaj" data-post="8" data-topic="91373">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kushaj/48/58838_2.png" class="avatar"> Kushaj:</div>
<blockquote>
<p>I don’t get it. Your json file will contain <code>image_name: bounding_boxes in that image+class of the box</code> . If the annotations in the json file are correct, then you can do a simple <code>for</code> loop, to get the bounding boxes for each class.</p>
</blockquote>
</aside>
<p>Yes, I get different boxes for different classes. But I only get one Box if there are more than one animal of one class. In my JSON file I got a lot a pictures with segmentation for every selected animal From the JSON file I created the pictures with the mask. On this pictures with the mask I want to create my boundin box. If I have two different animals, I get two correct bounding boxes. If I have two animal of the same kind, I get one big bounding Box insted of two.</p>

username: Kushaj
cooked: <aside class="quote no-group" data-username="maren11" data-post="9" data-topic="91373">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/m/898d66/48.png" class="avatar"> maren11:</div>
<blockquote>
<p>If I have two animal of the same kind, I get one big bounding Box insted of two.</p>
</blockquote>
</aside>
<p>It hint’s that the labelling process is incorrect.</p>