Open downhiller opened 7 years ago
Why not train it yourself for the particular classes that you want it to detect?
I assume that "training" it means get (say) 1000 images, and tell the code the bounding box of any occurrences of my desired objects in each image?
If so that seems like a large undertaking when yolo appears to already dectect my objects perfectly - all I want to do is to STOP it from looking for the other thousands of objects that yolo contains?
I have met the same question. I only want to detect the person and car. How to realize this?
In yolo-voc.cfg file, classes = 2
In voc.data file, classes = 2
In voc.names file, delete all the lines except "person" and "car"
Then follow this to train on voc dataset: Follow this: https://pjreddie.com/darknet/yolo/#train-voc (You don't need to create your own dataset of, like you said, 1000 images)
Thanks!
I get as far as
./darknet detector train cfg/voc.data cfg/yolo-voc.cfg darknet19_448.conv.23
and this happens:
"darknet: ./src/parser.c:280: parse_region: Assertion `l.outputs == params.inputs' failed."
Any idea why?
Fixed it. You need to find the "filters" line above the classes line in yolo-voc.cfg and change the number to (classes + 5) * 5
So for 2 classes, filters becomes 35, 3 classes it becomes 40, etc.
Solution from this link: https://groups.google.com/forum/#!topic/darknet/B4rSpOo84yg
More specifically: (classes + coords + 1)*NUM. Please close this issue if solved.
Final question: how many images is this going through when I train it? It tells me how many it's done, but not how many more there are to go. I'm guessing that it being on 30 images after 15 minutes is pretty bad news though, but that's my fault for trying to run it on a dedicated centos server. Maybe I'd get better luck running it on my home PC with GPU and then copying across?
Sorry, I don't know that. It might take as much as a week to train the net.
@downhiller Usually sufficient 2000 iterations for each class(object). But for a more precise definition when you should stop training, use the following manual: https://github.com/AlexeyAB/darknet#when-should-i-stop-training
@AlexeyAB Without other competing classes, will YOLO tend to make false positive result? Say, if you only want to detect Motorbike and Person, so you train YOLO with only these two classes -- Will your new YOLO model report a Bike as Motorbike more often than the original YOLO VOC model??
@xzhub If you use fewer classes, but use the same good and huge dataset - then there will be:
As an aside, roughly how fast should this object detection be able to work on a 1024px JPEG on a 6-core Xeon CentOS dedicated server (no useful GPU etc?)
At the moment it's taking something like 20 seconds per photo, which isn't very useful - but it's probably something I'm doing wrong - or the lack of GPU!
@downhiller To use on CPU-only systems try to use:
for Training and Detection, set OPENMP=1 AVX=1
in the Makefile: https://github.com/AlexeyAB/darknet
for Detection only - just use Yolo that is built-in OpenCV. Use OpenCV master branch: https://github.com/opencv/opencv
There were added Yolo v2/v3 inside the OpenCV - these implementation are the fastest for CPU
If I were to train a model on just 1 or 2 classes using the voc dataset as asked by the OP, would the inference be faster? If yes, how much?
yes,yolo will faster than before.
i test it on my own dataset and object.
could you not just use tiny yolo?
the detection accuracy will be low when u use tiny yolo
I still get the error "darknet: ./src/parser.c:315: parse_yolo: Assertion `l.outputs == params.inputs' failed. Abandon (core dumped)" I have made the modification on yolov3-voc, voc.names and voc.data. Here are the pictures.
In the yolov3-voc.cfg, I have set classes = 1 and filters = ( 1 +5 ) * 5 = 30
And in voc.data file:
Can you help me pls ?
In yolo-voc.cfg file,
classes = 2
In voc.data file,classes = 2
In voc.names file, delete all the lines except "person" and "car"Then follow this to train on voc dataset: Follow this: https://pjreddie.com/darknet/yolo/#train-voc (You don't need to create your own dataset of, like you said, 1000 images)
I've been trying to follow this guide to change the dataset, but I cannot find voc.data file anywhere in the directory. What can I do...?
In yolo-voc.cfg file,
classes = 2
In voc.data file,classes = 2
In voc.names file, delete all the lines except "person" and "car" Then follow this to train on voc dataset: Follow this: https://pjreddie.com/darknet/yolo/#train-voc (You don't need to create your own dataset of, like you said, 1000 images)I've been trying to follow this guide to change the dataset, but I cannot find voc.data file anywhere in the directory. What can I do...?
Same here... :-/
classes= 20
train = <path-to-voc>/train.txt
valid = <path-to-voc>2007_test.txt
names = data/voc.names
backup = backup
Here you go, @biketrooper @ohnu93
Yolo works straight out of the box perfectly for my needs, and identifies correctly the object in the photos that I've tested it with. I only want to test for one specific object though, I don't care if there's chairs or sheep or cars or trees in the photo as well. It should be possible to tell darknet when running it to look for one specific object.
Maybe it is and I'm being blind/stupid?
Thank you!