pocketpose.models.decoder - PocketPose 0.0.1 documentation

Hide navigation sidebar
Hide table of contents sidebar
Back to top
Edit this page
Toggle table of contents sidebar

# `pocketpose.models.decoder`

## Submodules

- `pocketpose.models.decoder.base_decoder`
- `pocketpose.models.decoder.heatmap`
- `pocketpose.models.decoder.posenet`
- `pocketpose.models.decoder.simcc`

## Package Contents

### Classes

`Decoder` | Base class for all decoders.
`HeatmapDeocder` | Base class for all decoders.
`PoseNetDecoder` |
`SimCCDecoder` | Base class for all decoders.

class pocketpose.models.decoder.Decoder

  Bases: `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.

  abstract decode(x, image_size)

class pocketpose.models.decoder.HeatmapDeocder

  Bases: `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.

  decode(prediction, image_shape)

class pocketpose.models.decoder.PoseNetDecoder(output_stride=32, local_maximum_radius=1, threshold=0.5)
  decode_multi_pose(heatmaps, offsets, displacement_fwd, displacement_bwd)
  build_part_with_score_queue(scores)
  score_is_maximum_in_local_window(keypointId, score, heatmapY, heatmapX, scores)
  traverse_to_target_keypoint(keypoints, displacements, direction, scores, offsets)
  get_edge_keypoints(edge_id, direction)
  estimate_target_keypoint_position(edge_id, source_keypoint_id, target_keypoint_id, keypoints, displacements, scores, offsets)
  get_displacement(edge_id, keypoint, displacements)
  get_strided_index_near_point(point, output_stride, displacements)
  get_instance_score(keypoints)
  sigmoid(x)

class pocketpose.models.decoder.SimCCDecoder

  Bases: `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.

  decode(prediction, image_shape)