↰ Return to documentation for file (morpheus/_lib/include/morpheus/stages/add_classification.hpp
)
#pragma once
#include "morpheus/messages/multi_response_probs.hpp"
#include <mrc/channel/status.hpp>// for Status
#include <mrc/node/sink_properties.hpp>// for SinkProperties<>::sink_type_t
#include <mrc/node/source_properties.hpp>// for SourceProperties<>::source_type_t
#include <mrc/segment/builder.hpp>
#include <mrc/segment/object.hpp>// for Object
#include <pymrc/node.hpp>
#include <rxcpp/rx.hpp>
#include <cstddef>// for size_t
#include <map>
#include <memory>
#include <string>
#include <vector>
namespace morpheus {
/****** Component public implementations *******************/
/****** AddClassificationStage********************************/
#pragma GCC visibility push(default)
class AddClassificationsStage : public mrc::pymrc::PythonNode<std::shared_ptr<MultiResponseProbsMessage>,
std::shared_ptr<MultiResponseProbsMessage>>
{
public:
using base_t =
mrc::pymrc::PythonNode<std::shared_ptr<MultiResponseProbsMessage>, std::shared_ptr<MultiResponseProbsMessage>>;
using typename base_t::sink_type_t;
using typename base_t::source_type_t;
using typename base_t::subscribe_fn_t;
AddClassificationsStage(float threshold,
std::size_t num_class_labels,
std::map<std::size_t, std::string> idx2label);
private:
subscribe_fn_t build_operator();
float m_threshold;
std::size_t m_num_class_labels;
std::map<std::size_t, std::string> m_idx2label;
};
/****** AddClassificationStageInterfaceProxy******************/
struct AddClassificationStageInterfaceProxy
{
static std::shared_ptr<mrc::segment::Object<AddClassificationsStage>> init(
mrc::segment::Builder& builder,
const std::string& name,
float threshold,
std::size_t num_class_labels,
std::map<std::size_t, std::string> idx2label);
};
#pragma GCC visibility pop// end of group
} // namespace morpheus