Files
FastDeploy/fastdeploy/vision/detection/ppdet/postprocessor.h
Jason beaa0fd190 [Model] Refactor PaddleDetection module (#575)
* Add namespace for functions

* Refactor PaddleDetection module

* finish all the single image test

* Update preprocessor.cc

* fix some litte detail

* add python api

* Update postprocessor.cc
2022-11-15 10:43:23 +08:00

45 lines
1.5 KiB
C++

// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include "fastdeploy/vision/common/processors/transform.h"
#include "fastdeploy/vision/common/result.h"
namespace fastdeploy {
namespace vision {
namespace detection {
/*! @brief Postprocessor object for PaddleDet serials model.
*/
class FASTDEPLOY_DECL PaddleDetPostprocessor {
public:
PaddleDetPostprocessor() = default;
/** \brief Process the result of runtime and fill to ClassifyResult structure
*
* \param[in] tensors The inference result from runtime
* \param[in] result The output result of detection
* \return true if the postprocess successed, otherwise false
*/
bool Run(const std::vector<FDTensor>& tensors,
std::vector<DetectionResult>* result);
private:
// Process mask tensor for MaskRCNN
bool ProcessMask(const FDTensor& tensor,
std::vector<DetectionResult>* results);
};
} // namespace detection
} // namespace vision
} // namespace fastdeploy