I have an image dataset of 9 objects in train(69K) and test(10K) folder. i also have annotation files for all these images in another separate folders train(69K) and test(10K). The Annotation files have same name as that of image with .txt format.
eg of an annotation file is and see the its format below-:
2 0.398 0.451 0.026 0.036
8 0.331 0.451 0.047 0.062
2 0.170 0.459 0.075 0.081
class_no xmin_yolo ymin xmax_yolo ymax_yolo
where - class_no is the classnumber of object(starting from 0, 1, 2, 3, 4.....8, assigned to each object as their unique identifier)
xmin_yolo = float((float((xmax-xmin)/2) + xmin)/width)
ymin_yolo = float((float((ymax-ymin)/2) + ymin)/height)
xmax_yolo = float((xmax-xmin)/width)
ymax_yolo = float((ymax-ymin)/height)
In above equation- xmin, ymin is the x1, y1 coordinates of the bounding box. xmax, ymax is the x2, y2 coordinates of the bounding box
for example, xmin=393, ymin=302, xmax=453, ymax=347, height=720 , width=1280
gives this - 8 0.331 0.451 0.047 0.062, where 8 is the class number
Next created a train.txt, and test.txt file which has path to all images in text and test folders. train.txt looks like:-
/Image-dataset/images/val/ca4071a6-6fa1a1c8.jpg
/Image-dataset/images/val/ca40ddd3-102f3b02.jpg
I created a objects.names file and added these:-
man
book
radio
table
cycle
woman
bottle
trafficlight
tree
Then i created a objects.data file and added these:-
I also downloaded a pre-trained model - darknet19_448.conv.23
Now i enter the command - _./darknet detector train cfg/objects.data cfg/objects.cfg darknet19_448.conv.23_ .
After so many hours i the iteration where completed successfully without any errors(memory errors was cleared) and got inside backup folder. Next i tried the the testing with this command:-
_./darknet detector demo cfg/objects.data cfg/objects.cfg backup/vehicles-yolov2-voc80000.weights '/Test-data/Driving.mp4'
where vehicles-yolov2-voc_80000.weights is a the model created during iterations.
and Driving.mp4 is the video
But im not getting any results. also tried with image and webcam. i tried this in command - -thresh 0 . still no results. Do i need to make any change in objects.cfg or any files?
Please help me.
@pjreddie @lilohuang @Broham Please help me
Hi i'm trying to do training on custom dataset as per the https://pjreddie.com/darknet/yolov2/ .
I have an image dataset of 9 objects in train(69K) and test(10K) folder. i also have annotation files for all these images in another separate folders train(69K) and test(10K). The Annotation files have same name as that of image with .txt format.
eg of an annotation file is and see the its format below-: 2 0.398 0.451 0.026 0.036 8 0.331 0.451 0.047 0.062 2 0.170 0.459 0.075 0.081 class_no xmin_yolo ymin xmax_yolo ymax_yolo
where - class_no is the classnumber of object(starting from 0, 1, 2, 3, 4.....8, assigned to each object as their unique identifier) xmin_yolo = float((float((xmax-xmin)/2) + xmin)/width) ymin_yolo = float((float((ymax-ymin)/2) + ymin)/height) xmax_yolo = float((xmax-xmin)/width) ymax_yolo = float((ymax-ymin)/height)
In above equation- xmin, ymin is the x1, y1 coordinates of the bounding box. xmax, ymax is the x2, y2 coordinates of the bounding box for example, xmin=393, ymin=302, xmax=453, ymax=347, height=720 , width=1280 gives this - 8 0.331 0.451 0.047 0.062, where 8 is the class number
Next created a train.txt, and test.txt file which has path to all images in text and test folders. train.txt looks like:- /Image-dataset/images/val/ca4071a6-6fa1a1c8.jpg /Image-dataset/images/val/ca40ddd3-102f3b02.jpg
I created a objects.names file and added these:-
Then i created a objects.data file and added these:-
And the objects.cfg file is this which is yolov2-voc.cfg, modified with classnumber and filter only:-
I also downloaded a pre-trained model - darknet19_448.conv.23
Now i enter the command - _./darknet detector train cfg/objects.data cfg/objects.cfg darknet19_448.conv.23_ .
After so many hours i the iteration where completed successfully without any errors(memory errors was cleared) and got inside backup folder. Next i tried the the testing with this command:- _./darknet detector demo cfg/objects.data cfg/objects.cfg backup/vehicles-yolov2-voc80000.weights '/Test-data/Driving.mp4'
But im not getting any results. also tried with image and webcam. i tried this in command - -thresh 0 . still no results. Do i need to make any change in objects.cfg or any files?
Please help me. @pjreddie @lilohuang @Broham Please help me