Open frankbrewer opened 4 years ago
First we have to find good ones:
Can you provide links to such tools and datasets?
Then I can add rotated-bbox feature to the [yolo] layer, it is not very difficult, but it will take time, as in many places hardcoded number of coordinates.
First we have to find good ones:
- labeling tools which support rotated bboxes
- dataset with rotated bboxes (also script that converts these bboxes to the yolo format, and script that checks accuracy (mAP) for rotated bboxes)
Can you provide links to such tools and datasets?
Then I can add rotated-bbox feature to the [yolo] layer, it is not very difficult, but it will take time, as in many places hardcoded number of coordinates.
Hi @AlexeyAB ! Hope that you can add rotated-bbox feature!
And dear @AlexeyAB , Can you give some advice on how to modify the structure of yolov3 in the field of textile defect detection(object has little semantic information), maybe reduce the conv layers can help?
And some defects are long and thin with a angle of ~45, so normal bbox can't work, because of large area of background in bbox. I will try to add rotated-bbox feature in the PyTorch version of yolov3 later.
There may be even more suitable semantic/instance segmentation rather than rotate-bboxes. This isn't implemented yet: https://github.com/AlexeyAB/darknet/issues/3048
And some defects are long and thin with a angle of ~45, so normal bbox can't work, because of large area of background in bbox.
It can't work for what reason:
There may be even more suitable semantic/instance segmentation rather than rotate-bboxes. This isn't implemented yet: #3048
And some defects are long and thin with a angle of ~45, so normal bbox can't work, because of large area of background in bbox.
It can't work for what reason:
- does yolo incorrectly detect such bboxes?
- or because you need more accurate localization of the object - you need rotates bboxes?
can't detect such bboxes, mAP is always 0 for this class
Can you show:
There may be even more suitable semantic/instance segmentation rather than rotate-bboxes. This isn't implemented yet: #3048
And some defects are long and thin with a angle of ~45, so normal bbox can't work, because of large area of background in bbox.
It can't work for what reason:
- does yolo incorrectly detect such bboxes?
- or because you need more accurate localization of the object - you need rotates bboxes?
And I try to break the long defect into small segments of bboxes, it worked.
And I try to break the long defect into small segments of bboxes, it worked.
Yes, you can try to use this way.
What cfg-file did you use, is it yolov3-spp.cfg?
And I try to break the long defect into small segments of bboxes, it worked.
Yes, you can try to use this way.
What cfg-file did you use, is it yolov3-spp.cfg?
yes, and I use the version of ultralytics-yolov3, I don't know whether it is robust.
- labeling tools which support rotated bboxes
As a labeling tool you can use Hasty: https://hasty.ai/
In fact, it doesn't support rotated bboxes, but it supports any polygon, which can be used for rotated bboxes, but also for more complex polygons. Look at this:
Hi @AlexeyAB. Anything new with this feature?
Hi @AlexeyAB again. Im try to modify your code to get an angle of the bounding box. but i can't overfitting my dataset (only 15 imgs). Can you help me with this?
Hop i did it correctly...
delta[index + 4 * stride] += scale * (t_angle - x[index + 4 * stride]) * iou_normalizer;
About your questions:
Thanks! If I need to do something else, I'd love to write to me.
Im try to modify your code to get an angle of the bounding box. but i can't overfitting my dataset (only 15 imgs). Can you help me with this?
Overfitting is a bad process that interferes with learning. Do you really want this?: https://en.wikipedia.org/wiki/Overfitting
There were a few images he was able to detect but with low probability (0.23) and with no angle accuracy.
How did you check this?
What activation do you use for angle? https://github.com/AlexeyAB/darknet/blob/d51d89053afc4b7f50a30ace7b2fcf1b2ddd7598/src/yolo_layer.c#L769-L777
If you added LOGISTIC activation for Angle, then you should normalize angle for range [0 - 1]
Overfitting is a bad process that interferes with learning. Do you really want this?: https://en.wikipedia.org/wiki/Overfitting
I know it's a bad idea, i just what to check if i can get good angle accuracy.
How did you check this?
I saw the network output (in debug mode).
What activation do you use for angle?
Oops... forgot it...
So of course I have to normalize the angle (LOGISTIC is what i need?) And disable data augmentation and batch normalization.
Anything else? I will try to do it anyway for me. Do you think you'll be able to get to that soon?
Thank you!
So of course I have to normalize the angle (LOGISTIC is what i need?)
Yes. Or you can try to use sin() ro cos() https://github.com/AlexeyAB/darknet/issues/4360#issuecomment-565719927
Modify this function for loading angles too: https://github.com/AlexeyAB/darknet/blob/d51d89053afc4b7f50a30ace7b2fcf1b2ddd7598/src/data.c#L355-L444
And disable data augmentation and batch normalization.
Comment all that is related to data augmentation in cfg file.
Dont disable batch normalization.
Thx! So just doing so (and what i write before) shuld let me know the angle?
@AlexeyAB One more thing. What i need to change in the code? I can see some numbers im shure i need to change, but in not shure i get all of them, especially in delta_yolo_box() and all the thin around it. Sorry to interupt you, and thanks!
@sdimantsd Hi,
Could you share the code if it's completed?
@zpmmehrdad Hi, unfortunately I couldn't do it. I'm also waiting for @AlexeyAB to update if he finds time to do.
@AlexeyAB Hi,
I have some classes that need to be labeled as rotating rectangles or polygonal, Like Mask-RCNN. Can we have this feature on this repo?
Current situation:
We need:
Thanks
Hop i did it correctly...
- I change the output of YOLO layer from 1+4 to 1+5 in yolo_layer.c (The 5th feature is the angle from x axias. (It value is 0-1. 0 is 0 degrees and 1 is 90 degrees)).
- in delta_yolo_box() i add:
delta[index + 4 * stride] += scale * (t_angle - x[index + 4 * stride]) * iou_normalizer;
- I saw that you divide X and Y by the width/height of the last layer and do a log to the bounding box width / height. I didn't do anything like that for the angle, it is good?
- About the last note, when the angle is greater than 45 degrees, the width becomes the height and the height laterally. Can't it cause problems?
- Do i need to change the loss calculation?
About your questions:
- I changed the label file instead of 5 properties per object (class, center position, height, width) to 6 properties (I added the angle). I changed the cfg file and set filters = (classes + 6) * 3. I trained with tiny yolo and checked after two days. There were a few images he was able to detect but with low probability (0.23) and with no angle accuracy. And there were some who could not detect an object at all.
- I didn't do it :-(
Thanks! If I need to do something else, I'd love to write to me.
Hello, I just modify the code. But it dosn't work as prediced. Can you share me some code about how to process [class,x,y,w,h,angle]?
Hi, Although I changed the code everywhere I thought, it doesn't give any logical results even on 5 pictures. I guess I didn't change all the places I needed. I'm waiting for @AlexeyAB to do it.
If you succeed, I would love for you to post here. Thanks
@AlexeyAB Hi,
I have some classes that need to be labeled as rotating rectangles or polygonal, Like Mask-RCNN. Can we have this feature on this repo?
Current situation:
We need:
Thanks
It's not just a rotated square, in case you have a 4-corner polygon here
friends, does anyone have a executed repo about this issue? I also need to train for rotated bounding boxes, I find it hard to complete for me.
Hi, I try to, but I didn't success :-(
I was wondering whether anyone added a parameter for the angle of rotation and tried training to get outputs like example-c in the image below.
How hard do you think it would be to accomplish this and what is your wild guess about what the networks precision would be for such an application?