[CVCUDA] PaddleDetection preprocessor support CV-CUDA (#1493)

* ppdet preproc use manager

* pad_to_size chw opencv

* pad_to_size chw flycv

* fix pad_to_size flycv

* add warning message

* cvcuda convert cubic to linear, padToSize cvcuda

* stridedpad cvcuda

* fix flycv include

* fix flycv include

* fix flycv build

* cast cvcuda

* fix pybind

* fix normalize permute cuda

* base processor move funcs to cc

* Update pad_to_size.cc
This commit is contained in:
Wang Xinyu
2023-03-10 12:43:57 +08:00
committed by GitHub
parent 9ee2118e1f
commit cb7c8a07d4
23 changed files with 537 additions and 239 deletions

View File

@@ -47,58 +47,17 @@ class FASTDEPLOY_DECL Processor {
virtual std::string Name() = 0;
virtual bool ImplByOpenCV(FDMat* mat) {
FDERROR << Name() << " Not Implement Yet." << std::endl;
return false;
}
virtual bool ImplByOpenCV(FDMat* mat);
virtual bool ImplByOpenCV(FDMatBatch* mat_batch);
virtual bool ImplByOpenCV(FDMatBatch* mat_batch) {
for (size_t i = 0; i < mat_batch->mats->size(); ++i) {
if (ImplByOpenCV(&(*(mat_batch->mats))[i]) != true) {
return false;
}
}
return true;
}
virtual bool ImplByFlyCV(FDMat* mat);
virtual bool ImplByFlyCV(FDMatBatch* mat_batch);
virtual bool ImplByFlyCV(FDMat* mat) {
return ImplByOpenCV(mat);
}
virtual bool ImplByCuda(FDMat* mat);
virtual bool ImplByCuda(FDMatBatch* mat_batch);
virtual bool ImplByFlyCV(FDMatBatch* mat_batch) {
for (size_t i = 0; i < mat_batch->mats->size(); ++i) {
if (ImplByFlyCV(&(*(mat_batch->mats))[i]) != true) {
return false;
}
}
return true;
}
virtual bool ImplByCuda(FDMat* mat) {
return ImplByOpenCV(mat);
}
virtual bool ImplByCuda(FDMatBatch* mat_batch) {
for (size_t i = 0; i < mat_batch->mats->size(); ++i) {
if (ImplByCuda(&(*(mat_batch->mats))[i]) != true) {
return false;
}
}
return true;
}
virtual bool ImplByCvCuda(FDMat* mat) {
return ImplByOpenCV(mat);
}
virtual bool ImplByCvCuda(FDMatBatch* mat_batch) {
for (size_t i = 0; i < mat_batch->mats->size(); ++i) {
if (ImplByCvCuda(&(*(mat_batch->mats))[i]) != true) {
return false;
}
}
return true;
}
virtual bool ImplByCvCuda(FDMat* mat);
virtual bool ImplByCvCuda(FDMatBatch* mat_batch);
virtual bool operator()(FDMat* mat);