mirror of
https://github.com/opencv/opencv.git
synced 2025-06-13 04:52:53 +08:00
Merge pull request #20106 from TolyaTalamanov:at/auto-convert-fp16
[G-API] IE backend convert fp32 to fp16 * Support FP16 in IE backend
This commit is contained in:
parent
4753206783
commit
70d1ff7155
@ -118,6 +118,7 @@ inline int toCV(IE::Precision prec) {
|
|||||||
case IE::Precision::FP32: return CV_32F;
|
case IE::Precision::FP32: return CV_32F;
|
||||||
case IE::Precision::I32: return CV_32S;
|
case IE::Precision::I32: return CV_32S;
|
||||||
case IE::Precision::I64: return CV_32S;
|
case IE::Precision::I64: return CV_32S;
|
||||||
|
case IE::Precision::FP16: return CV_16F;
|
||||||
default: GAPI_Assert(false && "IE. Unsupported data type");
|
default: GAPI_Assert(false && "IE. Unsupported data type");
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
@ -196,6 +197,7 @@ inline void copyFromIE(const IE::Blob::Ptr &blob, MatType &mat) {
|
|||||||
HANDLE(U8, uint8_t);
|
HANDLE(U8, uint8_t);
|
||||||
HANDLE(FP32, float);
|
HANDLE(FP32, float);
|
||||||
HANDLE(I32, int);
|
HANDLE(I32, int);
|
||||||
|
HANDLE(FP16, cv::float16_t);
|
||||||
#undef HANDLE
|
#undef HANDLE
|
||||||
case IE::Precision::I64: {
|
case IE::Precision::I64: {
|
||||||
GAPI_LOG_WARNING(NULL, "INT64 isn't supported for cv::Mat. Conversion to INT32 is used.");
|
GAPI_LOG_WARNING(NULL, "INT64 isn't supported for cv::Mat. Conversion to INT32 is used.");
|
||||||
|
Loading…
Reference in New Issue
Block a user