2021-12-07 10:57:55 +08:00
|
|
|
// Copyright (c) OpenMMLab. All rights reserved.
|
|
|
|
|
|
|
|
#ifndef MMDEPLOY_COLLECT_H
|
|
|
|
#define MMDEPLOY_COLLECT_H
|
|
|
|
|
|
|
|
#include "transform.h"
|
|
|
|
namespace mmdeploy {
|
|
|
|
|
2022-02-24 20:08:44 +08:00
|
|
|
class MMDEPLOY_API CollectImpl : public Module {
|
2021-12-07 10:57:55 +08:00
|
|
|
public:
|
|
|
|
explicit CollectImpl(const Value& args);
|
2022-03-16 15:52:57 +08:00
|
|
|
~CollectImpl() override = default;
|
2021-12-07 10:57:55 +08:00
|
|
|
|
|
|
|
Result<Value> Process(const Value& input) override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
struct collect_arg_t {
|
|
|
|
std::vector<std::string> keys;
|
|
|
|
std::vector<std::string> meta_keys;
|
|
|
|
};
|
|
|
|
using ArgType = collect_arg_t;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
ArgType arg_;
|
|
|
|
};
|
|
|
|
|
2022-02-24 20:08:44 +08:00
|
|
|
class MMDEPLOY_API Collect : public Transform {
|
2021-12-07 10:57:55 +08:00
|
|
|
public:
|
|
|
|
explicit Collect(const Value& args, int version = 0);
|
2022-03-16 15:52:57 +08:00
|
|
|
~Collect() override = default;
|
2021-12-07 10:57:55 +08:00
|
|
|
|
|
|
|
Result<Value> Process(const Value& input) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<CollectImpl> impl_;
|
|
|
|
};
|
|
|
|
|
2022-02-24 20:08:44 +08:00
|
|
|
MMDEPLOY_DECLARE_REGISTRY(CollectImpl);
|
|
|
|
|
2021-12-07 10:57:55 +08:00
|
|
|
} // namespace mmdeploy
|
|
|
|
|
|
|
|
#endif // MMDEPLOY_COLLECT_H
|