pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.75k stars 21.33k forks source link

Prediction made but with no bounding box displayed on VOC dataset subset #1590

Open minertom opened 5 years ago

minertom commented 5 years ago

Hi, I finally was able to run a successful training on a subset of the VOC dataset. The only modifications that I needed to make to the .cfg file were

batch = 8 (in order to not run out of GPU memory and crash, during training, even though I was using a gtx1060 with 6G)

Then, in the proper places Classes = 4 filters = 27

My voc.names file contained aeroplane chair person tvmonitor

So, after running the training which only took about 2 hours in this case, I ran. ./darknet detect cfg/yolov3.cfg backup/yolov3_final.weights data/person.jpg

which resulted in

data/person.jpg: Predicted in 0.045766 seconds.

However, the prediction did not display the "predictions.jpg" image. I opened up the predictions.jpg and yes, this was the original person.jpg image that I used in the detect phase but there was NO bounding box.

What do you think all is happening here? I am sure that it is some lack of understanding on my part.

Thank You Tom

colorfuldarkgray commented 5 years ago

How much iterations did your training do? What version of YOLO are you working with? In my case training was crashing from bad training policy. I think you should use larger batch (64). In case yo get memory error you increase subdivisions.

josephdereje commented 5 years ago

how many iteration is enough if you are training 4 classes ??? @colorfuldarkgray i just want to train 4 classes car , motorbike, bus , bicycle and when i lable those classes using voc_lable still on the traning .txt file path there are some person pictures i don't want to start traing and after an hours with out no perdiction thank you

colorfuldarkgray commented 5 years ago

@josephdereje in my case, training one single class with 260 pictures, 1000 iterations were enough. What tutorial or guidelines are you following? I think that you have to reduce dataset taking away pictures with classes you're no interested in. Try writing a script that looks for classes in label files, so if there's not a single class you want then you erase image file and corresponding label. Hope this helps you!

colorfuldarkgray commented 5 years ago

@minertom please look at prediction.txt what does it say?

minertom commented 5 years ago

Hi colorfuldarkgray,

Thank you for the reply.

I believe that the issues that I am having with darknet are easy to describe. I eventually did get inference kind of working with the original coco data set, the original pretrained weights darket53.conv.74 and the yolov3.cfg configuration file. Originally, the inference was really poor. I could recognize, through a webcam, a picture of an airplane from the coco data set but I could not recognize any other aircraft, again, with the webcam. So, I trained the network with lots of pictures of ONLY airplanes (and annotations) from the google data set (took 2 days to download only the airplane jpeg and annotation files). After training, inference was actually pretty good but OH, So SLOW. I should mention that I am using the opencv dnn running on the cpu, which should be pretty fast.

The next step was to train using yolov3-tiny.cfg, with the original darknet53.conv.74 configuration. Worked much faster but I got ZERO inference. Would not recognize ANY airplanes. Remember, I am only training on the airplane class.

The last thing that I attempted was using yolov3-tiny.cfg with a smaller conv like yolov3-tiny.conv.15 . Same thing happened. I got ZERO inference.

So, I am at a loss as to what to try next. Can you offer a suggestion?

Thank You Tom

On Fri, May 31, 2019 at 5:12 PM colorfuldarkgray notifications@github.com wrote:

@josephdereje https://github.com/josephdereje in my case, training one single class with 260 pictures, 1000 iterations were enough. What tutorial or guidelines are you following? I think that you have to reduce dataset taking away pictures with classes you're no interested in. Try writing a script that looks for classes in label files, so if there's not a single class you want then you erase image file and corresponding label. Hope this helps you!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pjreddie/darknet/issues/1590?email_source=notifications&email_token=ADHGGHHPLBSWVUX2F6QZK5TPYG5IPA5CNFSM4HJWBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWWUMYI#issuecomment-497895009, or mute the thread https://github.com/notifications/unsubscribe-auth/ADHGGHHYPOV3AVCK7QFNI5DPYG5IPANCNFSM4HJWBS5A .

colorfuldarkgray commented 5 years ago

I have to suggest you to revise your work exhaustively. When I was getting zero detections the cause was some error in the annotations for trainings.

When you are getting good detections, what net were you using? Why was it so slow?

Maybe I would try some small model (not tiny) training over part of the net that was giving good detections.

Regards

El vie., 31 may. 2019 a las 21:15, minertom (notifications@github.com) escribió:

Hi colorfuldarkgray,

Thank you for the reply.

I believe that the issues that I am having with darknet are easy to describe. I eventually did get inference kind of working with the original coco data set, the original pretrained weights darket53.conv.74 and the yolov3.cfg configuration file. Originally, the inference was really poor. I could recognize, through a webcam, a picture of an airplane from the coco data set but I could not recognize any other aircraft, again, with the webcam. So, I trained the network with lots of pictures of ONLY airplanes (and annotations) from the google data set (took 2 days to download only the airplane jpeg and annotation files). After training, inference was actually pretty good but OH, So SLOW.

The next step was to train using yolov3-tiny.cfg, with the original darknet53.conv.74 configuration. Worked much faster but I got ZERO inference. Would not recognize ANY airplanes. Remember, I am only training on the airplane class.

The last thing that I attempted was using yolov3-tiny.cfg with a smaller conv like yolov3-tiny.conv.15 . Same thing happened. I got ZERO inference.

So, I am at a loss as to what to try next. Can you offer a suggestion?

Thank You Tom

On Fri, May 31, 2019 at 5:12 PM colorfuldarkgray <notifications@github.com

wrote:

@josephdereje https://github.com/josephdereje in my case, training one single class with 260 pictures, 1000 iterations were enough. What tutorial or guidelines are you following? I think that you have to reduce dataset taking away pictures with classes you're no interested in. Try writing a script that looks for classes in label files, so if there's not a single class you want then you erase image file and corresponding label. Hope this helps you!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/pjreddie/darknet/issues/1590?email_source=notifications&email_token=ADHGGHHPLBSWVUX2F6QZK5TPYG5IPA5CNFSM4HJWBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWWUMYI#issuecomment-497895009 , or mute the thread < https://github.com/notifications/unsubscribe-auth/ADHGGHHYPOV3AVCK7QFNI5DPYG5IPANCNFSM4HJWBS5A

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pjreddie/darknet/issues/1590?email_source=notifications&email_token=AJT2W6OMQOPRWOTMNGDIEP3PYHLTRA5CNFSM4HJWBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWWWVSQ#issuecomment-497904330, or mute the thread https://github.com/notifications/unsubscribe-auth/AJT2W6NXOOV26QYW3MGEABTPYHLTRANCNFSM4HJWBS5A .