• ## Darknet19的实现

千次阅读 2020-04-24 17:03:53
环境设置：tensorflow2.1...#darknet19细节 import tensorflow as tf from tensorflow.keras.layers import Dense,Flatten,Conv2D,MaxPooling2D,ZeroPadding2D,UpSampling2D from tensorflow.keras.layers import In...
环境设置：tensorflow2.1

代码如下：

#darknet19细节
import tensorflow as tf
from tensorflow.keras.layers import Dense,Flatten,Conv2D,MaxPooling2D,ZeroPadding2D,UpSampling2D
from tensorflow.keras.layers import Input,AveragePooling2D,Activation
from tensorflow.keras import Model
inputs=Input([256,256,3])
"""
#前面两层卷积的结构函数
"""
def conv2d_1(filters,inputs):
x=MaxPooling2D()(x)
return x

def conv2d_2(filters,inputs):
filter1,filter2=filters
x=MaxPooling2D()(x)
return x
def conv2d_3(filters,inputs):
filter1,filter2=filters
return x

x=conv2d_1(32,inputs)
x=conv2d_1(64,x)

x=conv2d_2([128,64],x)
x=conv2d_2([256,128],x)
x=conv2d_3([512,256],x)
x=MaxPooling2D()(x)
x=conv2d_3([1024,512],x)
x=AveragePooling2D(pool_size=(8,8))(x)
x=Flatten()(x)
x=Activation('softmax')(x)
model=Model(inputs,x)
model.summary()

可以通过model.summary()查看网络结构

#darknet19结构图
"""
Model: "model"
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
input_1 (InputLayer)         [(None, 256, 256, 3)]     0
_________________________________________________________________
conv2d (Conv2D)              (None, 256, 256, 32)      896
_________________________________________________________________
max_pooling2d (MaxPooling2D) (None, 128, 128, 32)      0
_________________________________________________________________
conv2d_1 (Conv2D)            (None, 128, 128, 64)      18496
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 64, 64, 64)        0
_________________________________________________________________
conv2d_2 (Conv2D)            (None, 64, 64, 128)       73856
_________________________________________________________________
conv2d_3 (Conv2D)            (None, 64, 64, 64)        8256
_________________________________________________________________
conv2d_4 (Conv2D)            (None, 64, 64, 128)       73856
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 32, 32, 128)       0
_________________________________________________________________
conv2d_5 (Conv2D)            (None, 32, 32, 256)       295168
_________________________________________________________________
conv2d_6 (Conv2D)            (None, 32, 32, 128)       32896
_________________________________________________________________
conv2d_7 (Conv2D)            (None, 32, 32, 256)       295168
_________________________________________________________________
max_pooling2d_3 (MaxPooling2 (None, 16, 16, 256)       0
_________________________________________________________________
conv2d_8 (Conv2D)            (None, 16, 16, 512)       1180160
_________________________________________________________________
conv2d_9 (Conv2D)            (None, 16, 16, 256)       131328
_________________________________________________________________
conv2d_10 (Conv2D)           (None, 16, 16, 512)       1180160
_________________________________________________________________
conv2d_11 (Conv2D)           (None, 16, 16, 256)       131328
_________________________________________________________________
conv2d_12 (Conv2D)           (None, 16, 16, 512)       1180160
_________________________________________________________________
max_pooling2d_4 (MaxPooling2 (None, 8, 8, 512)         0
_________________________________________________________________
conv2d_13 (Conv2D)           (None, 8, 8, 1024)        4719616
_________________________________________________________________
conv2d_14 (Conv2D)           (None, 8, 8, 512)         524800
_________________________________________________________________
conv2d_15 (Conv2D)           (None, 8, 8, 1024)        4719616
_________________________________________________________________
conv2d_16 (Conv2D)           (None, 8, 8, 512)         524800
_________________________________________________________________
conv2d_17 (Conv2D)           (None, 8, 8, 1024)        4719616
_________________________________________________________________
conv2d_18 (Conv2D)           (None, 8, 8, 1000)        1025000
_________________________________________________________________
average_pooling2d (AveragePo (None, 1, 1, 1000)        0
_________________________________________________________________
flatten (Flatten)            (None, 1000)              0
_________________________________________________________________
activation (Activation)      (None, 1000)              0
=================================================================
Total params: 20,835,176
Trainable params: 20,835,176
Non-trainable params: 0
"""


