[Model] Add Picodet RKNPU2 (#635)

* * 更新picodet cpp代码

* * 更新文档
* 更新picodet cpp example

* * 删除无用的debug代码
* 新增python example

* * 修改c++代码

* * 修改python代码

* * 修改postprocess代码

* 修复没有scale_factor导致的bug

* 修复错误

* 更正代码格式

* 更正代码格式
This commit is contained in:
Zheng_Bicheng
2022-11-21 13:44:34 +08:00
committed by GitHub
parent 5ca779ee32
commit 3e1fc69a0c
20 changed files with 340 additions and 195 deletions

View File

@@ -32,11 +32,28 @@ class FASTDEPLOY_DECL PaddleDetPostprocessor {
* \return true if the postprocess successed, otherwise false
*/
bool Run(const std::vector<FDTensor>& tensors,
std::vector<DetectionResult>* result);
std::vector<DetectionResult>* result);
/// Apply box decoding and nms step for the outputs for the model.This is
/// only available for those model exported without box decoding and nms.
void ApplyDecodeAndNMS();
bool DecodeAndNMSApplied();
/// Set scale_factor_ value.This is only available for those model exported
/// without box decoding and nms.
void SetScaleFactor(float* scale_factor_value);
private:
// Process mask tensor for MaskRCNN
bool ProcessMask(const FDTensor& tensor,
std::vector<DetectionResult>* results);
std::vector<DetectionResult>* results);
bool apply_decode_and_nms_ = false;
std::vector<float> scale_factor_{1.0, 1.0};
std::vector<float> GetScaleFactor();
bool ProcessUnDecodeResults(const std::vector<FDTensor>& tensors,
std::vector<DetectionResult>* results);
};
} // namespace detection