geowatch.tasks.tracking.abstract_classes module¶
- class geowatch.tasks.tracking.abstract_classes.TrackFunction[source]¶
Bases:
object
Abstract class that all track functions should inherit from.
- forward(sub_dset, video_id)[source]¶
Detect new annotations and track them in images for a single video.
- Parameters:
sub_dset (CocoDataset)
video_id (int) – video to track
- Returns:
kwcoco.CocoDataset
- apply_per_video(coco_dset)[source]¶
Main entrypoint for this class.
Calls
safe_apply()
on each video in the coco dataset.- Parameters:
coco_dset (kwcoco.CocoDataset) – the dataset to run tracking on
- Returns:
A modified or copied version of the input with new annotations and tracks.
- Return type:
kwcoco.CocoDataset
Example
>>> from geowatch.tasks.tracking.abstract_classes import * # NOQA >>> import kwcoco >>> self = NoOpTrackFunction() >>> coco_dset = kwcoco.CocoDataset.coerce('vidshapes8') >>> self.apply_per_video(coco_dset)
- class geowatch.tasks.tracking.abstract_classes.NoOpTrackFunction(**kwargs)[source]¶
Bases:
TrackFunction
Use existing tracks.
- class geowatch.tasks.tracking.abstract_classes.NewTrackFunction[source]¶
Bases:
TrackFunction
Specialization of TrackFunction to create polygons that do not yet exist in coco_dset, and add them as new annotations