展开全文
• yolov2预训练权重darknet19.weights，可以不通过外网下载，直接在百度网盘提取下载即可
• darknet是一个较为轻型的完全基于C与CUDA的开源深度学习框架，其主要特点就是容易安装，没有任何依赖项（OpenCV都可以不用），移植性非常好，支持CPU与GPU两种计算方式。Darknet的优势： darknet完全由C语言实现，...
• Darknet: Open Source Neural Networks in C - Classifying With darknet19.weights Models Darknet is an open source neural network framework written in C and CUDA. It is fast, easy to install, and ...
Darknet: Open Source Neural Networks in C - Classifying With darknet19.weights Models
Darknet is an open source neural network framework written in C and CUDA. It is fast, easy to install, and supports CPU and GPU computation. You can find the source on GitHub or you can read more about what Darknet can do right here:
https://github.com/pjreddie/darknet
1. ImageNet Classification
https://pjreddie.com/darknet/imagenet/
Classify images with popular models like ResNet and ResNeXt.
You can use Darknet to classify images for the 1000-class ImageNet challenge. If you haven’t installed Darknet yet, you should do that first.
http://image-net.org/challenges/LSVRC/2015/index
https://pjreddie.com/darknet/install/
1.1 Classifying With Pre-Trained Models
Here are the commands to install Darknet, download a classification weights file, and run a classifier on an image:
git clone https://github.com/pjreddie/darknet.git
cd darknet
make
wget https://pjreddie.com/media/files/darknet19.weights
./darknet classifier predict cfg/imagenet1k.data cfg/darknet19.cfg darknet19.weights data/dog.jpg

strong@foreverstrong:~/eclipse-darknet/darknet_models$wget https://pjreddie.com/media/files/darknet19.weights --2018-11-07 19:51:53-- https://pjreddie.com/media/files/darknet19.weights Resolving pjreddie.com (pjreddie.com)... 128.208.3.39 Connecting to pjreddie.com (pjreddie.com)|128.208.3.39|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 83427120 (80M) [application/octet-stream] Saving to: ‘darknet19.weights’ darknet19.weights 100%[===========================================>] 79.56M 3.49MB/s in 26s 2018-11-07 19:52:20 (3.08 MB/s) - ‘darknet19.weights’ saved [83427120/83427120] strong@foreverstrong:~/eclipse-darknet/darknet_models$

