Network conversion - DigitalMediaProfessionals/dv-sdk GitHub Wiki

Run the script

The network convertor is written in Python. To run the network convertor, simply type the following commands in console:

$ cd tool
$ python3 convertor.py ../application/model/caffe_mobilenet.ini

Input configuration

The convertor script take the .ini file as the configurations the input network, which has the following settings:

[INPUT]
name = CaffeMobileNet                   ;<- Put your network name here
definition = mobilenet_deploy.prototxt  ;<- Network definition
data = mobilenet.caffemodel             ;<- Network weights
origin = CAFFE                          ;<- Network origin type

[OUTPUT]
output_folder = "../"            ;<- Output folder root. Actual output is in output_folder/name
generate_source = 1              ;If enabled, generate the .cpp and .h source files for the network
generate_doxy 	= 1              ;If enabled, generate the doxygen documentation for the generate code 
generate_dot 	= 1              ;If enabled, add the resulting network graph to documentation using dot format
...

Please refer to Input config to see all available configs.

Files generated

  • CaffeMobileNet_gen.cpp(.h): The source code of converted network configurations.
  • CaffeMobileNet_weights.bin: The packed network weights
  • doc folder: Generated doxygen document sources.

One can generate the documentation for the converted network, if Doxygen and GraphWiz are installed, with the following command:

$ cd application/CaffeMobileNet/doc
$ doxygen

Then open application/CaffeMobileNet/doc/html/index.html to view the documentation.