File Exchange

image thumbnail

yolov3-yolov4-matlab

version 1.2.0 (1.52 MB) by cui
Import and export Darknet™ models within MATLAB deep learning networks.

32 Downloads

Updated 13 May 2020

GitHub view license on GitHub

Import and export Darknet models(https://github.com/pjreddie/darknet) within MATLAB deep learning networks. The importer can import all the seriesNetworks in the darknet and some simple DAGnetworks. The exporter can export all the seriesNetworks and some of the backbone networks. In addition to importing the deep neural network, the importer can obtain the feature map size of the network, the number of parameters, and the computational power FLOPs. For yolov2, yolov3 can also import a number of previous modules for later access to the yolo layer. This program requires Matlab2019a version and above, no other dependencies.

在MATLAB深度学习网络中导入和导出Darknet模型(https://github.com/pjreddie/darknet)。importer 可以导入darknet中所有的seriesNetwork和部分简单的DAGnetwork,exporter可以导出所有的seriesNetwork和部分的backbone网络。其中importer除了导入深度神经网络外,可以获得网络的特征图大小,参数个数,计算力FLOPs。对于yolov2,yolov3也可导入前面的若干Module,以供后期接入yolo层。此程序要求Matlab2019a版本及以上,无其他任何依赖。

使用示例见main.mlx

Cite As

cui (2020). yolov3-yolov4-matlab (https://www.github.com/cuixing158/DeepLearning-Converter-for-Darknet-Matlab-Model-Format), GitHub. Retrieved .

Comments and Ratings (2)

Abdullah

I am getting error, can you help?

cfg_file = 'model/darknet19.cfg';
weight_file = 'model/darknet19.weights';
[mynet,hyperParams,numsNetParams,FLOPs] = importDarknetNetwork(cfg_file,weight_file);

This module No: 2 [convolutional],have #params:1024 ,FLops:67108864 ,feature map size:(256*256)
This module No: 4 [convolutional],have #params:18752 ,FLops:307232768 ,feature map size:(128*128)
This module No: 6 [convolutional],have #params:74368 ,FLops:304611328 ,feature map size:( 64* 64)
This module No: 7 [convolutional],have #params:8512 ,FLops:34865152 ,feature map size:( 64* 64)
This module No: 8 [convolutional],have #params:74368 ,FLops:304611328 ,feature map size:( 64* 64)
This module No:10 [convolutional],have #params:296192 ,FLops:303300608 ,feature map size:( 32* 32)
This module No:11 [convolutional],have #params:33408 ,FLops:34209792 ,feature map size:( 32* 32)
This module No:12 [convolutional],have #params:296192 ,FLops:303300608 ,feature map size:( 32* 32)
This module No:14 [convolutional],have #params:1182208 ,FLops:302645248 ,feature map size:( 16* 16)
This module No:15 [convolutional],have #params:132352 ,FLops:33882112 ,feature map size:( 16* 16)
This module No:16 [convolutional],have #params:1182208 ,FLops:302645248 ,feature map size:( 16* 16)
This module No:17 [convolutional],have #params:132352 ,FLops:33882112 ,feature map size:( 16* 16)
This module No:18 [convolutional],have #params:1182208 ,FLops:302645248 ,feature map size:( 16* 16)
This module No:20 [convolutional],have #params:4723712 ,FLops:302317568 ,feature map size:( 8* 8)
This module No:21 [convolutional],have #params:526848 ,FLops:33718272 ,feature map size:( 8* 8)
This module No:22 [convolutional],have #params:4723712 ,FLops:302317568 ,feature map size:( 8* 8)
This module No:23 [convolutional],have #params:526848 ,FLops:33718272 ,feature map size:( 8* 8)
This module No:24 [convolutional],have #params:4723712 ,FLops:302317568 ,feature map size:( 8* 8)
This module No:25 [convolutional],have #params:1025000 ,FLops:65600000 ,feature map size:( 8* 8)
Error using fread
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in importDarknetNetwork (line 28)
header = fread(fid_w, 3, '*int32');

Updates

1.2.0

1、Support original version of darknet model;
2、Support training, inference, import and export of "* .cfg", "* .weights" models;
3、Support the latest yolov3, yolov4 models;
4、Support darknet classification model;
5、Support all kinds of indicators such

1.1.0

git reposity is here:
https://github.com/cuixing158/DeepLearning-Converter-for-Darknet-Matlab-Model-Format

MATLAB Release Compatibility
Created with R2019a
Compatible with R2019a to any release
Platform Compatibility
Windows macOS Linux