Reuse#

class deeptrack.augmentations.Reuse(feature: Feature, uses: int = 2, storage: int = 1, **kwargs)#

Bases: Feature

Acts like cache.

Reuse stores the output of a feature and reuses it for subsequent calls, even if it is updated. This is can be used after a time-consuming feature to augment the output of the feature without recalculating it.

Parameters#

feature: Feature

The feature to reuse.

uses: int

Number of each stored image uses before evaluating feature. Note that the actual total number of uses is uses * storage. Should be constant.

storage: int

Number of instances of the output of feature to cache. Should be constant.

Methods#

get(image: Image | np.ndarray, uses: PropertyLike[int], storage: PropertyLike[int], **kwargs) -> list[Image]

Abstract method which performs the Reuse augmentation.

Methods Summary

get(image, uses, storage, **kwargs)

Abstract method which performs the Reuse augmentation.

Methods Documentation

get(image: Image | np.ndarray, uses: PropertyLike[int], storage: PropertyLike[int], **kwargs) list[Image]#

Abstract method which performs the Reuse augmentation.