1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge pull request #19792 from mpashchenkov:mp/ie-add-int32

G-API: IE. Adding support for INT32 type.

* Added support for int32

* Added sample for semantic-segmentation-adas-0001

* Alignment

* Alignment 2

* Rstrt build

* Removed test for sem seg
This commit is contained in:
Maxim Pashchenkov
2021-03-29 23:59:55 +03:00
committed by GitHub
parent 105b57c8d9
commit e7007668a6
2 changed files with 137 additions and 0 deletions
@@ -104,6 +104,7 @@ inline IE::Layout toIELayout(const std::size_t ndims) {
inline IE::Precision toIE(int depth) {
switch (depth) {
case CV_8U: return IE::Precision::U8;
case CV_32S: return IE::Precision::I32;
case CV_32F: return IE::Precision::FP32;
default: GAPI_Assert(false && "Unsupported data type");
}
@@ -113,6 +114,7 @@ inline int toCV(IE::Precision prec) {
switch (prec) {
case IE::Precision::U8: return CV_8U;
case IE::Precision::FP32: return CV_32F;
case IE::Precision::I32: return CV_32S;
default: GAPI_Assert(false && "Unsupported data type");
}
return -1;
@@ -154,6 +156,7 @@ inline IE::Blob::Ptr wrapIE(const cv::Mat &mat, cv::gapi::ie::TraitAs hint) {
case CV_##E: return IE::make_shared_blob<T>(tDesc, const_cast<T*>(mat.ptr<T>()))
HANDLE(8U, uint8_t);
HANDLE(32F, float);
HANDLE(32S, int);
#undef HANDLE
default: GAPI_Assert(false && "Unsupported data type");
}
@@ -189,6 +192,7 @@ inline void copyFromIE(const IE::Blob::Ptr &blob, MatType &mat) {
break;
HANDLE(U8, uint8_t);
HANDLE(FP32, float);
HANDLE(I32, int);
#undef HANDLE
default: GAPI_Assert(false && "Unsupported data type");
}