- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does OpenVino provide means to convert input layout internally, or does input always need to be provided in the layout required by the model?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
If the network assumes the RGB inputs, the Model Optimizer can swap the channels in the first convolution using the --reverse_input_channels command line option, so we do not need to convert the inputs to RGB every time we get the BGR image, for example, from OpenCV
Best Regards,
Surya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, but this is not exactly what I'm looking for. The image comes interleaved (e.g. NHWC) from the decoder, but the network requires planar (e.g. NCHW). Does OpenVino have a conversion API (explicit or implicit), or does the conversion need to happen externally.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
By default, Inference Engine accepts the planar and not interleaved inputs in NCHW, so the NHWC (which is exactly the interleaved layout) should be specified explicitly.
The InferenceEngine::NHWC layout is not supported natively by most InferenceEngine plugins, so internal conversion might happen.
Kindly refer to OpenCV* Interoperability Example
Best Regards,
Surya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But that's just the point -- internal conversions do not seem to be happening.
Providing NHWC blob to a network expecting NCHW input results in
`[PARAMETER_MISMATCH] Failed to set input Blob. Dimensions mismatch.`
exception being thrown. OpenCV samples you refer to, seem to use both approaches (matU8ToBlob performs external NHWC->NCHW conversion; wrapMat2Blob wraps a NHWC blob and passes it to input). However, the latter never seems to work for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI Alex,
You may try doing the conversion within the decoder itself before feeding it into the inference engine.
You can also refer to the object_detection_demo_ssd_async.py to modify the layout.
Best Regards,
Surya
![](/skins/images/45C6C2D737ED71F4C51F0145C8CB1E9C/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page