KeypointsModel

Objective-C

@interface KeypointsModel : Model

Swift

class KeypointsModel : Model

This class represents high-level API for keypoints models

KeypointsModel allows to set params for preprocessing input image. KeypointsModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and returns the x and y coordinates of each detected keypoint

Member of Dnn

Methods

  • Create model from deep learning network.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithNetwork:(nonnull Net *)network;

    Swift

    init(network: Net)

    Parameters

    network

    Net object.

  • Create keypoints model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithModel:(nonnull NSString *)model
                                   config:(nonnull NSString *)config;

    Swift

    init(model: String, config: String)

    Parameters

    model

    Binary file contains trained weights.

    config

    Text file contains network configuration.

  • Create keypoints model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithModel:(nonnull NSString *)model;

    Swift

    init(model: String)

    Parameters

    model

    Binary file contains trained weights.

  • Given the @p input frame, create input blob, run net

    Declaration

    Objective-C

    - (nonnull NSArray<Point2f *> *)estimate:(nonnull Mat *)frame
                                      thresh:(float)thresh;

    Swift

    func estimate(frame: Mat, thresh: Float) -> [Point2f]

    Parameters

    thresh

    minimum confidence threshold to select a keypoint

    Return Value

    a vector holding the x and y coordinates of each detected keypoint

  • Given the @p input frame, create input blob, run net

    Declaration

    Objective-C

    - (nonnull NSArray<Point2f *> *)estimate:(nonnull Mat *)frame;

    Swift

    func estimate(frame: Mat) -> [Point2f]

    Return Value

    a vector holding the x and y coordinates of each detected keypoint