MNN/source/backend/cpu/CPUProposal.hpp

43 lines
1.0 KiB
C++
Raw Normal View History

2019-04-17 10:49:11 +08:00
//
// CPUProposal.hpp
// MNN
//
// Created by MNN on 2018/07/17.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef CPUProposal_hpp
#define CPUProposal_hpp
#include <functional>
2019-12-27 22:16:57 +08:00
#include "core/AutoStorage.h"
#include "core/Execution.hpp"
2023-09-04 10:42:11 +08:00
#include "core/BufferAllocator.hpp"
2019-04-17 10:49:11 +08:00
#include "MNN_generated.h"
namespace MNN {
class CPUProposal : public Execution {
public:
CPUProposal(Backend *backend, const Proposal *proposal);
virtual ~CPUProposal() = default;
virtual ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
2024-09-12 12:57:57 +08:00
struct ProposalCache {
int32_t featStride;
int32_t preNmsTopN;
int32_t minSize;
int32_t afterNmsTopN;
float nmsThreshold;
};
2019-04-17 10:49:11 +08:00
private:
2024-09-12 12:57:57 +08:00
ProposalCache mCache;
2019-04-17 10:49:11 +08:00
AutoStorage<float> mAnchors;
2023-09-04 10:42:11 +08:00
MemChunk mScoreBuffer;
2019-04-17 10:49:11 +08:00
};
} // namespace MNN
#endif /* CPUProposal_hpp */