mednet.data.detect.shenzhen

Shenzhen database transformed for lung detection.

Check segment.shenzhen for details. This module only uses the segmentation utilities to provide an “object detection” interface.

  • Output sample:

    • Image: As per segment.shenzhen.

    • Bounding-box: A single bounding-box accounting for the observed lung region.

This module contains the base declaration of common data modules and raw-data loaders for this database. All configured splits inherit from this definition.

Classes

DataModule(split_path)

Shenzhen database transformed for lung detection.

RawDataLoader()

A specialized raw-data-loader for the shenzhen dataset.

class mednet.data.detect.shenzhen.RawDataLoader[source]

Bases: RawDataLoader

A specialized raw-data-loader for the shenzhen dataset.

sample(sample)[source]

Load a single image sample from the disk.

Parameters:

sample (Any) – A tuple containing the path suffix, within the dataset root folder, where to find the image to be loaded, and an integer, representing the sample label.

Return type:

Mapping[str, Any]

Returns:

The sample representation.

target(sample)[source]

Load only sample target from its raw representation.

Parameters:

sample (Any) – A tuple containing the path suffix, within the dataset root folder, where to find the image to be loaded, and an integer, representing the sample target.

Return type:

Tensor

Returns:

The label corresponding to the specified sample, encapsulated as a torch float tensor.

class mednet.data.detect.shenzhen.DataModule(split_path)[source]

Bases: CachingDataModule

Shenzhen database transformed for lung detection.

Parameters:

split_path (Path | Traversable) – Path or traversable (resource) with the JSON split description to load.