mirror of https://github.com/AlexeyAB/darknet.git
parent
47c7af1cea
commit
d9ae3dd681
37 changed files with 3666 additions and 23 deletions
@ -0,0 +1,789 @@ |
|||||||
|
[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 = 500200 |
||||||
|
policy=steps |
||||||
|
steps=400000,450000 |
||||||
|
scales=.1,.1 |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=32 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=32 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
###################### |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=1024 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=1024 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=1024 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=255 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[yolo] |
||||||
|
mask = 6,7,8 |
||||||
|
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 |
||||||
|
classes=80 |
||||||
|
num=9 |
||||||
|
jitter=.3 |
||||||
|
ignore_thresh = .5 |
||||||
|
truth_thresh = 1 |
||||||
|
random=1 |
||||||
|
|
||||||
|
|
||||||
|
[route] |
||||||
|
layers = -4 |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[upsample] |
||||||
|
stride=2 |
||||||
|
|
||||||
|
[route] |
||||||
|
layers = -1, 61 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=512 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=512 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=512 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=255 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[yolo] |
||||||
|
mask = 3,4,5 |
||||||
|
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 |
||||||
|
classes=80 |
||||||
|
num=9 |
||||||
|
jitter=.3 |
||||||
|
ignore_thresh = .5 |
||||||
|
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, 36 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=256 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=256 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=256 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=255 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[yolo] |
||||||
|
mask = 0,1,2 |
||||||
|
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 |
||||||
|
classes=80 |
||||||
|
num=9 |
||||||
|
jitter=.3 |
||||||
|
ignore_thresh = .5 |
||||||
|
truth_thresh = 1 |
||||||
|
random=1 |
||||||
|
|
@ -1,7 +1,7 @@ |
|||||||
rem Run this file and then open URL in Chrome/Firefox: rem http://localhost:8090 |
rem Run this file and then open URL in Chrome/Firefox: rem http://localhost:8090 |
||||||
rem Or open: http://ip-address:8090 |
rem Or open: http://ip-address:8090 |
||||||
|
|
||||||
darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights test.mp4 -i 0 -http_port 8090 |
darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights test.mp4 -i 0 -http_port 8090 -dont_show |
||||||
|
|
||||||
|
|
||||||
pause |
pause |
@ -0,0 +1,5 @@ |
|||||||
|
|
||||||
|
darknet.exe detector test data/coco.data yolov3.cfg yolov3.weights -i 0 -thresh 0.25 dogr.jpg |
||||||
|
|
||||||
|
|
||||||
|
pause |
@ -0,0 +1,789 @@ |
|||||||
|
[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 = 500200 |
||||||
|
policy=steps |
||||||
|
steps=400000,450000 |
||||||
|
scales=.1,.1 |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=32 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=32 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
###################### |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=1024 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=1024 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=1024 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=255 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[yolo] |
||||||
|
mask = 6,7,8 |
||||||
|
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 |
||||||
|
classes=80 |
||||||
|
num=9 |
||||||
|
jitter=.3 |
||||||
|
ignore_thresh = .5 |
||||||
|
truth_thresh = 1 |
||||||
|
random=1 |
||||||
|
|
||||||
|
|
||||||
|
[route] |
||||||
|
layers = -4 |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[upsample] |
||||||
|
stride=2 |
||||||
|
|
||||||
|
[route] |
||||||
|
layers = -1, 61 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=512 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=512 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=512 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=255 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[yolo] |
||||||
|
mask = 3,4,5 |
||||||
|
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 |
||||||
|
classes=80 |
||||||
|
num=9 |
||||||
|
jitter=.3 |
||||||
|
ignore_thresh = .5 |
||||||
|
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, 36 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=256 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=256 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=256 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=255 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[yolo] |
||||||
|
mask = 0,1,2 |
||||||
|
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 |
||||||
|
classes=80 |
||||||
|
num=9 |
||||||
|
jitter=.3 |
||||||
|
ignore_thresh = .5 |
||||||
|
truth_thresh = 1 |
||||||
|
random=1 |
||||||
|
|
@ -0,0 +1,789 @@ |
|||||||
|
[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 = 500200 |
||||||
|
policy=steps |
||||||
|
steps=400000,450000 |
||||||
|
scales=.1,.1 |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=32 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=32 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=64 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[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 |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
# Downsample |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=2 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=1024 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[shortcut] |
||||||
|
from=-3 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
###################### |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=1024 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=1024 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=512 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=1024 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=255 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[yolo] |
||||||
|
mask = 6,7,8 |
||||||
|
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 |
||||||
|
classes=80 |
||||||
|
num=9 |
||||||
|
jitter=.3 |
||||||
|
ignore_thresh = .5 |
||||||
|
truth_thresh = 1 |
||||||
|
random=1 |
||||||
|
|
||||||
|
|
||||||
|
[route] |
||||||
|
layers = -4 |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[upsample] |
||||||
|
stride=2 |
||||||
|
|
||||||
|
[route] |
||||||
|
layers = -1, 61 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=512 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=512 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=256 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=512 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=255 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[yolo] |
||||||
|
mask = 3,4,5 |
||||||
|
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 |
||||||
|
classes=80 |
||||||
|
num=9 |
||||||
|
jitter=.3 |
||||||
|
ignore_thresh = .5 |
||||||
|
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, 36 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=256 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=256 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
filters=128 |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
batch_normalize=1 |
||||||
|
size=3 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=256 |
||||||
|
activation=leaky |
||||||
|
|
||||||
|
[convolutional] |
||||||
|
size=1 |
||||||
|
stride=1 |
||||||
|
pad=1 |
||||||
|
filters=255 |
||||||
|
activation=linear |
||||||
|
|
||||||
|
|
||||||
|
[yolo] |
||||||
|
mask = 0,1,2 |
||||||
|
anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 |
||||||
|
classes=80 |
||||||
|
num=9 |
||||||
|
jitter=.3 |
||||||
|
ignore_thresh = .5 |
||||||
|
truth_thresh = 1 |
||||||
|
random=1 |
||||||
|
|
@ -0,0 +1,6 @@ |
|||||||
|
|
||||||
|
|
||||||
|
./darknet detector test ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights data/dog.jpg -i 0 -thresh 0.25 |
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,106 @@ |
|||||||
|
#include "upsample_layer.h" |
||||||
|
#include "cuda.h" |
||||||
|
#include "blas.h" |
||||||
|
|
||||||
|
#include <stdio.h> |
||||||
|
|
||||||
|
layer make_upsample_layer(int batch, int w, int h, int c, int stride) |
||||||
|
{ |
||||||
|
layer l = {0}; |
||||||
|
l.type = UPSAMPLE; |
||||||
|
l.batch = batch; |
||||||
|
l.w = w; |
||||||
|
l.h = h; |
||||||
|
l.c = c; |
||||||
|
l.out_w = w*stride; |
||||||
|
l.out_h = h*stride; |
||||||
|
l.out_c = c; |
||||||
|
if(stride < 0){ |
||||||
|
stride = -stride; |
||||||
|
l.reverse=1; |
||||||
|
l.out_w = w/stride; |
||||||
|
l.out_h = h/stride; |
||||||
|
} |
||||||
|
l.stride = stride; |
||||||
|
l.outputs = l.out_w*l.out_h*l.out_c; |
||||||
|
l.inputs = l.w*l.h*l.c; |
||||||
|
l.delta = calloc(l.outputs*batch, sizeof(float)); |
||||||
|
l.output = calloc(l.outputs*batch, sizeof(float));; |
||||||
|
|
||||||
|
l.forward = forward_upsample_layer; |
||||||
|
l.backward = backward_upsample_layer; |
||||||
|
#ifdef GPU |
||||||
|
l.forward_gpu = forward_upsample_layer_gpu; |
||||||
|
l.backward_gpu = backward_upsample_layer_gpu; |
||||||
|
|
||||||
|
l.delta_gpu = cuda_make_array(l.delta, l.outputs*batch); |
||||||
|
l.output_gpu = cuda_make_array(l.output, l.outputs*batch); |
||||||
|
#endif |
||||||
|
if(l.reverse) fprintf(stderr, "downsample %2dx %4d x%4d x%4d -> %4d x%4d x%4d\n", stride, w, h, c, l.out_w, l.out_h, l.out_c); |
||||||
|
else fprintf(stderr, "upsample %2dx %4d x%4d x%4d -> %4d x%4d x%4d\n", stride, w, h, c, l.out_w, l.out_h, l.out_c); |
||||||
|
return l; |
||||||
|
} |
||||||
|
|
||||||
|
void resize_upsample_layer(layer *l, int w, int h) |
||||||
|
{ |
||||||
|
l->w = w; |
||||||
|
l->h = h; |
||||||
|
l->out_w = w*l->stride; |
||||||
|
l->out_h = h*l->stride; |
||||||
|
if(l->reverse){ |
||||||
|
l->out_w = w/l->stride; |
||||||
|
l->out_h = h/l->stride; |
||||||
|
} |
||||||
|
l->outputs = l->out_w*l->out_h*l->out_c; |
||||||
|
l->inputs = l->h*l->w*l->c; |
||||||
|
l->delta = realloc(l->delta, l->outputs*l->batch*sizeof(float)); |
||||||
|
l->output = realloc(l->output, l->outputs*l->batch*sizeof(float)); |
||||||
|
|
||||||
|
#ifdef GPU |
||||||
|
cuda_free(l->output_gpu); |
||||||
|
cuda_free(l->delta_gpu); |
||||||
|
l->output_gpu = cuda_make_array(l->output, l->outputs*l->batch); |
||||||
|
l->delta_gpu = cuda_make_array(l->delta, l->outputs*l->batch); |
||||||
|
#endif |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void forward_upsample_layer(const layer l, network_state net) |
||||||
|
{ |
||||||
|
fill_cpu(l.outputs*l.batch, 0, l.output, 1); |
||||||
|
if(l.reverse){ |
||||||
|
upsample_cpu(l.output, l.out_w, l.out_h, l.c, l.batch, l.stride, 0, l.scale, net.input); |
||||||
|
}else{ |
||||||
|
upsample_cpu(net.input, l.w, l.h, l.c, l.batch, l.stride, 1, l.scale, l.output); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void backward_upsample_layer(const layer l, network_state state) |
||||||
|
{ |
||||||
|
if(l.reverse){ |
||||||
|
upsample_cpu(l.delta, l.out_w, l.out_h, l.c, l.batch, l.stride, 1, l.scale, state.delta); |
||||||
|
}else{ |
||||||
|
upsample_cpu(state.delta, l.w, l.h, l.c, l.batch, l.stride, 0, l.scale, l.delta); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
#ifdef GPU |
||||||
|
void forward_upsample_layer_gpu(const layer l, network_state state) |
||||||
|
{ |
||||||
|
fill_ongpu(l.outputs*l.batch, 0, l.output_gpu, 1); |
||||||
|
if(l.reverse){ |
||||||
|
upsample_gpu(l.output_gpu, l.out_w, l.out_h, l.c, l.batch, l.stride, 0, l.scale, state.input); |
||||||
|
}else{ |
||||||
|
upsample_gpu(state.input, l.w, l.h, l.c, l.batch, l.stride, 1, l.scale, l.output_gpu); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void backward_upsample_layer_gpu(const layer l, network_state state) |
||||||
|
{ |
||||||
|
if(l.reverse){ |
||||||
|
upsample_gpu(l.delta_gpu, l.out_w, l.out_h, l.c, l.batch, l.stride, 1, l.scale, state.delta); |
||||||
|
}else{ |
||||||
|
upsample_gpu(state.delta, l.w, l.h, l.c, l.batch, l.stride, 0, l.scale, l.delta_gpu); |
||||||
|
} |
||||||
|
} |
||||||
|
#endif |
@ -0,0 +1,17 @@ |
|||||||
|
#ifndef UPSAMPLE_LAYER_H |
||||||
|
#define UPSAMPLE_LAYER_H |
||||||
|
#include "cuda.h" |
||||||
|
#include "layer.h" |
||||||
|
#include "network.h" |
||||||
|
|
||||||
|
layer make_upsample_layer(int batch, int w, int h, int c, int stride); |
||||||
|
void forward_upsample_layer(const layer l, network net); |
||||||
|
void backward_upsample_layer(const layer l, network net); |
||||||
|
void resize_upsample_layer(layer *l, int w, int h); |
||||||
|
|
||||||
|
#ifdef GPU |
||||||
|
void forward_upsample_layer_gpu(const layer l, network net); |
||||||
|
void backward_upsample_layer_gpu(const layer l, network net); |
||||||
|
#endif |
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,381 @@ |
|||||||
|
#include "yolo_layer.h" |
||||||
|
#include "activations.h" |
||||||
|
#include "blas.h" |
||||||
|
#include "box.h" |
||||||
|
#include "cuda.h" |
||||||
|
#include "utils.h" |
||||||
|
|
||||||
|
#include <stdio.h> |
||||||
|
#include <assert.h> |
||||||
|
#include <string.h> |
||||||
|
#include <stdlib.h> |
||||||
|
|
||||||
|
layer make_yolo_layer(int batch, int w, int h, int n, int total, int *mask, int classes) |
||||||
|
{ |
||||||
|
int i; |
||||||
|
layer l = {0}; |
||||||
|
l.type = YOLO; |
||||||
|
|
||||||
|
l.n = n; |
||||||
|
l.total = total; |
||||||
|
l.batch = batch; |
||||||
|
l.h = h; |
||||||
|
l.w = w; |
||||||
|
l.c = n*(classes + 4 + 1); |
||||||
|
l.out_w = l.w; |
||||||
|
l.out_h = l.h; |
||||||
|
l.out_c = l.c; |
||||||
|
l.classes = classes; |
||||||
|
l.cost = calloc(1, sizeof(float)); |
||||||
|
l.biases = calloc(total*2, sizeof(float)); |
||||||
|
if(mask) l.mask = mask; |
||||||
|
else{ |
||||||
|
l.mask = calloc(n, sizeof(int)); |
||||||
|
for(i = 0; i < n; ++i){ |
||||||
|
l.mask[i] = i; |
||||||
|
} |
||||||
|
} |
||||||
|
l.bias_updates = calloc(n*2, sizeof(float)); |
||||||
|
l.outputs = h*w*n*(classes + 4 + 1); |
||||||
|
l.inputs = l.outputs; |
||||||
|
l.truths = 90*(4 + 1); |
||||||
|
l.delta = calloc(batch*l.outputs, sizeof(float)); |
||||||
|
l.output = calloc(batch*l.outputs, sizeof(float)); |
||||||
|
for(i = 0; i < total*2; ++i){ |
||||||
|
l.biases[i] = .5; |
||||||
|
} |
||||||
|
|
||||||
|
l.forward = forward_yolo_layer; |
||||||
|
l.backward = backward_yolo_layer; |
||||||
|
#ifdef GPU |
||||||
|
l.forward_gpu = forward_yolo_layer_gpu; |
||||||
|
l.backward_gpu = backward_yolo_layer_gpu; |
||||||
|
l.output_gpu = cuda_make_array(l.output, batch*l.outputs); |
||||||
|
l.delta_gpu = cuda_make_array(l.delta, batch*l.outputs); |
||||||
|
#endif |
||||||
|
|
||||||
|
fprintf(stderr, "detection\n"); |
||||||
|
srand(0); |
||||||
|
|
||||||
|
return l; |
||||||
|
} |
||||||
|
|
||||||
|
void resize_yolo_layer(layer *l, int w, int h) |
||||||
|
{ |
||||||
|
l->w = w; |
||||||
|
l->h = h; |
||||||
|
|
||||||
|
l->outputs = h*w*l->n*(l->classes + 4 + 1); |
||||||
|
l->inputs = l->outputs; |
||||||
|
|
||||||
|
l->output = realloc(l->output, l->batch*l->outputs*sizeof(float)); |
||||||
|
l->delta = realloc(l->delta, l->batch*l->outputs*sizeof(float)); |
||||||
|
|
||||||
|
#ifdef GPU |
||||||
|
cuda_free(l->delta_gpu); |
||||||
|
cuda_free(l->output_gpu); |
||||||
|
|
||||||
|
l->delta_gpu = cuda_make_array(l->delta, l->batch*l->outputs); |
||||||
|
l->output_gpu = cuda_make_array(l->output, l->batch*l->outputs); |
||||||
|
#endif |
||||||
|
} |
||||||
|
|
||||||
|
box get_yolo_box(float *x, float *biases, int n, int index, int i, int j, int lw, int lh, int w, int h, int stride) |
||||||
|
{ |
||||||
|
box b; |
||||||
|
b.x = (i + x[index + 0*stride]) / lw; |
||||||
|
b.y = (j + x[index + 1*stride]) / lh; |
||||||
|
b.w = exp(x[index + 2*stride]) * biases[2*n] / w; |
||||||
|
b.h = exp(x[index + 3*stride]) * biases[2*n+1] / h; |
||||||
|
return b; |
||||||
|
} |
||||||
|
|
||||||
|
float delta_yolo_box(box truth, float *x, float *biases, int n, int index, int i, int j, int lw, int lh, int w, int h, float *delta, float scale, int stride) |
||||||
|
{ |
||||||
|
box pred = get_yolo_box(x, biases, n, index, i, j, lw, lh, w, h, stride); |
||||||
|
float iou = box_iou(pred, truth); |
||||||
|
|
||||||
|
float tx = (truth.x*lw - i); |
||||||
|
float ty = (truth.y*lh - j); |
||||||
|
float tw = log(truth.w*w / biases[2*n]); |
||||||
|
float th = log(truth.h*h / biases[2*n + 1]); |
||||||
|
|
||||||
|
delta[index + 0*stride] = scale * (tx - x[index + 0*stride]); |
||||||
|
delta[index + 1*stride] = scale * (ty - x[index + 1*stride]); |
||||||
|
delta[index + 2*stride] = scale * (tw - x[index + 2*stride]); |
||||||
|
delta[index + 3*stride] = scale * (th - x[index + 3*stride]); |
||||||
|
return iou; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
void delta_yolo_class(float *output, float *delta, int index, int class, int classes, int stride, float *avg_cat) |
||||||
|
{ |
||||||
|
int n; |
||||||
|
if (delta[index]){ |
||||||
|
delta[index + stride*class] = 1 - output[index + stride*class]; |
||||||
|
if(avg_cat) *avg_cat += output[index + stride*class]; |
||||||
|
return; |
||||||
|
} |
||||||
|
for(n = 0; n < classes; ++n){ |
||||||
|
delta[index + stride*n] = ((n == class)?1 : 0) - output[index + stride*n]; |
||||||
|
if(n == class && avg_cat) *avg_cat += output[index + stride*n]; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
static int entry_index(layer l, int batch, int location, int entry) |
||||||
|
{ |
||||||
|
int n = location / (l.w*l.h); |
||||||
|
int loc = location % (l.w*l.h); |
||||||
|
return batch*l.outputs + n*l.w*l.h*(4+l.classes+1) + entry*l.w*l.h + loc; |
||||||
|
} |
||||||
|
|
||||||
|
void forward_yolo_layer(const layer l, network_state state) |
||||||
|
{ |
||||||
|
int i,j,b,t,n; |
||||||
|
memcpy(l.output, state.input, l.outputs*l.batch*sizeof(float)); |
||||||
|
|
||||||
|
#ifndef GPU |
||||||
|
for (b = 0; b < l.batch; ++b){ |
||||||
|
for(n = 0; n < l.n; ++n){ |
||||||
|
int index = entry_index(l, b, n*l.w*l.h, 0); |
||||||
|
activate_array(l.output + index, 2*l.w*l.h, LOGISTIC); |
||||||
|
index = entry_index(l, b, n*l.w*l.h, 4); |
||||||
|
activate_array(l.output + index, (1+l.classes)*l.w*l.h, LOGISTIC); |
||||||
|
} |
||||||
|
} |
||||||
|
#endif |
||||||
|
|
||||||
|
memset(l.delta, 0, l.outputs * l.batch * sizeof(float)); |
||||||
|
if(!state.train) return; |
||||||
|
float avg_iou = 0; |
||||||
|
float recall = 0; |
||||||
|
float recall75 = 0; |
||||||
|
float avg_cat = 0; |
||||||
|
float avg_obj = 0; |
||||||
|
float avg_anyobj = 0; |
||||||
|
int count = 0; |
||||||
|
int class_count = 0; |
||||||
|
*(l.cost) = 0; |
||||||
|
for (b = 0; b < l.batch; ++b) { |
||||||
|
for (j = 0; j < l.h; ++j) { |
||||||
|
for (i = 0; i < l.w; ++i) { |
||||||
|
for (n = 0; n < l.n; ++n) { |
||||||
|
int box_index = entry_index(l, b, n*l.w*l.h + j*l.w + i, 0); |
||||||
|
box pred = get_yolo_box(l.output, l.biases, l.mask[n], box_index, i, j, l.w, l.h, state.net.w, state.net.h, l.w*l.h); |
||||||
|
float best_iou = 0; |
||||||
|
int best_t = 0; |
||||||
|
for(t = 0; t < l.max_boxes; ++t){ |
||||||
|
box truth = float_to_box(state.truth + t*(4 + 1) + b*l.truths, 1); |
||||||
|
if(!truth.x) break; |
||||||
|
float iou = box_iou(pred, truth); |
||||||
|
if (iou > best_iou) { |
||||||
|
best_iou = iou; |
||||||
|
best_t = t; |
||||||
|
} |
||||||
|
} |
||||||
|
int obj_index = entry_index(l, b, n*l.w*l.h + j*l.w + i, 4); |
||||||
|
avg_anyobj += l.output[obj_index]; |
||||||
|
l.delta[obj_index] = 0 - l.output[obj_index]; |
||||||
|
if (best_iou > l.ignore_thresh) { |
||||||
|
l.delta[obj_index] = 0; |
||||||
|
} |
||||||
|
if (best_iou > l.truth_thresh) { |
||||||
|
l.delta[obj_index] = 1 - l.output[obj_index]; |
||||||
|
|
||||||
|
int class = state.truth[best_t*(4 + 1) + b*l.truths + 4]; |
||||||
|
if (l.map) class = l.map[class]; |
||||||
|
int class_index = entry_index(l, b, n*l.w*l.h + j*l.w + i, 4 + 1); |
||||||
|
delta_yolo_class(l.output, l.delta, class_index, class, l.classes, l.w*l.h, 0); |
||||||
|
box truth = float_to_box(state.truth + best_t*(4 + 1) + b*l.truths, 1); |
||||||
|
delta_yolo_box(truth, l.output, l.biases, l.mask[n], box_index, i, j, l.w, l.h, state.net.w, state.net.h, l.delta, (2-truth.w*truth.h), l.w*l.h); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
for(t = 0; t < l.max_boxes; ++t){ |
||||||
|
box truth = float_to_box(state.truth + t*(4 + 1) + b*l.truths, 1); |
||||||
|
|
||||||
|
if(!truth.x) break; |
||||||
|
float best_iou = 0; |
||||||
|
int best_n = 0; |
||||||
|
i = (truth.x * l.w); |
||||||
|
j = (truth.y * l.h); |
||||||
|
box truth_shift = truth; |
||||||
|
truth_shift.x = truth_shift.y = 0; |
||||||
|
for(n = 0; n < l.total; ++n){ |
||||||
|
box pred = {0}; |
||||||
|
pred.w = l.biases[2*n]/ state.net.w; |
||||||
|
pred.h = l.biases[2*n+1]/ state.net.h; |
||||||
|
float iou = box_iou(pred, truth_shift); |
||||||
|
if (iou > best_iou){ |
||||||
|
best_iou = iou; |
||||||
|
best_n = n; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
int mask_n = int_index(l.mask, best_n, l.n); |
||||||
|
if(mask_n >= 0){ |
||||||
|
int box_index = entry_index(l, b, mask_n*l.w*l.h + j*l.w + i, 0); |
||||||
|
float iou = delta_yolo_box(truth, l.output, l.biases, best_n, box_index, i, j, l.w, l.h, state.net.w, state.net.h, l.delta, (2-truth.w*truth.h), l.w*l.h); |
||||||
|
|
||||||
|
int obj_index = entry_index(l, b, mask_n*l.w*l.h + j*l.w + i, 4); |
||||||
|
avg_obj += l.output[obj_index]; |
||||||
|
l.delta[obj_index] = 1 - l.output[obj_index]; |
||||||
|
|
||||||
|
int class = state.truth[t*(4 + 1) + b*l.truths + 4]; |
||||||
|
if (l.map) class = l.map[class]; |
||||||
|
int class_index = entry_index(l, b, mask_n*l.w*l.h + j*l.w + i, 4 + 1); |
||||||
|
delta_yolo_class(l.output, l.delta, class_index, class, l.classes, l.w*l.h, &avg_cat); |
||||||
|
|
||||||
|
++count; |
||||||
|
++class_count; |
||||||
|
if(iou > .5) recall += 1; |
||||||
|
if(iou > .75) recall75 += 1; |
||||||
|
avg_iou += iou; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
*(l.cost) = pow(mag_array(l.delta, l.outputs * l.batch), 2); |
||||||
|
printf("Region %d Avg IOU: %f, Class: %f, Obj: %f, No Obj: %f, .5R: %f, .75R: %f, count: %d\n", state.index, avg_iou/count, avg_cat/class_count, avg_obj/count, avg_anyobj/(l.w*l.h*l.n*l.batch), recall/count, recall75/count, count); |
||||||
|
} |
||||||
|
|
||||||
|
void backward_yolo_layer(const layer l, network_state state) |
||||||
|
{ |
||||||
|
axpy_cpu(l.batch*l.inputs, 1, l.delta, 1, state.delta, 1); |
||||||
|
} |
||||||
|
|
||||||
|
void correct_yolo_boxes(detection *dets, int n, int w, int h, int netw, int neth, int relative, int letter) |
||||||
|
{ |
||||||
|
int i; |
||||||
|
int new_w=0; |
||||||
|
int new_h=0; |
||||||
|
if (letter) { |
||||||
|
if (((float)netw / w) < ((float)neth / h)) { |
||||||
|
new_w = netw; |
||||||
|
new_h = (h * netw) / w; |
||||||
|
} |
||||||
|
else { |
||||||
|
new_h = neth; |
||||||
|
new_w = (w * neth) / h; |
||||||
|
} |
||||||
|
} |
||||||
|
else { |
||||||
|
new_w = netw; |
||||||
|
new_h = neth; |
||||||
|
} |
||||||
|
for (i = 0; i < n; ++i){ |
||||||
|
box b = dets[i].bbox; |
||||||
|
b.x = (b.x - (netw - new_w)/2./netw) / ((float)new_w/netw);
|
||||||
|
b.y = (b.y - (neth - new_h)/2./neth) / ((float)new_h/neth);
|
||||||
|
b.w *= (float)netw/new_w; |
||||||
|
b.h *= (float)neth/new_h; |
||||||
|
if(!relative){ |
||||||
|
b.x *= w; |
||||||
|
b.w *= w; |
||||||
|
b.y *= h; |
||||||
|
b.h *= h; |
||||||
|
} |
||||||
|
dets[i].bbox = b; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
int yolo_num_detections(layer l, float thresh) |
||||||
|
{ |
||||||
|
int i, n; |
||||||
|
int count = 0; |
||||||
|
for (i = 0; i < l.w*l.h; ++i){ |
||||||
|
for(n = 0; n < l.n; ++n){ |
||||||
|
int obj_index = entry_index(l, 0, n*l.w*l.h + i, 4); |
||||||
|
if(l.output[obj_index] > thresh){ |
||||||
|
++count; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return count; |
||||||
|
} |
||||||
|
|
||||||
|
void avg_flipped_yolo(layer l) |
||||||
|
{ |
||||||
|
int i,j,n,z; |
||||||
|
float *flip = l.output + l.outputs; |
||||||
|
for (j = 0; j < l.h; ++j) { |
||||||
|
for (i = 0; i < l.w/2; ++i) { |
||||||
|
for (n = 0; n < l.n; ++n) { |
||||||
|
for(z = 0; z < l.classes + 4 + 1; ++z){ |
||||||
|
int i1 = z*l.w*l.h*l.n + n*l.w*l.h + j*l.w + i; |
||||||
|
int i2 = z*l.w*l.h*l.n + n*l.w*l.h + j*l.w + (l.w - i - 1); |
||||||
|
float swap = flip[i1]; |
||||||
|
flip[i1] = flip[i2]; |
||||||
|
flip[i2] = swap; |
||||||
|
if(z == 0){ |
||||||
|
flip[i1] = -flip[i1]; |
||||||
|
flip[i2] = -flip[i2]; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
for(i = 0; i < l.outputs; ++i){ |
||||||
|
l.output[i] = (l.output[i] + flip[i])/2.; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
int get_yolo_detections(layer l, int w, int h, int netw, int neth, float thresh, int *map, int relative, detection *dets, int letter) |
||||||
|
{ |
||||||
|
int i,j,n; |
||||||
|
float *predictions = l.output; |
||||||
|
if (l.batch == 2) avg_flipped_yolo(l); |
||||||
|
int count = 0; |
||||||
|
for (i = 0; i < l.w*l.h; ++i){ |
||||||
|
int row = i / l.w; |
||||||
|
int col = i % l.w; |
||||||
|
for(n = 0; n < l.n; ++n){ |
||||||
|
int obj_index = entry_index(l, 0, n*l.w*l.h + i, 4); |
||||||
|
float objectness = predictions[obj_index]; |
||||||
|
if(objectness <= thresh) continue; |
||||||
|
int box_index = entry_index(l, 0, n*l.w*l.h + i, 0); |
||||||
|
dets[count].bbox = get_yolo_box(predictions, l.biases, l.mask[n], box_index, col, row, l.w, l.h, netw, neth, l.w*l.h); |
||||||
|
dets[count].objectness = objectness; |
||||||
|
dets[count].classes = l.classes; |
||||||
|
for(j = 0; j < l.classes; ++j){ |
||||||
|
int class_index = entry_index(l, 0, n*l.w*l.h + i, 4 + 1 + j); |
||||||
|
float prob = objectness*predictions[class_index]; |
||||||
|
dets[count].prob[j] = (prob > thresh) ? prob : 0; |
||||||
|
} |
||||||
|
++count; |
||||||
|
} |
||||||
|
} |
||||||
|
correct_yolo_boxes(dets, count, w, h, netw, neth, relative, letter); |
||||||
|
return count; |
||||||
|
} |
||||||
|
|
||||||
|
#ifdef GPU |
||||||
|
|
||||||
|
void forward_yolo_layer_gpu(const layer l, network_state state) |
||||||
|
{ |
||||||
|
copy_ongpu(l.batch*l.inputs, state.input, 1, l.output_gpu, 1); |
||||||
|
int b, n; |
||||||
|
for (b = 0; b < l.batch; ++b){ |
||||||
|
for(n = 0; n < l.n; ++n){ |
||||||
|
int index = entry_index(l, b, n*l.w*l.h, 0); |
||||||
|
activate_array_ongpu(l.output_gpu + index, 2*l.w*l.h, LOGISTIC); |
||||||
|
index = entry_index(l, b, n*l.w*l.h, 4); |
||||||
|
activate_array_ongpu(l.output_gpu + index, (1+l.classes)*l.w*l.h, LOGISTIC); |
||||||
|
} |
||||||
|
} |
||||||
|
if(!state.train || l.onlyforward){ |
||||||
|
cuda_pull_array(l.output_gpu, l.output, l.batch*l.outputs); |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
cuda_pull_array(l.output_gpu, state.input, l.batch*l.inputs); |
||||||
|
forward_yolo_layer(l, state); |
||||||
|
cuda_push_array(l.delta_gpu, l.delta, l.batch*l.outputs); |
||||||
|
} |
||||||
|
|
||||||
|
void backward_yolo_layer_gpu(const layer l, network_state state) |
||||||
|
{ |
||||||
|
axpy_ongpu(l.batch*l.inputs, 1, l.delta_gpu, 1, state.delta, 1); |
||||||
|
} |
||||||
|
#endif |
||||||
|
|
@ -0,0 +1,20 @@ |
|||||||
|
#ifndef YOLO_LAYER_H |
||||||
|
#define YOLO_LAYER_H |
||||||
|
|
||||||
|
//#include "darknet.h"
|
||||||
|
#include "layer.h" |
||||||
|
#include "network.h" |
||||||
|
|
||||||
|
layer make_yolo_layer(int batch, int w, int h, int n, int total, int *mask, int classes); |
||||||
|
void forward_yolo_layer(const layer l, network net); |
||||||
|
void backward_yolo_layer(const layer l, network net); |
||||||
|
void resize_yolo_layer(layer *l, int w, int h); |
||||||
|
int yolo_num_detections(layer l, float thresh); |
||||||
|
int get_yolo_detections(layer l, int w, int h, int netw, int neth, float thresh, int *map, int relative, detection *dets, int letter); |
||||||
|
|
||||||
|
#ifdef GPU |
||||||
|
void forward_yolo_layer_gpu(const layer l, network net); |
||||||
|
void backward_yolo_layer_gpu(layer l, network net); |
||||||
|
#endif |
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,6 @@ |
|||||||
|
|
||||||
|
|
||||||
|
./darknet detector demo ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights test50.mp4 -i 0 -thresh 0.25 |
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in new issue