dlib icon indicating copy to clipboard operation
dlib copied to clipboard

want to contribute to creating a pipeline that converts Dlib deeplearning models to ONNX standard format.

Open intellizd opened this issue 3 years ago • 5 comments
trafficstars

Dlib machine learning platform is powerful and great. And thank you for allowing us to use these powerful platforms. As you know, these days, deep learning frameworks are standardized and changing with ONNX format. We want to contribute to creating a pipeline that converts Dlib deeplearning models to ONNX standard format. Please give us a lot of advice.

intellizd avatar Jul 18 '22 08:07 intellizd

Cool. Yeah just do what tools/convert_dlib_nets_to_caffe does. I.e. parse the output of dlib::net_to_xml() and resave it in whatever format you want.

davisking avatar Jul 18 '22 11:07 davisking

I was thinking more about a version that parses the network directly with a visitor that, for each layer, it maps it to the corresponding ONNX operation, specifies the inputs/outputs and exports the weights and other parameters.

I suspect it will be similar to the visitors defined in dlib/dnn/visitors.h and also to the one written by @pfeatherstone: https://github.com/dlibml/darknet/blob/master/src/weights_visitor.h

But maybe @davisking approach is more straightforward? I don't know, I've only thought a bit about it.

arrufat avatar Jul 18 '22 11:07 arrufat

Oh yeah, or use a visitor. It depends on how you want to setup the software. I've found that people who ask this question often don't want to do the whole visitor thing. Buy yeah, if I was doing it I definitely would not have an XML middle man. So :shrug:

davisking avatar Jul 18 '22 11:07 davisking

But visitors are fun, all that SFINAE feels almost like pattern matching in functional languages, haha!

arrufat avatar Jul 18 '22 12:07 arrufat

Yeah I like the visitor

davisking avatar Jul 18 '22 12:07 davisking

Warning: this issue has been inactive for 35 days and will be automatically closed on 2022-09-01 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

dlib-issue-bot avatar Aug 23 '22 08:08 dlib-issue-bot

Warning: this issue has been inactive for 42 days and will be automatically closed on 2022-09-01 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

dlib-issue-bot avatar Aug 30 '22 08:08 dlib-issue-bot

Notice: this issue has been closed because it has been inactive for 45 days. You may reopen this issue if it has been closed in error.

dlib-issue-bot avatar Sep 02 '22 08:09 dlib-issue-bot