This example uses the Darknet19 model, you can read more about it below. After running this command you should see the following output:
https://pjreddie.com/darknet/imagenet/#darknet19
layer     filters    size              input                output
0 conv     32  3 x 3 / 1   256 x 256 x   3   ->   256 x 256 x  32  0.113 BFLOPs
1 max          2 x 2 / 2   256 x 256 x  32   ->   128 x 128 x  32
2 conv     64  3 x 3 / 1   128 x 128 x  32   ->   128 x 128 x  64  0.604 BFLOPs
3 max          2 x 2 / 2   128 x 128 x  64   ->    64 x  64 x  64
4 conv    128  3 x 3 / 1    64 x  64 x  64   ->    64 x  64 x 128  0.604 BFLOPs
5 conv     64  1 x 1 / 1    64 x  64 x 128   ->    64 x  64 x  64  0.067 BFLOPs
6 conv    128  3 x 3 / 1    64 x  64 x  64   ->    64 x  64 x 128  0.604 BFLOPs
7 max          2 x 2 / 2    64 x  64 x 128   ->    32 x  32 x 128
8 conv    256  3 x 3 / 1    32 x  32 x 128   ->    32 x  32 x 256  0.604 BFLOPs
9 conv    128  1 x 1 / 1    32 x  32 x 256   ->    32 x  32 x 128  0.067 BFLOPs
10 conv    256  3 x 3 / 1    32 x  32 x 128   ->    32 x  32 x 256  0.604 BFLOPs
11 max          2 x 2 / 2    32 x  32 x 256   ->    16 x  16 x 256
12 conv    512  3 x 3 / 1    16 x  16 x 256   ->    16 x  16 x 512  0.604 BFLOPs
13 conv    256  1 x 1 / 1    16 x  16 x 512   ->    16 x  16 x 256  0.067 BFLOPs
14 conv    512  3 x 3 / 1    16 x  16 x 256   ->    16 x  16 x 512  0.604 BFLOPs
15 conv    256  1 x 1 / 1    16 x  16 x 512   ->    16 x  16 x 256  0.067 BFLOPs
16 conv    512  3 x 3 / 1    16 x  16 x 256   ->    16 x  16 x 512  0.604 BFLOPs
17 max          2 x 2 / 2    16 x  16 x 512   ->     8 x   8 x 512
18 conv   1024  3 x 3 / 1     8 x   8 x 512   ->     8 x   8 x1024  0.604 BFLOPs
19 conv    512  1 x 1 / 1     8 x   8 x1024   ->     8 x   8 x 512  0.067 BFLOPs
20 conv   1024  3 x 3 / 1     8 x   8 x 512   ->     8 x   8 x1024  0.604 BFLOPs
21 conv    512  1 x 1 / 1     8 x   8 x1024   ->     8 x   8 x 512  0.067 BFLOPs
22 conv   1024  3 x 3 / 1     8 x   8 x 512   ->     8 x   8 x1024  0.604 BFLOPs
23 conv   1000  1 x 1 / 1     8 x   8 x1024   ->     8 x   8 x1000  0.131 BFLOPs
24 avg                        8 x   8 x1000   ->  1000
25 softmax                                        1000
data/dog.jpg: Predicted in 0.769246 seconds.
42.55%: malamute
22.93%: Eskimo dog
12.51%: Siberian husky
2.76%: bicycle-built-for-two
1.20%: mountain bike

