Skip to content

Semantic3D

The Semantic3D dataset.

First page of Semantic3D.net: A new Large-scale Point Cloud Classification Benchmark

1704.03847 · April 2017

Semantic3D.net: A new Large-scale Point Cloud Classification Benchmark by Hackel, Savinov, Ladicky, Wegner, Schindler and Pollefeys (2017).

Each scene is distributed as a pair of plain-text files:

  • <scene>.txt - one row per point with x y z intensity r g b (white-space separated, ASCII, no header). XYZ are float64 meters; intensity is float; RGB are uint8 0-255.
  • <scene>.labels - one row per point with the integer class id (\(0\) = unlabelled, \(1\)-\(8\) = the eight benchmark classes). .labels is only present for the reduced-8 and training splits.

Classes:

Functions:

  • load_semantic3d_data –

    Parse a Semantic3D <scene>.txt (and optional <scene>.labels) file pair.

Semantic3D

Semantic3D(
    root: PathLike,
    *,
    split: Semantic3DSplit = "train",
    scenes: Optional[Sequence[str]] = None,
    transform: Optional[
        Callable[[Dict[str, Any]], Dict[str, Any]]
    ] = None,
)

Bases: PointCloudDataset

The Semantic3D dataset.

Each sample is a single ASCII-text scene, returned as a dictionary:

Key Shape Dtype Meaning
pos \((N, 3)\) float32 XYZ
intensity \((N, 1)\) float32 LiDAR intensity
color \((N, 3)\) uint8 RGB (0-255)
segment \((N,)\) int64 Raw class id 0-8 (0 = unlabelled, ignored). Absent for held-out scenes.
name str Source scene name

Parameters:

  • root (PathLike) –

    Dataset root. Files are read from <root>/Semantic3D/raw/<scene>.txt.

  • split (Semantic3DSplit, default: 'train' ) –

    One of "train" / "test" / "all". Defaults to "train". "test" returns the four reduced-8 benchmark scenes (without labels).

  • scenes (Optional[Sequence[str]], default: None ) –

    Optional explicit list of scene names (without the .txt / .labels suffix). Overrides split.

  • transform (Optional[Callable[[Dict[str, Any]], Dict[str, Any]]], default: None ) –

    Callable applied to each loaded sample dict at __getitem__ time.

Note

The dataset must be downloaded manually from semantic3d.net (a license must be accepted). The expected layout under <root>/Semantic3D/raw/ is one <scene>.txt (and matching <scene>.labels for training scenes) per scene.

Warning

Loading is done with np.loadtxt, which reads the (often 100M+-row) ASCII files into RAM in a single shot. Each scene needs ~5 GB of RAM to parse; consider extracting only the scenes you need for evaluation.

Methods:

  • download –

    Semantic3D must be downloaded manually (a license must be accepted).

Attributes:

  • name (str) –

    Name of the dataset directory.

  • data_dir (str) –

    Path to the dataset directory <root>/<name>.

  • raw_dir (str) –

    Path to the raw download directory.

  • processed_dir (str) –

    Path to the processed cache directory.

name property

name: str

Name of the dataset directory.

data_dir property

data_dir: str

Path to the dataset directory <root>/<name>.

raw_dir property

raw_dir: str

Path to the raw download directory.

processed_dir property

processed_dir: str

Path to the processed cache directory.

download

download(force: bool = False) -> None

Semantic3D must be downloaded manually (a license must be accepted).

Parameters:

  • force (bool, default: False ) –

    Unused; present to mirror the other datasets' download signature.

Raises: RuntimeError: Always; automatic download is not supported.

load_semantic3d_data

load_semantic3d_data(
    path_txt: PathLike,
    /,
    path_labels: Optional[PathLike] = None,
) -> Dict[str, Tensor]

Parse a Semantic3D <scene>.txt (and optional <scene>.labels) file pair.

The .txt files are large ASCII (often 100M+ rows) - we use np.loadtxt which is slow but free of compiled dependencies. The segment key is only populated when path_labels is provided and exists (held-out test scenes receive no segment key).

Key Shape Dtype
pos \((N, 3)\) float32
intensity \((N, 1)\) float32
color \((N, 3)\) uint8
segment \((N,)\) int64