Browse Source

convert mxnet _contrib_BilinearResize2D

tags/20190908
nihuini 6 years ago
parent
commit
7dd4bccf95
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      tools/mxnet/mxnet2ncnn.cpp

+ 17
- 0
tools/mxnet/mxnet2ncnn.cpp View File

@@ -992,6 +992,10 @@ int main(int argc, char** argv)

fprintf(pp, "%-16s", "Input");
}
else if (n.op == "_contrib_BilinearResize2D")
{
fprintf(pp, "%-16s", "Interp");
}
else if (n.op == "_contrib_MultiBoxDetection")
{
fprintf(pp, "%-16s", "DetectionOutput");
@@ -1396,6 +1400,19 @@ int main(int argc, char** argv)
// dummy input shape
// fprintf(pp, " 0 0 0");
}
else if (n.op == "_contrib_BilinearResize2D")
{
float scale_height = n.has_attr("scale_height") ? n.attr("scale_height") : 1.f;
float scale_width = n.has_attr("scale_width") ? n.attr("scale_width") : 1.f;
int height = n.has_attr("scale_height") ? 0 : n.attr("height");
int width = n.has_attr("scale_width") ? 0 : n.attr("width");

fprintf(pp, " 0=2");
fprintf(pp, " 1=%f", scale_height);
fprintf(pp, " 2=%f", scale_width);
fprintf(pp, " 3=%d", height);
fprintf(pp, " 4=%d", width);
}
else if (n.op == "_contrib_MultiBoxDetection")
{
float threshold = n.has_attr("threshold") ? n.attr("threshold") : 0.01f;


Loading…
Cancel
Save