AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.75k stars 7.96k forks source link

Custom Data , not detecting Tiny YOLO v3 #3265

Closed jalaldev1980 closed 5 years ago

jalaldev1980 commented 5 years ago

after 80h of training more than 26k iterations using 3k images to train 4 objects, the system is not detecting any object mAP = 66% Avrg Loss 0.65

[net]

# Testing
batch=1
subdivisions=1
# Training
#batch=64
#subdivisions=16
width=416
height=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

learning_rate=0.001
burn_in=1000
max_batches = 100200
policy=steps
steps=90000,80000
scales=.1,.1

[convolutional]
batch_normalize=1
filters=16
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=1

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

###########

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=27
activation=linear

[yolo]
mask = 3,4,5
anchors = 12, 23,  10,111,  31, 59,  20,210,  48,102,  35,288,  66,159,  91,238, 145,277
classes=4
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1

[route]
layers = -4

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

[route]
layers = -1, 8

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=27
activation=linear

[yolo]
mask = 0,1,2
anchors = 12, 23,  10,111,  31, 59,  20,210,  48,102,  35,288,  66,159,  91,238, 145,277
classes=4
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1
AlexeyAB commented 5 years ago
jalaldev1980 commented 5 years ago

Thank you AlexAB for reply

Can you show screenshot of ./darknet detecor map command?

valid: Using default 'data/train.txt' names: Using default 'data/names.list' Couldn't open file: data/names.list

Can you show screenshot of ./darknet detecor test command?

Cannot load image data/labels/124_7.png Cannot load image data/labels/125_7.png Cannot load image data/labels/126_7.png compute_capability = 300, cudnn_half = 0 layer filters size input output 0 conv 16 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 16 0.150 BF 1 max 2 x 2 / 2 416 x 416 x 16 -> 208 x 208 x 16 0.003 BF 2 conv 32 3 x 3 / 1 208 x 208 x 16 -> 208 x 208 x 32 0.399 BF 3 max 2 x 2 / 2 208 x 208 x 32 -> 104 x 104 x 32 0.001 BF 4 conv 64 3 x 3 / 1 104 x 104 x 32 -> 104 x 104 x 64 0.399 BF 5 max 2 x 2 / 2 104 x 104 x 64 -> 52 x 52 x 64 0.001 BF 6 conv 128 3 x 3 / 1 52 x 52 x 64 -> 52 x 52 x 128 0.399 BF 7 max 2 x 2 / 2 52 x 52 x 128 -> 26 x 26 x 128 0.000 BF 8 conv 256 3 x 3 / 1 26 x 26 x 128 -> 26 x 26 x 256 0.399 BF 9 max 2 x 2 / 2 26 x 26 x 256 -> 13 x 13 x 256 0.000 BF 10 conv 512 3 x 3 / 1 13 x 13 x 256 -> 13 x 13 x 512 0.399 BF 11 max 2 x 2 / 1 13 x 13 x 512 -> 13 x 13 x 512 0.000 BF 12 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF 13 conv 256 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 256 0.089 BF 14 conv 512 3 x 3 / 1 13 x 13 x 256 -> 13 x 13 x 512 0.399 BF 15 conv 27 1 x 1 / 1 13 x 13 x 512 -> 13 x 13 x 27 0.005 BF 16 yolo 17 route 13 18 conv 128 1 x 1 / 1 13 x 13 x 256 -> 13 x 13 x 128 0.011 BF 19 upsample 2x 13 x 13 x 128 -> 26 x 26 x 128 20 route 19 8 21 conv 256 3 x 3 / 1 26 x 26 x 384 -> 26 x 26 x 256 1.196 BF 22 conv 27 1 x 1 / 1 26 x 26 x 256 -> 26 x 26 x 27 0.009 BF 23 yolo Total BFLOPS 5.452 Allocate additional workspace_size = 18.91 MB Loading weights from AD_yolov3-tiny_obj_new_24052019_last.weights... seen 64 Done! Enter Image Path: Cannot load image

: Predicted in 144.368000 milli-seconds.

Predicted ....black

generated bad.list file

AlexeyAB commented 5 years ago

What command do you use for detection?

jalaldev1980 commented 5 years ago

Hi AlexeyAB,

thank you for your support. the problem was on the video which I used to do the test. I changes the vedio and it is detecting now. however, the boundary boxes are not fit on the objects is there any this I should consider to make it fit to the object ?

1

AlexeyAB commented 5 years ago

Either your model is wrong. Or your dataset is wrong.

Run training with flag -show_imgs and look at labels. Also check your mAP. And check that you use weights-file that correspond to your cfg-file.

jalaldev1980 commented 5 years ago

thank you again Alexey mAP : 66%

I will re look at the data-set / labeling

I used different image size is that ok ? number of labels for each objects are not equal e.g. 1000 labels for tree and 600 for poles , is that ok ? could you please advice the best YOLO Tiny V3 cfg/model I should use to train 4 objects using more than 9k images ? for labeling; do I need to label all objects on the same image e.g. there are 4 trees; do I need to label all 4 trees ? I am greeting bad.list what does it mean?

thank you very much again

On Thu, 30 May 2019 at 23:53, Alexey notifications@github.com wrote:

Either your model is wrong. Or your dataset is wrong.

Run training with flag -show_imgs and look at labels. Also check your mAP. And check that you use weights-file that correspond to your cfg-file.

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

AlexeyAB commented 5 years ago

I used different image size is that ok ? number of labels for each objects are not equal e.g. 1000 labels for tree and 600 for poles , is that ok ? could you please advice the best YOLO Tiny V3 cfg/model I should use to train 4 objects using more than 9k images ?

It's ok. Train at least 8000 iterations or more.

for labeling; do I need to label all objects on the same image e.g. there are 4 trees; do I need to label all 4 trees ?

Yes

I am greeting bad.list what does it mean?

Look inside.

The best model is: https://github.com/AlexeyAB/darknet/files/3199657/yolo_v3_spp_pan.cfg.txt

jalaldev1980 commented 5 years ago

thank you very much AlexeyAB