malamute ['mæləmjuːt]：n. 北极狗，爱斯基摩狗
Eskimo dog：爱斯基摩狗，北极雪橇狗
Siberian husky：西伯利亚爱斯基摩狗
mountain bike：n. 山地车，山地自行车

Darknet displays information as it loads the config file and weights, then it classifies the image and prints the top-10 classes for the image. Kelp is a mixed breed dog but she has a lot of malamute in her so we’ll consider this a success!
kelp [kelp]：n. 巨藻，海藻，海草灰 vi. 烧制海草灰

You can also try with other images, like the bald eagle image:
./darknet classifier predict cfg/imagenet1k.data cfg/darknet19.cfg darknet19.weights data/eagle.jpg

Which produces:
...
data/eagle.jpg: Predicted in 0.707070 seconds.
84.68%: bald eagle
11.91%: kite
2.62%: vulture
0.08%: great grey owl
0.07%: hen

bald eagle：秃鹰 (美国的国鸟)，比喻秃头的政治家
vulture ['vʌltʃə]：n. 秃鹰，秃鹫，贪婪的人
owl [aʊl]：n. 猫头鹰，枭，惯于晚上活动的人
hen [hen]：n. 母鸡，女人，雌禽

Pretty good!
If you don’t specify an image file you will be prompted at run-time for an image. This way you can classify multiple in a row without reloading the whole model. Use the command:
./darknet classifier predict cfg/imagenet1k.data cfg/darknet19.cfg darknet19.weights

Then you will get a prompt that looks like:
....
25: Softmax Layer: 1000 inputs
Enter Image Path:

Whenever you get bored of classifying images you can use Ctrl-C to exit the program.
1. Makefile
GPU=1
CUDNN=1
OPENCV=0
OPENMP=0
DEBUG=0

2. Program Arguments
right-click on the darknet_181107 -> Properties -> Run/Debug Settings -> New -> C/C++ Application -> OK

/home/strong/eclipse-darknet/darknet_models/darknet19.weights
terminal
./darknet classifier predict cfg/imagenet1k.data cfg/darknet19.cfg darknet19.weights data/dog.jpg

argument
classifier predict cfg/imagenet1k.data cfg/darknet19.cfg /home/strong/eclipse-darknet/darknet_models/darknet19.weights data/dog.jpg


Run darknet_181107-darknet19
right-click on the darknet_181107 -> Properties -> Run As -> Run Configurations…

Run

layer     filters    size              input                output
0 conv     32  3 x 3 / 1   256 x 256 x   3   ->   256 x 256 x  32  0.113 BFLOPs
1 max          2 x 2 / 2   256 x 256 x  32   ->   128 x 128 x  32
2 conv     64  3 x 3 / 1   128 x 128 x  32   ->   128 x 128 x  64  0.604 BFLOPs
3 max          2 x 2 / 2   128 x 128 x  64   ->    64 x  64 x  64
4 conv    128  3 x 3 / 1    64 x  64 x  64   ->    64 x  64 x 128  0.604 BFLOPs
5 conv     64  1 x 1 / 1    64 x  64 x 128   ->    64 x  64 x  64  0.067 BFLOPs
6 conv    128  3 x 3 / 1    64 x  64 x  64   ->    64 x  64 x 128  0.604 BFLOPs
7 max          2 x 2 / 2    64 x  64 x 128   ->    32 x  32 x 128
8 conv    256  3 x 3 / 1    32 x  32 x 128   ->    32 x  32 x 256  0.604 BFLOPs
9 conv    128  1 x 1 / 1    32 x  32 x 256   ->    32 x  32 x 128  0.067 BFLOPs
10 conv    256  3 x 3 / 1    32 x  32 x 128   ->    32 x  32 x 256  0.604 BFLOPs
11 max          2 x 2 / 2    32 x  32 x 256   ->    16 x  16 x 256
12 conv    512  3 x 3 / 1    16 x  16 x 256   ->    16 x  16 x 512  0.604 BFLOPs
13 conv    256  1 x 1 / 1    16 x  16 x 512   ->    16 x  16 x 256  0.067 BFLOPs
14 conv    512  3 x 3 / 1    16 x  16 x 256   ->    16 x  16 x 512  0.604 BFLOPs
15 conv    256  1 x 1 / 1    16 x  16 x 512   ->    16 x  16 x 256  0.067 BFLOPs
16 conv    512  3 x 3 / 1    16 x  16 x 256   ->    16 x  16 x 512  0.604 BFLOPs
17 max          2 x 2 / 2    16 x  16 x 512   ->     8 x   8 x 512
18 conv   1024  3 x 3 / 1     8 x   8 x 512   ->     8 x   8 x1024  0.604 BFLOPs
19 conv    512  1 x 1 / 1     8 x   8 x1024   ->     8 x   8 x 512  0.067 BFLOPs
20 conv   1024  3 x 3 / 1     8 x   8 x 512   ->     8 x   8 x1024  0.604 BFLOPs
21 conv    512  1 x 1 / 1     8 x   8 x1024   ->     8 x   8 x 512  0.067 BFLOPs
22 conv   1024  3 x 3 / 1     8 x   8 x 512   ->     8 x   8 x1024  0.604 BFLOPs
23 conv   1000  1 x 1 / 1     8 x   8 x1024   ->     8 x   8 x1000  0.131 BFLOPs
24 avg                        8 x   8 x1000   ->  1000
25 softmax                                        1000
data/dog.jpg: Predicted in 0.005434 seconds.
42.07%: malamute
23.15%: Eskimo dog
12.66%: Siberian husky
2.79%: bicycle-built-for-two
1.20%: mountain bike

Wordbook
you only look once，YOLO
Visual Object Classes，VOC
Pattern Analysis, Statistical Modelling and Computational Learning，PASCAL
mean Average Precision，mAP：平均精度均值
floating point operations per second，FLOPS
frame rate or frame frequency, frames per second，FPS
hertz，Hz
billion，Bn
operations，Ops
configuration，cfg
ImageNet Large Scale Visual Recognition Challenge，ILSVRC
Microsoft Common Objects in Context，MS COCO


展开全文
• 迁移学习（Transfer Learning）：Matlab预训练模型的原始安装程序，用于特征提取、表达、目标识别等诸多任务
• ## yolo.v2 darknet19结构

千次阅读 2018-06-28 10:44:00
Darknet19( (conv1s): Sequential( (0): Sequential( (0): Conv2d_BatchNorm( (conv): Conv2d(3, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False) (b...


Darknet19(
(conv1s): Sequential(
(0): Sequential(
(0): Conv2d_BatchNorm(
(conv): Conv2d(3, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(32, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
)
(1): Sequential(
(0): MaxPool2d(kernel_size=(2, 2), stride=(2, 2), dilation=(1, 1), ceil_mode=False)
(1): Conv2d_BatchNorm(
(conv): Conv2d(32, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(64, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
)
(2): Sequential(
(0): MaxPool2d(kernel_size=(2, 2), stride=(2, 2), dilation=(1, 1), ceil_mode=False)
(1): Conv2d_BatchNorm(
(conv): Conv2d(64, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(128, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(2): Conv2d_BatchNorm(
(conv): Conv2d(128, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn): BatchNorm2d(64, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(3): Conv2d_BatchNorm(
(conv): Conv2d(64, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(128, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
)
(3): Sequential(
(0): MaxPool2d(kernel_size=(2, 2), stride=(2, 2), dilation=(1, 1), ceil_mode=False)
(1): Conv2d_BatchNorm(
(conv): Conv2d(128, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(256, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(2): Conv2d_BatchNorm(
(conv): Conv2d(256, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn): BatchNorm2d(128, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(3): Conv2d_BatchNorm(
(conv): Conv2d(128, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(256, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
)
(4): Sequential(
(0): MaxPool2d(kernel_size=(2, 2), stride=(2, 2), dilation=(1, 1), ceil_mode=False)
(1): Conv2d_BatchNorm(
(conv): Conv2d(256, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(512, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(2): Conv2d_BatchNorm(
(conv): Conv2d(512, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn): BatchNorm2d(256, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(3): Conv2d_BatchNorm(
(conv): Conv2d(256, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(512, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(4): Conv2d_BatchNorm(
(conv): Conv2d(512, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn): BatchNorm2d(256, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(5): Conv2d_BatchNorm(
(conv): Conv2d(256, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(512, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
)
)
(conv2): Sequential(
(0): MaxPool2d(kernel_size=(2, 2), stride=(2, 2), dilation=(1, 1), ceil_mode=False)
(1): Conv2d_BatchNorm(
(conv): Conv2d(512, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(1024, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(2): Conv2d_BatchNorm(
(conv): Conv2d(1024, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn): BatchNorm2d(512, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(3): Conv2d_BatchNorm(
(conv): Conv2d(512, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(1024, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(4): Conv2d_BatchNorm(
(conv): Conv2d(1024, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn): BatchNorm2d(512, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(5): Conv2d_BatchNorm(
(conv): Conv2d(512, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(1024, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
)
(conv3): Sequential(
(0): Conv2d_BatchNorm(
(conv): Conv2d(1024, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(1024, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
(1): Conv2d_BatchNorm(
(conv): Conv2d(1024, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(1024, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
)
(reorg): ReorgLayer(
)
(conv4): Sequential(
(0): Conv2d_BatchNorm(
(conv): Conv2d(3072, 1024, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(1024, eps=1e-05, momentum=0.01, affine=True)
(relu): LeakyReLU(0.1, inplace)
)
)
(conv5): Conv2d(
(conv): Conv2d(1024, 125, kernel_size=(1, 1), stride=(1, 1))
)
(global_average_pool): AvgPool2d(kernel_size=(1, 1), stride=(1, 1), padding=0, ceil_mode=False, count_include_pad=True)
)

转载于:https://www.cnblogs.com/buyizhiyou/p/9237527.html
展开全文
• darknet19-voc：在VOC数据集上训练的Darknet-19基本网络。 darknet19-coco：在COCO数据集上训练的Darknet-19基本网络。 tinyYOLOv2-coco：在COCO数据集上训练的较小的基础网络。 对经过训练的预训练网络进行检测以...
• darknet是一个较为轻型的完全基于C与CUDA的开源深度学习框架，其主要特点就是容易安装，没有任何依赖项（OpenCV都可以不用），移植性非常好，支持CPU与GPU两种计算方式。Darknet的优势： darknet完全由C语言实现，...
• ## darknet19的配置文件

千次阅读 2018-08-31 10:34:00
batch=128 subdivisions=1 height=224 width=224 channels=3//图像的通道数 momentum=0.9//动量 decay=0.0005、、权重衰减正则项，防止过拟合 max_crop=448 learning_rate=0.1、、初始学习率 policy=poly、、随着...
[net]
batch=128
subdivisions=1
height=224
width=224
channels=3//图像的通道数
momentum=0.9//动量
decay=0.0005、、权重衰减正则项，防止过拟合
max_crop=448

learning_rate=0.1、、初始学习率
policy=poly、、随着迭代次数的增加不断调整
power=4、、pow开方的次数
max_batches=1600000、、最大迭代次数

[convolutional]
batch_normalize=1、、是否做bn处理
filters=32、、输出多少个特征图
size=3、、卷积核的尺寸
stride=1、、做卷积运算的步长
activation=leaky

[maxpool]
size=2、、池化的尺寸
stride=2、、池化的步长

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

[maxpool]
size=2
stride=2

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

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

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

[maxpool]
size=2
stride=2

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

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

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

[maxpool]
size=2
stride=2

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

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

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

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

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

[maxpool]
size=2
stride=2

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

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

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

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

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

[convolutional]
filters=1000
size=1
stride=1
activation=linear

[avgpool]

[softmax]
groups=1

[cost]
type=sse//拟合数据和真实数据对应的误差平方和


展开全文
• functools 函数 partial 函数 partial函数（偏函数） 可以将一个函数的参数设为默认值，返回一个新函数，使调用更加简单、方便 import functools as f def print_function(*args,**kwargs):#*args可以传递元组，**...
• 第一: LeNet5 import tensorflow as tf from tensorflow import keras from tensorflow.keras import datasets, layers, optimizers, Sequential, metrics model = Sequential() model.add( layers.Input( shape =...
• ## darknet

千次阅读 2019-06-08 21:46:16
他是yolo v2中的特征提取器，因为它有19层卷积，所以又叫做darknet19。 它如下图为他的结构，包括19个卷积层和5个maxpooling层。Darknet-19与VGG16模型设计原则是一致的，主要采用3 * 3卷积，采用2 * 2的maxpooling...
• <p>Have you ever tried the darknet-19 version of yolov2? (original version in paper) When I replace the mobilenet into darknet-19, I can only get 55.5 mAP, which is even worse than yolov1...</p><p>该...
• YOLO作者自己写的一个深度学习框架叫darknet（见YOLO原文2.2部分），后来在YOLO9000中又提了一个基于ResNet魔改的19层卷积网络，称为Darknet-19，在YOLOv3中又提了一个更深的Darknet-53。这两个都是用于提取特征的...
• CV 经典主干网络 (Backbone) 系列: Darknet-19 作者：Joseph Redmon 发表时间：2016 Paper 原文： YOLO9000: Better, Faster, Stronger 该篇是 CV 经典主干网络 (Backbone) 系列 下的一篇文章。 1. 网络结构 Darknet...

...