Skip to content

tracks

tracks #

The tracks scalar; a loaded Tracks is the .npz path.

Tracks #

Bases: NumpyScalar

Keypoints chained across images into tracks, one row per keypoint in a track.

The rows are sorted by track:

  • track: the track each row belongs to.
  • image: the image index of the row's keypoint.
  • keypoint: the index into that image's keypoints.

Analysis-only: produced by a recipe, never captured, so it has no platform mirror and no place in a schema.

Source code in capturegraph-recipes/capturegraph_recipes/types/reconstruction/tracks.py
class Tracks(cg.NumpyScalar, name="edu.cornell.tracks"):
    """Keypoints chained across images into tracks, one row per keypoint in a track.

    The rows are sorted by ``track``:

    - ``track``: the track each row belongs to.
    - ``image``: the image index of the row's keypoint.
    - ``keypoint``: the index into that image's keypoints.

    Analysis-only: produced by a recipe, never captured, so it has no platform
    mirror and no place in a schema.
    """

    __slots__ = ()

    analysis_only = True

    layout = {
        "track": ("int32", (-1,)),
        "image": ("int32", (-1,)),
        "keypoint": ("int32", (-1,)),
    }

    def count(self) -> int:
        """The number of distinct tracks."""
        import numpy as np

        return int(np.unique(self.array("track")).shape[0])

count() #

The number of distinct tracks.

Source code in capturegraph-recipes/capturegraph_recipes/types/reconstruction/tracks.py
def count(self) -> int:
    """The number of distinct tracks."""
    import numpy as np

    return int(np.unique(self.array("track")).shape[0])