- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hi there!
I have a network to perform inference on with OpenVINO. The input data (images from file) should be normalized by subtracting mean and dividing by standard deviation, but the data comes from different sources and we normalize per source type, so the general "--mean_values" and "--scale_values" when converting the model to IR cannot be used since they hold constant values for all input images.
I think the way to go here is to do the normalization myself, which seems very easy since opencv allows for quick element-wise operations on Mat, but I have trouble with making a Blob of a float Mat to set as input for the InferRequest. I used wrapMat2Blob for uint8 Mats that imread returns, but I could not find a way to do something similar when the mat is of datatype float. Could anyone point me in the right direction on how to get this working? Thanks!
I'm working in C++ by the way :)
Kind regards,
Rutger
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Got it working with the following code, with input being a cv::Mat of type CV_32FC3
TensorDesc tDesc( Precision::FP32, { 1, (size_t)input.channels(), (size_t)input.size().height, (size_t)input.size().width }, Layout::NHWC ); Blob::Ptr imgBlob = make_shared_blob<float>(tDesc, (float*)input.data);
Enlace copiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Got it working with the following code, with input being a cv::Mat of type CV_32FC3
TensorDesc tDesc( Precision::FP32, { 1, (size_t)input.channels(), (size_t)input.size().height, (size_t)input.size().width }, Layout::NHWC ); Blob::Ptr imgBlob = make_shared_blob<float>(tDesc, (float*)input.data);
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla