class dlstreamer::DetectionMetadata#

#include <image_metadata.h>

class DetectionMetadata: public dlstreamer::InferenceResultMetadata {
public:
    // structs

    struct key;

    // fields

    static constexpr auto name = "detection";

    // methods

    double x_min() const;
    double y_min() const;
    double x_max() const;
    double y_max() const;
    double confidence() const;
    int id() const;
    int parent_id() const;
    int label_id() const;
    std::string label() const;

    void init(
        double x_min,
        double y_min,
        double x_max,
        double y_max,
        double confidence = 0.0,
        int label_id = -1,
        std::string_view label = {}
    );
};

Inherited Members#

public:
    // structs

    struct key;

    // classes

    class TensorImpl;

    // fields

    static constexpr auto name = "tensor";

    // methods

    virtual std::string name() const = 0;
    virtual std::vector<std::string> keys() const = 0;
    virtual std::optional<Any> try_get(std::string_view key) const = 0;
    virtual std::pair<const void*, size_t> try_get_array(std::string_view key) const = 0;
    virtual void set(std::string_view key, Any value) = 0;
    virtual void set_array(std::string_view key, const void* data, size_t nbytes) = 0;
    virtual void set_name(std::string const& name) = 0;

    template <typename T>
    T get(std::string_view key) const;

    template <typename T>
    T get(std::string_view key, T default_value) const;

    template <class T>
    const std::vector<T> get_array(std::string_view key) const;

    virtual std::string name() const;
    virtual std::optional<Any> try_get(std::string_view key) const;
    virtual std::pair<const void*, size_t> try_get_array(std::string_view key) const;
    virtual void set(std::string_view key, Any value);
    virtual void set_array(std::string_view key, const void* data, size_t nbytes);
    virtual void set_name(std::string const& name);
    virtual std::vector<std::string> keys() const;
    TensorPtr tensor() const;
    std::string model_name() const;
    std::string layer_name() const;
    std::string format() const;
    void set_model_name(const std::string& model_name);
    void set_layer_name(const std::string& layer_name);

    void init_tensor_data(
        const Tensor& tensor,
        const std::string& layer_name = "",
        const std::string& format = ""
    );

    DictionaryProxy(DictionaryPtr dict);