:py:mod:`pocketpose.models.decoder`
===================================

.. py:module:: pocketpose.models.decoder


Submodules
----------
.. toctree::
   :titlesonly:
   :maxdepth: 1

   base_decoder/index.rst
   heatmap/index.rst
   posenet/index.rst
   simcc/index.rst


Package Contents
----------------

Classes
~~~~~~~

.. autoapisummary::

   pocketpose.models.decoder.Decoder
   pocketpose.models.decoder.HeatmapDeocder
   pocketpose.models.decoder.PoseNetDecoder
   pocketpose.models.decoder.SimCCDecoder




.. py:class:: Decoder


   Bases: :py:obj:`abc.ABC`

   Base class for all decoders. 

   Decoders are used to decode the prediction of pose models into a keypoint list
   in the image coordinate system. The keypoint list is a list of tuples (x, y, score)
   where x and y are the coordinates and score is the prediction confidence.

   All decoders must implement the decode method. Each model has a corresponding decoder,
   and the decode method is automatically called when the model is used for prediction.

   .. py:method:: decode(x, image_size)
      :abstractmethod:



.. py:class:: HeatmapDeocder


   Bases: :py:obj:`pocketpose.models.decoder.base_decoder.Decoder`

   Base class for all decoders. 

   Decoders are used to decode the prediction of pose models into a keypoint list
   in the image coordinate system. The keypoint list is a list of tuples (x, y, score)
   where x and y are the coordinates and score is the prediction confidence.

   All decoders must implement the decode method. Each model has a corresponding decoder,
   and the decode method is automatically called when the model is used for prediction.

   .. py:method:: decode(prediction, image_shape)



.. py:class:: PoseNetDecoder(output_stride=32, local_maximum_radius=1, threshold=0.5)


   .. py:method:: decode_multi_pose(heatmaps, offsets, displacement_fwd, displacement_bwd)


   .. py:method:: build_part_with_score_queue(scores)


   .. py:method:: score_is_maximum_in_local_window(keypointId, score, heatmapY, heatmapX, scores)


   .. py:method:: traverse_to_target_keypoint(keypoints, displacements, direction, scores, offsets)


   .. py:method:: get_edge_keypoints(edge_id, direction)


   .. py:method:: estimate_target_keypoint_position(edge_id, source_keypoint_id, target_keypoint_id, keypoints, displacements, scores, offsets)


   .. py:method:: get_displacement(edge_id, keypoint, displacements)


   .. py:method:: get_strided_index_near_point(point, output_stride, displacements)


   .. py:method:: get_instance_score(keypoints)


   .. py:method:: sigmoid(x)



.. py:class:: SimCCDecoder


   Bases: :py:obj:`pocketpose.models.decoder.base_decoder.Decoder`

   Base class for all decoders. 

   Decoders are used to decode the prediction of pose models into a keypoint list
   in the image coordinate system. The keypoint list is a list of tuples (x, y, score)
   where x and y are the coordinates and score is the prediction confidence.

   All decoders must implement the decode method. Each model has a corresponding decoder,
   and the decode method is automatically called when the model is used for prediction.

   .. py:method:: decode(prediction, image_shape)



