datumaro.components.shift_analyzer#

Classes

FeatureAccumulator(model)

FeatureAccumulatorByLabel(model)

RunningStats1D()

ShiftAnalyzer()

Searcher for Datumaro dataitems

class datumaro.components.shift_analyzer.RunningStats1D[source]#

Bases: object

add(feats: List[FeatureVector]) None[source]#
property mean: ndarray#
property cov: ndarray#
class datumaro.components.shift_analyzer.FeatureAccumulator(model: LauncherWithModelInterpreter)[source]#

Bases: object

get_activation_stats(dataset: IDataset) RunningStats1D[source]#
class datumaro.components.shift_analyzer.FeatureAccumulatorByLabel(model)[source]#

Bases: FeatureAccumulator

get_activation_stats(dataset: IDataset) Dict[int, RunningStats1D][source]#
class datumaro.components.shift_analyzer.ShiftAnalyzer[source]#

Bases: object

Searcher for Datumaro dataitems

Parameters:
  • dataset – Datumaro dataset to search similar dataitem.

  • topk – Number of images.

compute_covariate_shift(sources: List[IDataset], method: str | None = 'fid')[source]#
compute_label_shift(sources: List[IDataset])[source]#