mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge pull request #22935 from alalek:gapi_error
G-API: replace GAPI_Assert() with 'false' and '0' to GAPI_Error() * gapi: GAPI_Error() macro * gapi: replace GAPI_Assert() with 'false' and '0' to GAPI_Error() * build: eliminate 'unreachable code' after CV_Error() (MSVC 2015) * build: eliminate 'unreachable code' warning for MSVS 2015/2017 - observed in constructors stubs with throwing exception
This commit is contained in:
committed by
GitHub
parent
420db56ffd
commit
91998d6424
@@ -37,7 +37,7 @@ cv::detail::GCompoundContext::GCompoundContext(const cv::GArgs& in_args)
|
||||
// do nothing - as handled in a special way, see gcompoundkernel.hpp for details
|
||||
// same applies to GMatP
|
||||
break;
|
||||
default: GAPI_Assert(false);
|
||||
default: GAPI_Error("InternalError");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ IOStream& operator<< (IOStream& os, const cv::Mat &m) {
|
||||
case CV_32S: write_mat_data< int32_t>(os, m); break;
|
||||
case CV_32F: write_mat_data< float>(os, m); break;
|
||||
case CV_64F: write_mat_data< double>(os, m); break;
|
||||
default: GAPI_Assert(false && "Unsupported Mat depth");
|
||||
default: GAPI_Error("Unsupported Mat depth");
|
||||
}
|
||||
return os;
|
||||
}
|
||||
@@ -306,7 +306,7 @@ IIStream& operator>> (IIStream& is, cv::Mat& m) {
|
||||
case CV_32S: read_mat_data< int32_t>(is, m); break;
|
||||
case CV_32F: read_mat_data< float>(is, m); break;
|
||||
case CV_64F: read_mat_data< double>(is, m); break;
|
||||
default: GAPI_Assert(false && "Unsupported Mat depth");
|
||||
default: GAPI_Error("Unsupported Mat depth");
|
||||
}
|
||||
return is;
|
||||
}
|
||||
@@ -319,10 +319,10 @@ IIStream& operator>> (IIStream& is, cv::gapi::wip::draw::Text &t) {
|
||||
}
|
||||
|
||||
IOStream& operator<< (IOStream&, const cv::gapi::wip::draw::FText &) {
|
||||
GAPI_Assert(false && "Serialization: Unsupported << for FText");
|
||||
GAPI_Error("Serialization: Unsupported << for FText");
|
||||
}
|
||||
IIStream& operator>> (IIStream&, cv::gapi::wip::draw::FText &) {
|
||||
GAPI_Assert(false && "Serialization: Unsupported >> for FText");
|
||||
GAPI_Error("Serialization: Unsupported >> for FText");
|
||||
}
|
||||
|
||||
IOStream& operator<< (IOStream& os, const cv::gapi::wip::draw::Circle &c) {
|
||||
@@ -398,19 +398,19 @@ IIStream& operator>> (IIStream& is, cv::GArrayDesc &) {return is;}
|
||||
#if !defined(GAPI_STANDALONE)
|
||||
IOStream& operator<< (IOStream& os, const cv::UMat &)
|
||||
{
|
||||
GAPI_Assert(false && "Serialization: Unsupported << for UMat");
|
||||
GAPI_Error("Serialization: Unsupported << for UMat");
|
||||
return os;
|
||||
}
|
||||
IIStream& operator >> (IIStream& is, cv::UMat &)
|
||||
{
|
||||
GAPI_Assert(false && "Serialization: Unsupported >> for UMat");
|
||||
GAPI_Error("Serialization: Unsupported >> for UMat");
|
||||
return is;
|
||||
}
|
||||
#endif // !defined(GAPI_STANDALONE)
|
||||
|
||||
IOStream& operator<< (IOStream& os, const cv::gapi::wip::IStreamSource::Ptr &)
|
||||
{
|
||||
GAPI_Assert(false && "Serialization: Unsupported << for IStreamSource::Ptr");
|
||||
GAPI_Error("Serialization: Unsupported << for IStreamSource::Ptr");
|
||||
return os;
|
||||
}
|
||||
IIStream& operator >> (IIStream& is, cv::gapi::wip::IStreamSource::Ptr &)
|
||||
@@ -429,7 +429,7 @@ struct putToStream<Ref, std::tuple<>>
|
||||
{
|
||||
static void put(IOStream&, const Ref &)
|
||||
{
|
||||
GAPI_Assert(false && "Unsupported type for GArray/GOpaque serialization");
|
||||
GAPI_Error("Unsupported type for GArray/GOpaque serialization");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -454,7 +454,7 @@ struct getFromStream<Ref, std::tuple<>>
|
||||
{
|
||||
static void get(IIStream&, Ref &, cv::detail::OpaqueKind)
|
||||
{
|
||||
GAPI_Assert(false && "Unsupported type for GArray/GOpaque deserialization");
|
||||
GAPI_Error("Unsupported type for GArray/GOpaque deserialization");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -560,7 +560,7 @@ IOStream& operator<< (IOStream& os, const cv::GArg &arg) {
|
||||
case cv::detail::OpaqueKind::CV_RECT: os << arg.get<cv::Rect>(); break;
|
||||
case cv::detail::OpaqueKind::CV_SCALAR: os << arg.get<cv::Scalar>(); break;
|
||||
case cv::detail::OpaqueKind::CV_MAT: os << arg.get<cv::Mat>(); break;
|
||||
default: GAPI_Assert(false && "GArg: Unsupported (unknown?) opaque value type");
|
||||
default: GAPI_Error("GArg: Unsupported (unknown?) opaque value type");
|
||||
}
|
||||
}
|
||||
return os;
|
||||
@@ -597,7 +597,7 @@ IIStream& operator>> (IIStream& is, cv::GArg &arg) {
|
||||
HANDLE_CASE(SCALAR , cv::Scalar);
|
||||
HANDLE_CASE(MAT , cv::Mat);
|
||||
#undef HANDLE_CASE
|
||||
default: GAPI_Assert(false && "GArg: Unsupported (unknown?) opaque value type");
|
||||
default: GAPI_Error("GArg: Unsupported (unknown?) opaque value type");
|
||||
}
|
||||
}
|
||||
return is;
|
||||
@@ -665,7 +665,7 @@ struct initCtor<Ref, std::tuple<>>
|
||||
{
|
||||
static void init(cv::gimpl::Data&)
|
||||
{
|
||||
GAPI_Assert(false && "Unsupported type for GArray/GOpaque deserialization");
|
||||
GAPI_Error("Unsupported type for GArray/GOpaque deserialization");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
#include "opencv2/gapi/render/render_types.hpp"
|
||||
#include "opencv2/gapi/s11n.hpp" // basic interfaces
|
||||
|
||||
#if (defined _WIN32 || defined _WIN64) && defined _MSC_VER
|
||||
#if defined _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4702)
|
||||
#endif
|
||||
|
||||
@@ -232,4 +233,8 @@ GAPI_EXPORTS std::vector<std::string> vector_of_strings_deserialize(IIStream& is
|
||||
} // namespace gapi
|
||||
} // namespace cv
|
||||
|
||||
#if defined _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // OPENCV_GAPI_COMMON_SERIALIZATION_HPP
|
||||
|
||||
@@ -63,9 +63,9 @@ GAPI_OCV_KERNEL_ST(GCPUStereo, cv::gapi::calib3d::GStereo, StereoSetup)
|
||||
stereoSetup.stereoBM->compute(left, right, out_mat);
|
||||
break;
|
||||
case cv::gapi::StereoOutputFormat::DISPARITY_FIXED16_11_5:
|
||||
GAPI_Assert(false && "This case may be supported in future.");
|
||||
GAPI_Error("This case may be supported in future.");
|
||||
default:
|
||||
GAPI_Assert(false && "Unknown output format!");
|
||||
GAPI_Error("Unknown output format!");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -313,7 +313,7 @@ static int maxLineConsumption(const cv::GFluidKernel::Kind kind, int window, int
|
||||
}
|
||||
} break;
|
||||
case cv::GFluidKernel::Kind::YUV420toRGB: return inPort == 0 ? 2 : 1; break;
|
||||
default: GAPI_Assert(false); return 0;
|
||||
default: GAPI_Error("InternalError"); return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ static int borderSize(const cv::GFluidKernel::Kind kind, int window)
|
||||
// Resize never reads from border pixels
|
||||
case cv::GFluidKernel::Kind::Resize: return 0; break;
|
||||
case cv::GFluidKernel::Kind::YUV420toRGB: return 0; break;
|
||||
default: GAPI_Assert(false); return 0;
|
||||
default: GAPI_Error("InternalError"); return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ void cv::gimpl::GFluidExecutable::initBufferRois(std::vector<int>& readStarts,
|
||||
case 0: roi = produced; break;
|
||||
case 1:
|
||||
case 2: roi = cv::Rect{ produced.x/2, produced.y/2, produced.width/2, produced.height/2 }; break;
|
||||
default: GAPI_Assert(false);
|
||||
default: GAPI_Error("InternalError");
|
||||
}
|
||||
return roi;
|
||||
};
|
||||
@@ -699,7 +699,7 @@ void cv::gimpl::GFluidExecutable::initBufferRois(std::vector<int>& readStarts,
|
||||
case GFluidKernel::Kind::Filter: resized = produced; break;
|
||||
case GFluidKernel::Kind::Resize: resized = adjResizeRoi(produced, in_meta.size, meta.size); break;
|
||||
case GFluidKernel::Kind::YUV420toRGB: resized = adj420Roi(produced, m_gm.metadata(in_edge).get<Input>().port); break;
|
||||
default: GAPI_Assert(false);
|
||||
default: GAPI_Error("InternalError");
|
||||
}
|
||||
|
||||
// All below transformations affect roi of the writer, preserve read start position here
|
||||
@@ -814,7 +814,7 @@ cv::gimpl::FluidGraphInputData cv::gimpl::fluidExtractInputDataFromGraph(const a
|
||||
last_agent++;
|
||||
break;
|
||||
}
|
||||
default: GAPI_Assert(false);
|
||||
default: GAPI_Error("InternalError");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -844,7 +844,7 @@ cv::gimpl::GFluidExecutable::GFluidExecutable(const ade::Graph
|
||||
case GFluidKernel::Kind::Filter: agent_ptr.reset(new FluidFilterAgent(g, agent_data.nh)); break;
|
||||
case GFluidKernel::Kind::Resize: agent_ptr.reset(new FluidResizeAgent(g, agent_data.nh)); break;
|
||||
case GFluidKernel::Kind::YUV420toRGB: agent_ptr.reset(new Fluid420toRGBAgent(g, agent_data.nh)); break;
|
||||
default: GAPI_Assert(false);
|
||||
default: GAPI_Error("InternalError");
|
||||
}
|
||||
std::tie(agent_ptr->in_buffer_ids, agent_ptr->out_buffer_ids) = std::tie(agent_data.in_buffer_ids, agent_data.out_buffer_ids);
|
||||
return agent_ptr;
|
||||
@@ -1388,7 +1388,7 @@ cv::gimpl::GParallelFluidExecutable::GParallelFluidExecutable(const ade::Graph
|
||||
void cv::gimpl::GParallelFluidExecutable::reshape(ade::Graph&, const GCompileArgs& )
|
||||
{
|
||||
//TODO: implement ?
|
||||
GAPI_Assert(false && "Not Implemented;");
|
||||
GAPI_Error("Not Implemented;");
|
||||
}
|
||||
|
||||
void cv::gimpl::GParallelFluidExecutable::run(std::vector<InObj> &&input_objs,
|
||||
@@ -1474,7 +1474,7 @@ void GFluidBackendImpl::addMetaSensitiveBackendPasses(ade::ExecutionEngineSetupC
|
||||
case NodeKind::EMIT:
|
||||
case NodeKind::SINK:
|
||||
break; // do nothing for Streaming nodes
|
||||
default: GAPI_Assert(false);
|
||||
default: GAPI_Error("InternalError");
|
||||
} // switch
|
||||
} // for (gim.nodes())
|
||||
});
|
||||
|
||||
@@ -90,7 +90,7 @@ void fillBorderConstant(int borderSize, cv::Scalar borderValue, cv::Mat& mat)
|
||||
case CV_16S: return &fillConstBorderRow< int16_t>; break;
|
||||
case CV_16U: return &fillConstBorderRow<uint16_t>; break;
|
||||
case CV_32F: return &fillConstBorderRow< float >; break;
|
||||
default: GAPI_Assert(false); return &fillConstBorderRow<uint8_t>;
|
||||
default: GAPI_Error("InternalError"); return &fillConstBorderRow<uint8_t>;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -231,7 +231,7 @@ void fluid::BufferStorageWithBorder::init(int dtype, int border_size, Border bor
|
||||
case cv::BORDER_REFLECT_101:
|
||||
m_borderHandler.reset(new BorderHandlerT<cv::BORDER_REFLECT_101>(border_size, dtype)); break;
|
||||
default:
|
||||
GAPI_Assert(false);
|
||||
GAPI_Error("InternalError");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ inline IE::Precision toIE(int depth) {
|
||||
case CV_32S: return IE::Precision::I32;
|
||||
case CV_32F: return IE::Precision::FP32;
|
||||
case CV_16F: return IE::Precision::FP16;
|
||||
default: GAPI_Assert(false && "IE. Unsupported data type");
|
||||
default: GAPI_Error("IE. Unsupported data type");
|
||||
}
|
||||
return IE::Precision::UNSPECIFIED;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ inline int toCV(IE::Precision prec) {
|
||||
case IE::Precision::I32: 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_Error("IE. Unsupported data type");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -167,7 +167,7 @@ inline IE::Blob::Ptr wrapIE(const cv::Mat &mat, cv::gapi::ie::TraitAs hint) {
|
||||
HANDLE(32S, int);
|
||||
HANDLE(16F, int16_t);
|
||||
#undef HANDLE
|
||||
default: GAPI_Assert(false && "IE. Unsupported data type");
|
||||
default: GAPI_Error("IE. Unsupported data type");
|
||||
}
|
||||
return IE::Blob::Ptr{};
|
||||
}
|
||||
@@ -190,9 +190,9 @@ inline IE::Blob::Ptr wrapIE(const cv::MediaFrame::View& view,
|
||||
return wrapIE(gray, cv::gapi::ie::TraitAs::IMAGE);
|
||||
}
|
||||
default:
|
||||
GAPI_Assert(false && "Unsupported media format for IE backend");
|
||||
GAPI_Error("Unsupported media format for IE backend");
|
||||
}
|
||||
GAPI_Assert(false);
|
||||
GAPI_Error("InternalError");
|
||||
}
|
||||
|
||||
template<class MatType>
|
||||
@@ -225,7 +225,7 @@ inline void copyFromIE(const IE::Blob::Ptr &blob, MatType &mat) {
|
||||
mat.total());
|
||||
break;
|
||||
}
|
||||
default: GAPI_Assert(false && "IE. Unsupported data type");
|
||||
default: GAPI_Error("IE. Unsupported data type");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ void IEUnit::InputFramesDesc::set_param(const input_name_type &input,
|
||||
if (layout != InferenceEngine::NHWC && layout != InferenceEngine::NCHW) {
|
||||
GAPI_LOG_WARNING(nullptr, "Unsupported layout for VPP preproc: " << layout <<
|
||||
", input name: " << input);
|
||||
GAPI_Assert(false && "Unsupported layout for VPP preproc");
|
||||
GAPI_Error("Unsupported layout for VPP preproc");
|
||||
}
|
||||
GAPI_Assert(inDims.size() == 4u);
|
||||
ret.size.width = static_cast<int>(inDims[3]);
|
||||
@@ -754,7 +754,7 @@ inline IE::Blob::Ptr extractBlob(IECallContext& ctx,
|
||||
|
||||
NV12ParamType* blob_params = cv::util::any_cast<NV12ParamType>(&any_blob_params);
|
||||
if (blob_params == nullptr) {
|
||||
GAPI_Assert(false && "Incorrect type of blobParams:"
|
||||
GAPI_Error("Incorrect type of blobParams:"
|
||||
"expected std::pair<ParamType, ParamType>,"
|
||||
"with ParamType std::pair<InferenceEngine::TensorDesc,"
|
||||
"InferenceEngine::ParamMap >>");
|
||||
@@ -782,7 +782,7 @@ inline IE::Blob::Ptr extractBlob(IECallContext& ctx,
|
||||
default:
|
||||
GAPI_Assert("Unsupported input shape for IE backend");
|
||||
}
|
||||
GAPI_Assert(false);
|
||||
GAPI_Error("InternalError");
|
||||
}
|
||||
|
||||
|
||||
@@ -967,7 +967,7 @@ cv::gimpl::ie::RequestPool::RequestPool(cv::gapi::ie::InferMode
|
||||
std::bind(&RequestPool::release, this, i));
|
||||
break;
|
||||
default:
|
||||
GAPI_Assert(false && "Unsupported cv::gapi::ie::InferMode");
|
||||
GAPI_Error("Unsupported cv::gapi::ie::InferMode");
|
||||
}
|
||||
m_requests.emplace_back(std::move(iexec));
|
||||
}
|
||||
@@ -1144,7 +1144,7 @@ static void configureInputReshapeByImage(const IE::InputInfo::Ptr& ii,
|
||||
auto input_dims = ii->getTensorDesc().getDims();
|
||||
const auto size = input_dims.size();
|
||||
if (size <= 1) {
|
||||
GAPI_Assert(false && "Unsupported number of dimensions for reshape by image");
|
||||
GAPI_Error("Unsupported number of dimensions for reshape by image");
|
||||
}
|
||||
input_dims.at(size - 2) = static_cast<size_t>(image_sz.height);
|
||||
input_dims.at(size - 1) = static_cast<size_t>(image_sz.width);
|
||||
@@ -1173,7 +1173,7 @@ static void configureInputInfo(const IE::InputInfo::Ptr& ii, const cv::GMetaArg
|
||||
// NB: Do nothing
|
||||
break;
|
||||
default:
|
||||
GAPI_Assert(false && "Unsupported media format for IE backend");
|
||||
GAPI_Error("Unsupported media format for IE backend");
|
||||
}
|
||||
ii->setPrecision(toIE(CV_8U));
|
||||
break;
|
||||
|
||||
@@ -62,12 +62,12 @@ public:
|
||||
|
||||
virtual inline bool canReshape() const override { return false; }
|
||||
virtual inline void reshape(ade::Graph&, const GCompileArgs&) override {
|
||||
GAPI_Assert(false); // Not implemented yet
|
||||
GAPI_Error("InternalError"); // Not implemented yet
|
||||
}
|
||||
|
||||
virtual void run(std::vector<InObj> &&,
|
||||
std::vector<OutObj> &&) override {
|
||||
GAPI_Assert(false && "Not implemented");
|
||||
GAPI_Error("Not implemented");
|
||||
}
|
||||
|
||||
virtual void run(GIslandExecutable::IInput &in,
|
||||
|
||||
@@ -39,7 +39,7 @@ class GOAKExecutable final: public GIslandExecutable {
|
||||
friend class OAKKernelParams;
|
||||
virtual void run(std::vector<InObj>&&,
|
||||
std::vector<OutObj>&&) override {
|
||||
GAPI_Assert(false && "Not implemented");
|
||||
GAPI_Error("Not implemented");
|
||||
}
|
||||
|
||||
virtual void run(GIslandExecutable::IInput &in,
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
// FIXME: could it reshape?
|
||||
virtual bool canReshape() const override { return false; }
|
||||
virtual void reshape(ade::Graph&, const GCompileArgs&) override {
|
||||
GAPI_Assert(false && "GOAKExecutable::reshape() is not supported");
|
||||
GAPI_Error("GOAKExecutable::reshape() is not supported");
|
||||
}
|
||||
|
||||
virtual void handleNewStream() override;
|
||||
@@ -391,7 +391,7 @@ void cv::gimpl::GOAKExecutable::linkCopy(ade::NodeHandle handle) {
|
||||
for (const auto& copy_next_op : copy_out.front().get()->outNodes()) {
|
||||
const auto& op = m_gm.metadata(copy_next_op).get<Op>();
|
||||
if (op.k.name == "org.opencv.oak.copy") {
|
||||
GAPI_Assert(false && "Back-to-back Copy operations are not supported in graph");
|
||||
GAPI_Error("Back-to-back Copy operations are not supported in graph");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -701,14 +701,14 @@ cv::gimpl::GOAKExecutable::GOAKExecutable(const ade::Graph& g,
|
||||
[](ExtractTypeHelper::InputPtr ptr) {
|
||||
return ptr == nullptr;
|
||||
})) {
|
||||
GAPI_Assert(false && "DAI input are not set");
|
||||
GAPI_Error("DAI input are not set");
|
||||
}
|
||||
|
||||
if (std::any_of(node_info.outputs.cbegin(), node_info.outputs.cend(),
|
||||
[](ExtractTypeHelper::OutputPtr ptr) {
|
||||
return ptr == nullptr;
|
||||
})) {
|
||||
GAPI_Assert(false && "DAI outputs are not set");
|
||||
GAPI_Error("DAI outputs are not set");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -907,7 +907,7 @@ void cv::gimpl::GOAKExecutable::run(GIslandExecutable::IInput &in,
|
||||
}
|
||||
// FIXME: Add support for remaining types
|
||||
default:
|
||||
GAPI_Assert(false && "Unsupported type in OAK backend");
|
||||
GAPI_Error("Unsupported type in OAK backend");
|
||||
}
|
||||
|
||||
out.meta(out_arg, meta);
|
||||
@@ -1080,7 +1080,7 @@ class GOAKBackendImpl final : public cv::gapi::GBackend::Priv {
|
||||
// NB: how could we have non-OAK source in streaming mode, then OAK backend in
|
||||
// streaming mode but without camera input?
|
||||
if (!gm.metadata().contains<cv::gimpl::Streaming>()) {
|
||||
GAPI_Assert(false && "OAK backend only supports Streaming mode for now");
|
||||
GAPI_Error("OAK backend only supports Streaming mode for now");
|
||||
}
|
||||
return EPtr{new cv::gimpl::GOAKExecutable(graph, args, nodes, ins_data, outs_data)};
|
||||
}
|
||||
@@ -1118,14 +1118,11 @@ namespace gapi {
|
||||
namespace oak {
|
||||
|
||||
cv::gapi::GKernelPackage kernels() {
|
||||
GAPI_Assert(false && "Built without OAK support");
|
||||
return {};
|
||||
GAPI_Error("Built without OAK support");
|
||||
}
|
||||
|
||||
cv::gapi::GBackend backend() {
|
||||
GAPI_Assert(false && "Built without OAK support");
|
||||
static cv::gapi::GBackend this_backend(nullptr);
|
||||
return this_backend;
|
||||
GAPI_Error("Built without OAK support");
|
||||
}
|
||||
|
||||
} // namespace oak
|
||||
|
||||
@@ -171,7 +171,7 @@ inline int toCV(ONNXTensorElementDataType prec) {
|
||||
case ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT: return CV_32F;
|
||||
case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32: return CV_32S;
|
||||
case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64: return CV_32S;
|
||||
default: GAPI_Assert(false && "ONNX. Unsupported data type");
|
||||
default: GAPI_Error("ONNX. Unsupported data type");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ inline void copyFromONNX(Ort::Value &v, cv::Mat& mat) {
|
||||
mat.total());
|
||||
break;
|
||||
}
|
||||
default: GAPI_Assert(false && "ONNX. Unsupported data type");
|
||||
default: GAPI_Error("ONNX. Unsupported data type");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ inline void preprocess(const cv::Mat& src,
|
||||
"32F tensor dimensions should match with all non-dynamic NN input dimensions");
|
||||
}
|
||||
} else {
|
||||
GAPI_Assert(false && "32F tensor size should match with NN input");
|
||||
GAPI_Error("32F tensor size should match with NN input");
|
||||
}
|
||||
|
||||
dst = src;
|
||||
@@ -338,7 +338,7 @@ void preprocess(const cv::MediaFrame::View& view,
|
||||
break;
|
||||
}
|
||||
default:
|
||||
GAPI_Assert(false && "Unsupported media format for ONNX backend");
|
||||
GAPI_Error("Unsupported media format for ONNX backend");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ inline Ort::Value createTensor(const Ort::MemoryInfo& memory_info,
|
||||
case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32:
|
||||
return createTensor<int32_t>(memory_info, tensor_params, data);
|
||||
default:
|
||||
GAPI_Assert(false && "ONNX. Unsupported data type");
|
||||
GAPI_Error("ONNX. Unsupported data type");
|
||||
}
|
||||
return Ort::Value{nullptr};
|
||||
}
|
||||
@@ -858,7 +858,7 @@ static void checkInputMeta(const cv::GMetaArg mm) {
|
||||
case cv::MediaFormat::NV12: break;
|
||||
case cv::MediaFormat::BGR: break;
|
||||
default:
|
||||
GAPI_Assert(false && "Unsupported media format for ONNX backend");
|
||||
GAPI_Error("Unsupported media format for ONNX backend");
|
||||
} break;
|
||||
} break;
|
||||
default:
|
||||
@@ -1101,7 +1101,7 @@ struct InferList2: public cv::detail::KernelTag {
|
||||
const auto &vec = this_vec.rref<cv::Mat>();
|
||||
uu.oc->setInput(in_idx, vec[list_idx]);
|
||||
} else {
|
||||
GAPI_Assert(false && "Only Rect and Mat types are supported for infer list 2!");
|
||||
GAPI_Error("Only Rect and Mat types are supported for infer list 2!");
|
||||
}
|
||||
// }}} (Prepare input)
|
||||
} // }}} (For every input of the net)
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
|
||||
virtual inline bool canReshape() const override { return false; }
|
||||
virtual inline void reshape(ade::Graph&, const GCompileArgs&) override {
|
||||
GAPI_Assert(false); // Not implemented yet
|
||||
GAPI_Error("InternalError"); // Not implemented yet
|
||||
}
|
||||
|
||||
virtual void run(std::vector<InObj> &&input_objs,
|
||||
|
||||
@@ -150,7 +150,7 @@ static void writeBack(cv::GRunArg& arg, cv::GRunArgP& out)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
GAPI_Assert(false && "Unsupported output type");
|
||||
GAPI_Error("Unsupported output type");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class GStreamingIntrinExecutable final: public cv::gimpl::GIslandExecutable
|
||||
{
|
||||
virtual void run(std::vector<InObj> &&,
|
||||
std::vector<OutObj> &&) override {
|
||||
GAPI_Assert(false && "Not implemented");
|
||||
GAPI_Error("Not implemented");
|
||||
}
|
||||
|
||||
virtual void run(GIslandExecutable::IInput &in,
|
||||
@@ -188,7 +188,7 @@ void Copy::Actor::run(cv::gimpl::GIslandExecutable::IInput &in,
|
||||
break;
|
||||
// FIXME: Add support for remaining types
|
||||
default:
|
||||
GAPI_Assert(false && "Copy: unsupported data type");
|
||||
GAPI_Error("Copy: unsupported data type");
|
||||
}
|
||||
out.meta(out_arg, in_arg.meta);
|
||||
out.post(std::move(out_arg));
|
||||
|
||||
Reference in New Issue
Block a user