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.

36 Downloads

Updated 30 Jun 2020

View Version History

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://github.com/cuixing158/yolov3-yolov4-matlab), GitHub. Retrieved .

Comments and Ratings (8)

jt zhang

Liu Fred

cui

hi, cosku oksuz:
Can you ensure that the cfg and weights files correspond to each other? If there is a problem with the consistency, you can share your model file.

cosku oksuz

I am getting an following error when using the new version.

Error using importDarknetWeights (line 82)
方差应该大于0!

cui

2020.7.1 new vision, support yolov4-tiny and yolov3-tiny-prn

lingyun gou

非常棒,如果出现输入参数不足的报错请参考https://github.com/cuixing158/yolov3-yolov4-matlab/issues/9

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');

MATLAB Release Compatibility
Created with R2019a
Compatible with R2019a and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!