Closed SludgePhD closed 2 years ago
ONNX only works with NCHW, so only supporting (1, 3, h, w)
should suffice (tf2onnx will however insert a Transpose
node after the input to make the model accept NHWC inputs, unless --inputs-as-nchw
is passed).
What should probably be made configurable is the expected input value range, since the MediaPipe networks don't require per-channel mean and stddev correction (and it needs values to be in range [-1.0, 1.0]
). But this PR is sufficient to reproduce my issue in #109, so this isn't required for now.
Good idea to make this more generic. Should we perhaps make the shape (
(1,3,w,h)
,(3,w,h)
,(3,h,w)
etc.) configurable? I am not sure what shape your model is using vs. what SqueezeNet (which this was written for) expect, it might differ between models.