-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detection of small objects #2310
Comments
@malhosary Hi, 1/2. I would recommend you to train
Also read: https://github.com/AlexeyAB/darknet#how-to-improve-object-detection
Use the latest version of this repository. And train with flag
Also I recommend you to use 2x - 12x more training images if possible. |
@AlexeyAB Thanks for your quick reply. And this is the output for the command:
|
Try to download the latest version of Darknet from this repository, and calc_anchors again. Also it looks like you have 100-200 large objects, that occupy ~50%x50% of image, do you want to detect such large objects? |
No, i want to detect only small products in the refrigerator |
Hers are the new anchors using the new version:
|
@AlexeyAB , you've said which one is correct? |
You should to add |
You should remove such big objects from your training dataset, that occupys more than 25% of image, and then reclalculate anchors and run training. |
@AlexeyAB, What is your recommendation for these objects? Is it enough to use default yolov3 config with custom generated anchors? or i have to use
Thanks. |
@dreambit It is better to use |
@AlexeyAB Hi, Thanks for your recommendations, i have here some good results after Green boxes are items that can be detected by my model, the issue is in Red boxes where the same items are in different locations but can't be detected (the same items with the same size but different location/position than locations in the training data set), what is your recommendations? |
Yolo v3 can detect such objects with ~99.99% accuracy. Just use more training images, about 2000 images for each class. https://github.com/AlexeyAB/darknet#how-to-improve-object-detection
|
Hello, @AlexeyAB , output of calculate anchors: calculating k-means++ ... avg IoU = 67.99 % Saving anchors to the file: anchors.txt |
Can you show anchors and point cloud if you calculate anchors for |
So try to train and these |
@AlexeyAB Hi, |
@wting861006 Hi, Show me output |
|
@wting861006 and recalculated anchors |
I try yolov3-tiny_3l.cfg,yolov3-spp.cfg,yolov3.cfg,yolov3-tyny_5l.cfg, width=1280 height=1280.But the effect is not good.I upload my trained data in this place,could you please tell me what the problem might be?many thanks. I use command:darknet detector train yolov3-tiny_3l.data yolov3-tiny_3l.cfg yolov3-tiny_3l_last.weights -gpus 0,1 -map -clear (next mAP calculation at 2452 iterations) calculation mAP (mean average precision)... for thresh = 0.25, precision = 0.59, recall = 0.48, F1-score = 0.53 IoU threshold = 50 %, used Area-Under-Curve for each unique Recall Set -points flag: mean_average_precision (mAP@0.5) = 0.154082 |
@wting861006 Hi,
Your labels look like good, but check that you labeled all of (sperm, round cell, red cell) objects on the image without any exception: Train at least 6000 iterations by using this cfg-file without any changes (just if out of memory occurs then set random=0 in the last yolo-layer): yolov3-tiny_3l.cfg.txt Use: https://github.com/AlexeyAB/darknet#how-to-train-tiny-yolo-to-detect-your-custom-objects After 2000 iterations you can run multi-gpu training: |
@AlexeyAB Hi,I trained according to your suggestion. Except for the high loss, it seemed to be fine. (next mAP calculation at 8040 iterations) (next mAP calculation at 8040 iterations) E:\trainingdata\baochuang\test\newtest\3-14all\train>darknet detector map baocuang.data yolov3-tiny_3l_1.cfg yolov3-tiny_3l_1_final.weights calculation mAP (mean average precision)... for thresh = 0.25, precision = 0.76, recall = 0.79, F1-score = 0.77 IoU threshold = 50 %, used Area-Under-Curve for each unique Recall Set -points flag: |
mAP ~ 70% is a good result for Yolov3 Tiny 3L. |
@AlexeyAB Hi,
Thank you for the great effort and work.
![cam2 20190121_131948 1 _frame_1](https://user-images.githubusercontent.com/41121043/51903546-1cc96180-23c5-11e9-871c-c307e6ae646d.jpg)
We are trying to detect multiple small objects (red marked rectangles in the image) (this is a sample image just to show you the size of objects that we want to detect)
Data Set:
Questions:
1- Which
cfg
file you recommend to use for training?2- What is the recommended width and height to use for training and detection?
3- How to calculate correct anchors for my data set?
using:
darknet detector calc_anchors data/obj.data -num_of_clusters 15 -final_width 16 -final_height 16 -width 832 -height 832 -show
Or using:
darknet detector calc_anchors data/obj.data -num_of_clusters 4 -width 832 -height 832 -show
4- What is the
num_of_clusters
,final_width
andfinal_height
and how to calculate it for my data set?The text was updated successfully, but these errors were encountered: