mmdeploy/csrc/codebase/mmdet/object_detection.h
hanrui1sensetime 6948e3d04b
Ncnn demo sdk (#164)
* fix different dims and data sync and fp16 macro

* fix pad is negative bug, but still need debugging info

* split detection_output to dets and labels

* fix clang++ compile bug

* for fp16 compile macro of cmake

* fix pad_val dict input

* fix yolox missing normalization and get int tensor

* about score_threshold

* remove -lstdc++fs for android

* move -pthread for android

* fix link libraries for CLANG++;

* fix clang-format

* for mobileyolov3 conf_thre

* fix lint

* fix bug

* support ncnn vulkan net

* remove unused debugging info;

* Change INFO to DEBUG

* support vulkan precision mapping

* fix pad

* optimize getdetslabels

* remove EVAL_MODE

* ncnn_net support 4-dim data.

* remove FP16 compile options

* remove use_gpu_vulkan compile options

* fix pad.cpp

* fix yapf

* fix clang-format

* rm redundant lines

* fix pad according to mmdet

* add android build docs

* fix lint

* use cpp style string comparision

* fix use after free bug

* Add missing -DBUILD_SHARED_LIBS=OFF for en

* Add missing -DBUILD_SHARED_LIBS=OFF for ZH-CN

* reset img2tensor_impl

* reset img2tensor_impl

* add blank line

* sync android.md docs

* fix some dirs

* fix docs

* update docs

* fix code
2022-03-25 23:28:16 +08:00

40 lines
1.3 KiB
C++

// Copyright (c) OpenMMLab. All rights reserved.
#ifndef MMDEPLOY_SRC_CODEBASE_MMDET_OBJECT_DETECTION_H_
#define MMDEPLOY_SRC_CODEBASE_MMDET_OBJECT_DETECTION_H_
#include "codebase/mmdet/mmdet.h"
#include "core/tensor.h"
#include "core/utils/formatter.h"
namespace mmdeploy::mmdet {
class ResizeBBox : public MMDetection {
public:
explicit ResizeBBox(const Value& cfg);
Result<Value> operator()(const Value& prep_res, const Value& infer_res);
protected:
Result<DetectorOutput> DispatchGetBBoxes(const Value& prep_res, const Tensor& dets,
const Tensor& labels);
template <typename T>
Result<DetectorOutput> GetBBoxes(const Value& prep_res, const Tensor& dets, const Tensor& labels);
std::array<float, 4> MapToOriginImage(float left, float top, float right, float bottom,
const float* scale_factor, float x_offset, float y_offset,
int ori_width, int ori_height);
std::vector<Tensor> GetDetsLabels(const Value& prep_res, const Value& infer_res);
protected:
constexpr static Device kHost{0, 0};
float score_thr_{0.f};
float min_bbox_size_{0.f};
};
} // namespace mmdeploy::mmdet
#endif // MMDEPLOY_SRC_CODEBASE_MMDET_OBJECT_DETECTION_H_