Dataset Tooling
The tooling for datasets is collected in the module hybrid_learning.datasets
.
For details have a look at the API Reference.
Base dataset handles
Abstract base class for tuple datasets with storage location. |
|
Wrapper for image datasets that will generate and yield activation maps. |
Custom dataset handles
Standard and concept datasets derived from MS COCO dataset. |
|
Dataset handles for FASSEG-like datasets. |
|
Handles for Broden-like datasets. |
Caching handles
Cache handles will allow to insert and read objects into/from a cache. For details see Dataset Caching.
Caching base handle. |
|
Combine several caches by trying to load from first to last. |
|
Cache the values of dicts using different caches. |
|
Cache the values of tuples using different caches. |
|
Cache objects in a (multiprocessing capable) dictionary in memory. |
|
Base class to cache objects as files under a cache folder. |
|
Cache for JPEG images using |
|
File cache that uses numpy saving and loading mechanism to cache |
|
File cache that uses numpy compressed saving and loading mechanism to cache |
|
Dummy cache that has no effect. |
|
File cache that uses torch saving and loading mechanism. |
|
In-memory cache specifically for torch tensors. |
Transformations
Transformations can be used to modify data tuples or values.
Transformations for tuples
Given a 3-tuple of input, target, mask apply the mask to the first two. |
|
Return the value of a sequence at selected index. |
|
Simple identity transformation for example for defaults. |
|
Apply a given transformation to all tuple items. |
|
Apply a given transformation to both input and target of a tuple in parallel. |
|
Apply a given transformation to tuple items at given indices. |
|
Apply a given one-value transformation only to the input of a two-tuple. |
|
Apply a given one-value transformation only to the target of a two-tuple. |
|
Given a 3-tuple of prediction, target, mask tensors merge mask and target and return a two-tuple. |
|
Transform an unpacked input tuple and then reduce it to one value using a reduction func. |
|
Given a tuple of input and target image, resize the target to the size of the input. |
|
Return a tuple only containing the elements at given indices of input tuple. |
|
Convenience trafo that takes an iterable and returns it as tuple. |
|
Undo a |
Transformations for dicts
Basic transformation for dicts. |
|
Drop the annotation with given key from the annotations dict. |
|
Return the value of the annotations dict at selected key. |
|
Perform a transformation on all values of a dict. |
|
Restrict the annotation dictionary to the annotation items with featuring one of the selected keys. |
|
Up- or down-scale the tensor mask values of a dictionary to all have the same size. |
Transformations for (tensor) images
Ensure that the given transformation is fed with a batch of inputs. |
|
Wrap a transformation operating on a batch of masks to also work on single masks. |
|
Simple class for binarizing tensors into high and low class values. |
|
Set all but the given highest number of pixels / q-th quantile in an image to zero, rest to 1. |
|
Base wrapper class to turn convolutional batch operations into single mask operations. |
|
Transformations that can be applied to images. |
|
IoU encode a single mask. |
|
Intersection encode a single mask. |
|
IoU encode a single mask. |
|
Disable |
|
Transformation that pads an image to a given ratio and then resizes it to fixed size. |
|
Generic lambda transformation that applies the given function with the standard |
|
|
Simple resize. |
Threshold tensors and set new values below and/or above the threshold. |
|
Evaluate a given image by a torch model on the correct device. |
|
Treat pixels of given mask as scores of constant-size bounding boxes, and return a mask with the non-max-suppressed bounding boxes. |
|
Squeeze or unsqueeze a tensor to obtain specified number of dimensions. |
|
Turn objects into tensors or move tensors to given device or dtype. |
|
Wrap a batch transformation with binarizing (and unsqueezing) before and after. |
Intersection and intersection over union encoders
Bloat single pixels to full boxes, always choosing the maximum box to be up front. |
|
Base class for encoder that use convolution operations. |
|
Given batch of IoU encoded masks, estimates the original segmentation mask. |
|
Apply intersection encoding to batch of input masks of shape |
|
Apply intersection over union encoding to an input batch. |
|
Keep only peak points, i.e. ones that take the maximum value within a window around them. |
|
Base class for encoder that use windowing operations. |
Visualization and Utility Functions
From hybrid_learning.datasets.data_visualization
|
Apply monochrome (possibly non-binary) mask to image of same size with alpha value. |
|
|
|
Merge several monochrome masks in different colors into the same image. |
|
From the given samples, calculate the mean of the proportion of positive pixels per mask. |
|
Collect the mean proportion of negative pixels in the binary segmentation mask data. |
|
Transform a (cuda) tensor to a |
|
|
|
Visualize a dataset yielding tuples of the form |
|
Visualize difference between original and the transformed masks of datasets. |
|
Visualize a dataset yielding tuples of the form |
From hybrid_learning.datasets.base
|
Add a peak to the heatmap |
|
Split dataset it into |