Class KeypointsModel


  • public class KeypointsModel
    extends 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
    • Constructor Detail

      • KeypointsModel

        protected KeypointsModel​(long addr)
      • KeypointsModel

        public KeypointsModel​(Net network)
        Create model from deep learning network.
        Parameters:
        network - Net object.
      • KeypointsModel

        public KeypointsModel​(java.lang.String model,
                              java.lang.String config)
        Create keypoints model from network represented in one of the supported formats. An order of model and config arguments does not matter.
        Parameters:
        model - Binary file contains trained weights.
        config - Text file contains network configuration.
      • KeypointsModel

        public KeypointsModel​(java.lang.String model)
        Create keypoints model from network represented in one of the supported formats. An order of model and config arguments does not matter.
        Parameters:
        model - Binary file contains trained weights.
    • Method Detail

      • __fromPtr__

        public static KeypointsModel __fromPtr__​(long addr)
      • estimate

        public MatOfPoint2f estimate​(Mat frame,
                                     float thresh)
        Given the input frame, create input blob, run net
        Parameters:
        thresh - minimum confidence threshold to select a keypoint
        frame - automatically generated
        Returns:
        a vector holding the x and y coordinates of each detected keypoint
      • estimate

        public MatOfPoint2f estimate​(Mat frame)
        Given the input frame, create input blob, run net
        Parameters:
        frame - automatically generated
        Returns:
        a vector holding the x and y coordinates of each detected keypoint
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class Model
        Throws:
        java.lang.Throwable