Files
zeekay dda5b2a367 restore the tree
The previous commit was meant to remove .github/workflows and removed
every tracked path instead — 892 files, the whole repo. This puts back
the 874 that were never in scope; the eighteen workflow files stay gone,
for the reasons that commit gives.

Content is byte-identical to 9d2aec9 outside .github/workflows.
2026-08-13 23:27:57 -07:00

1.9 KiB

Generic Dataclasses

The generic dataclasses module provides the foundational data structures and validation logic used throughout Anomalib. These classes are designed to be flexible and type-safe, serving as the base for both PyTorch and NumPy implementations.

.. currentmodule:: anomalib.data.dataclasses.generic

Core Concepts

Type Variables

The module uses several type variables to ensure type safety across different implementations:

  • ImageT: Type variable for image data (PyTorch Image/Video or NumPy array)
  • T: Type variable for tensor-like data (PyTorch Tensor or NumPy array)
  • MaskT: Type variable for mask data (PyTorch Mask or NumPy array)
  • PathT: Type variable for path data (string or list of strings)

Base Classes

InputFields

.. autoclass:: _InputFields
   :members:
   :show-inheritance:

ImageInputFields

.. autoclass:: _ImageInputFields
   :members:
   :show-inheritance:

VideoInputFields

.. autoclass:: _VideoInputFields
   :members:
   :show-inheritance:

DepthInputFields

.. autoclass:: _DepthInputFields
   :members:
   :show-inheritance:

OutputFields

.. autoclass:: _OutputFields
   :members:
   :show-inheritance:

Mixins

UpdateMixin

.. autoclass:: UpdateMixin
   :members:
   :show-inheritance:

BatchIterateMixin

.. autoclass:: BatchIterateMixin
   :members:
   :show-inheritance:

Generic Classes

GenericItem

.. autoclass:: _GenericItem
   :members:
   :show-inheritance:

GenericBatch

.. autoclass:: _GenericBatch
   :members:
   :show-inheritance:

Field Validation

FieldDescriptor

.. autoclass:: FieldDescriptor
   :members:
   :show-inheritance:

See Also

  • {doc}torch
  • {doc}numpy