summaryrefslogtreecommitdiffstats
path: root/libavfilter/dnn
diff options
context:
space:
mode:
authorGuo, Yejun <yejun.guo@intel.com>2019-08-29 13:53:41 +0800
committerPedro Arthur <bygrandao@gmail.com>2019-08-30 11:41:30 -0300
commit2d5e39c13e500f96a18729ac16472ff69f8d2cfe (patch)
tree79343e50f7dc0efe36ba8f108d71f9e88e912f39 /libavfilter/dnn
parent09a455a24649af36e8eea81029be7a410201be4c (diff)
downloadffmpeg-streaming-2d5e39c13e500f96a18729ac16472ff69f8d2cfe.zip
ffmpeg-streaming-2d5e39c13e500f96a18729ac16472ff69f8d2cfe.tar.gz
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. Signed-off-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
Diffstat (limited to 'libavfilter/dnn')
-rw-r--r--libavfilter/dnn/dnn_backend_native.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavfilter/dnn/dnn_backend_native.c b/libavfilter/dnn/dnn_backend_native.c
index daa4f50..5d39353 100644
--- a/libavfilter/dnn/dnn_backend_native.c
+++ b/libavfilter/dnn/dnn_backend_native.c
@@ -93,8 +93,10 @@ DNNModel *ff_dnn_load_model_native(const char *model_filename)
}
model->model = (void *)network;
+ avio_seek(model_file_context, file_size - 4, SEEK_SET);
network->layers_num = (int32_t)avio_rl32(model_file_context);
dnn_size = 4;
+ avio_seek(model_file_context, 0, SEEK_SET);
network->layers = av_mallocz(network->layers_num * sizeof(Layer));
if (!network->layers){
OpenPOWER on IntegriCloud