Skip to content

Commit 1f9a7e0

Browse files
samet-akcayashwinvaidya17djdameln
authored
📚 Add docstrings to dataclasses (#2292)
* Reduce rich methods (#2283) remove rich Signed-off-by: Ashwin Vaidya <[email protected]> * Refactor BaseThreshold to Threshold (#2278) * Refactor BaseThreshold to Threshold * Add relative import and add tests Signed-off-by: Samet Akcay <[email protected]> * Revert threshold.py to base.py Signed-off-by: Samet Akcay <[email protected]> * Revert threshold imports Signed-off-by: Samet Akcay <[email protected]> * Update tests/unit/metrics/threshold/test_threshold.py Co-authored-by: Ashwin Vaidya <[email protected]> --------- Signed-off-by: Samet Akcay <[email protected]> Co-authored-by: Ashwin Vaidya <[email protected]> * Enable Ruff Rules: PLW1514 and PLR6201 (#2284) * pre-commit autoupdate Signed-off-by: Samet Akcay <[email protected]> * Enable preview feautures, and disable some of the updated features * Add missing copyrights Signed-off-by: Samet Akcay <[email protected]> * Ignore copyrights in notebooks * "PLW1514", # Add explicit encoding argument Signed-off-by: Samet Akcay <[email protected]> * "PLR6201", # Convert to set Signed-off-by: Samet Akcay <[email protected]> --------- Signed-off-by: Samet Akcay <[email protected]> * Update docstring - FieldDescriptor * Add docstring to generic.py Signed-off-by: Samet Akcay <[email protected]> * Add docstring to numpy.py Signed-off-by: Samet Akcay <[email protected]> * Add docstring to torch.py Signed-off-by: Samet Akcay <[email protected]> * Update src/anomalib/dataclasses/torch.py Co-authored-by: Dick Ameln <[email protected]> * Update src/anomalib/dataclasses/torch.py Co-authored-by: Dick Ameln <[email protected]> * Update src/anomalib/dataclasses/generic.py Co-authored-by: Dick Ameln <[email protected]> * Update src/anomalib/dataclasses/torch.py Co-authored-by: Dick Ameln <[email protected]> * Update src/anomalib/dataclasses/torch.py Co-authored-by: Dick Ameln <[email protected]> * Update src/anomalib/dataclasses/torch.py Co-authored-by: Dick Ameln <[email protected]> * Update src/anomalib/dataclasses/torch.py Co-authored-by: Dick Ameln <[email protected]> * Update src/anomalib/dataclasses/torch.py Co-authored-by: Ashwin Vaidya <[email protected]> --------- Signed-off-by: Ashwin Vaidya <[email protected]> Signed-off-by: Samet Akcay <[email protected]> Co-authored-by: Ashwin Vaidya <[email protected]> Co-authored-by: Ashwin Vaidya <[email protected]> Co-authored-by: Dick Ameln <[email protected]>
1 parent 333baec commit 1f9a7e0

File tree

4 files changed

+691
-75
lines changed

4 files changed

+691
-75
lines changed

src/anomalib/dataclasses/__init__.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1-
"""Anomalib dataclasses."""
1+
"""Anomalib dataclasses.
2+
3+
This module provides a collection of dataclasses used throughout the Anomalib library
4+
for representing and managing various types of data related to anomaly detection tasks.
5+
6+
The dataclasses are organized into two main categories:
7+
1. Numpy-based dataclasses for handling numpy array data.
8+
2. Torch-based dataclasses for handling PyTorch tensor data.
9+
10+
Key components:
11+
12+
Numpy Dataclasses:
13+
``NumpyImageItem``: Represents a single image item as numpy arrays.
14+
``NumpyImageBatch``: Represents a batch of image data as numpy arrays.
15+
``NumpyVideoItem``: Represents a single video item as numpy arrays.
16+
``NumpyVideoBatch``: Represents a batch of video data as numpy arrays.
17+
18+
Torch Dataclasses:
19+
``Batch``: Base class for torch-based batch data.
20+
``DatasetItem``: Base class for torch-based dataset items.
21+
``DepthItem``: Represents a single depth data item.
22+
``DepthBatch``: Represents a batch of depth data.
23+
``ImageItem``: Represents a single image item as torch tensors.
24+
``ImageBatch``: Represents a batch of image data as torch tensors.
25+
``VideoItem``: Represents a single video item as torch tensors.
26+
``VideoBatch``: Represents a batch of video data as torch tensors.
27+
``InferenceBatch``: Specialized batch class for inference results.
28+
29+
These dataclasses provide a structured way to handle various types of data
30+
in anomaly detection tasks, ensuring type consistency and easy data manipulation
31+
across different components of the Anomalib library.
32+
"""
233

334
# Copyright (C) 2024 Intel Corporation
435
# SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)