Skip to content

Conversation

Pascal0902
Copy link

Hello everyone,

this PR aims to enable Resizing op support. The implementation translates tensorflow resizing ops into NCNN Interpolation Ops.

As ncnn expects a scale factor for these ops, the input shape of the layer must be known. I am currently using keras to load the model and determine the input_shape. There would be other ways that don't require keras, if you want to use one of those instead please feel free to do so.

To my knowledge NCNN currently only supports the "bilinear" and "nearest" interpolation methods, so using any other interpolation method will raise an Error while converting the model.

The implementation worked flawlessly in my tests. Please feel free to perform your own tests, since a second pair of eyes is always appreciated.

@MarsTechHAN
Copy link
Owner

Cool. Thanks for the PR!

Light and not requiring keras or tf is something that I am trying to achieve. Maybe you can take a look at this code I wrote for another project for static shape inference, hmmm let me think for a momet.

https://github.com/microsoft/nn-Meter/blob/a478371d309a53fdd19f4d1c497017c5aabb902a/nn_meter/ir_converters/frozenpb_converter/shape_inference.py

@Pascal0902
Copy link
Author

Thanks for the reply!

I looked at the code you send, should work for this case as well. Needs some changes to work in this project of course.

I will test that code and update the PR as soon as I find the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants