History

dnn: change .model file format to put layer number at the end of file

currently, the layer number is at the beginning of the .model file, so we have to scan twice in python script, the first scan to get the layer number. Only one scan needed after put the layer number at the end of .model file.

Guo, Yejun committed 7 years ago

Commit 2d5e39c1 parent 09a455a2 files · +3 −11Browse files

Showing the changes to libavfilter (1 of 2 files). Show all

Unified · Split

libavfilter/dnn/dnn_backend_native.c+2−0
@@ -93,8 +93,10 @@ DNNModel *ff_dnn_load_model_native(const char *model_filename) · 92 unmodified lines
93 }93 }
94 model->model = (void *)network;94 model->model = (void *)network;
95 95
96 avio_seek(model_file_context, file_size - 4, SEEK_SET);
96 network->layers_num = (int32_t)avio_rl32(model_file_context);97 network->layers_num = (int32_t)avio_rl32(model_file_context);
97 dnn_size = 4;98 dnn_size = 4;
99 avio_seek(model_file_context, 0, SEEK_SET);
98 100
99 network->layers = av_mallocz(network->layers_num * sizeof(Layer));101 network->layers = av_mallocz(network->layers_num * sizeof(Layer));
100 if (!network->layers){102 if (!network->layers){

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t