infer and preproc a grayscale model#379
Conversation
|
Across the three elements, no new user-facing properties were added — the changes are all internal plumbing to support a new GRAY8 / single-channel path (preproc elements) and to handle 4-D model outputs more correctly (inferer). tiovxdlpreproc
tidlpreproc
tidlinferer
|
|
Thanks for the pull request! I have a couple of minor comments before we can go ahead and integrate the change:
Once these are updated, we'll get this merged right away. Thanks again for your contribution! |
8e6aeac to
5018e33
Compare
Signed-off-by: talebso <sogand.talebi@sick.se>
5018e33 to
0b63733
Compare
|
Here is the logs from my tests on a grayscale MobilenetV2 classification model with both tidlpreproc and tiovxdlpreproc. |
reesegrimsley
left a comment
There was a problem hiding this comment.
PR approved after test-case details provided
sinha-shreyash
left a comment
There was a problem hiding this comment.
@Rtms1984 , I have few feedback points after having a look at your PR,
- Can you please write a appropriate commit msg which describes the changes you are making in more detail.
- Please follow the code convention present across entire repo, changing it for few files does not makes sense to me
- I see lot of the crux changes are present in transform code, instead it should be handled in utils under edgeai-apps-utils (just like NV12/RGB image) to have uniformity across the code so that we can find all the preproc related operations under one page.
| #include "gst-libs/gst/tiovx/gsttiovxutils.h" | ||
|
|
||
| #endif //ENABLE_TIDL | ||
| #endif //ENABLE_TIDL |
There was a problem hiding this comment.
trailing white spaces
| #define ARM_MAX_OUTPUT_WIDTH 1001 | ||
| #define ARM_MAX_OUTPUT_HEIGHT 1001 | ||
| #endif // NOT ENABLE_TIDL | ||
| #endif // NOT ENABLE_TIDL |
There was a problem hiding this comment.
trailing white spaces
| gsize | ||
| output_size; | ||
| #endif //ENABLE_TIDL | ||
| #endif //ENABLE_TIDL |
There was a problem hiding this comment.
trailing white spaces
| #ifdef ENABLE_TIDL | ||
| PROP_TARGET, | ||
| #endif //ENABLE_TIDL | ||
| #endif //ENABLE_TIDL |
There was a problem hiding this comment.
trailing white spaces
| gst_ti_dl_inferer_get_property (GObject * object, guint prop_id, | ||
| GValue * value, GParamSpec * pspec); | ||
|
|
||
| static guint |
There was a problem hiding this comment.
can we please maintain the code format we are following across the repository, simply changing it for this file does not makes sense to me
There was a problem hiding this comment.
Can we please follow the code format followed across entire repo
| && | ||
| self->pre_proc_config->inputTensorShapes[0].size() >= 3) { | ||
| if (self->pre_proc_config->inputTensorShapes.size () > 0 | ||
| && self->pre_proc_config->inputTensorShapes[0].size () >= 4) { |
There was a problem hiding this comment.
why is this changed to 4 ? should not this be 3 same as NHWC format
| } else if (GST_VIDEO_FORMAT_RGB == GST_VIDEO_FRAME_FORMAT (&in_frame)) { | ||
| dlPreProcess_RGB_image (self->pre_proc_image_params); | ||
| } else if (GST_VIDEO_FORMAT_GRAY8 == GST_VIDEO_FRAME_FORMAT (&in_frame)) { | ||
| /* Single-channel CPU normalization: (pixel - mean) * scale. |
There was a problem hiding this comment.
why not add dlPreProcess_GRAY_image function in edgeai-apps-utils ?
There was a problem hiding this comment.
please follow the same code format used across repositories
| return TRUE; | ||
| } | ||
|
|
||
| static |
There was a problem hiding this comment.
I think all this process is handled internally in preproc utils defined in edgeai-apps-utils, should not it be added there instead ?
@cshilwant, please comment more on this part
Add grayscale model preprocessing and inference support