mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
[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:
@@ -20,6 +20,63 @@
|
||||
namespace fastdeploy {
|
||||
namespace vision {
|
||||
|
||||
bool Processor::ImplByOpenCV(FDMat* mat) {
|
||||
FDERROR << Name() << " Not Implement Yet." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Processor::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;
|
||||
}
|
||||
|
||||
bool Processor::ImplByFlyCV(FDMat* mat) { return ImplByOpenCV(mat); }
|
||||
|
||||
bool Processor::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;
|
||||
}
|
||||
|
||||
bool Processor::ImplByCuda(FDMat* mat) {
|
||||
FDWARNING << Name()
|
||||
<< " is not implemented with CUDA, will fallback to OpenCV."
|
||||
<< std::endl;
|
||||
return ImplByOpenCV(mat);
|
||||
}
|
||||
|
||||
bool Processor::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;
|
||||
}
|
||||
|
||||
bool Processor::ImplByCvCuda(FDMat* mat) {
|
||||
FDWARNING << Name()
|
||||
<< " is not implemented with CV-CUDA, will fallback to OpenCV."
|
||||
<< std::endl;
|
||||
return ImplByOpenCV(mat);
|
||||
}
|
||||
|
||||
bool Processor::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;
|
||||
}
|
||||
|
||||
bool Processor::operator()(FDMat* mat) {
|
||||
ProcLib target = mat->proc_lib;
|
||||
if (mat->proc_lib == ProcLib::DEFAULT) {
|
||||
|
||||
Reference in New Issue
Block a user