# py123detection
A [123D](https://kesai.eu/py123d/) toolkit for 3D multi-view object detection.
Two branches share the 123D data model:
| Branch | Module | Status |
| --- | --- | --- |
| **mmcv export**: turn any 123D dataset into the `info` pickle the mmcv / mmdetection3d ecosystem reads, so existing PETR / StreamPETR / BEVDet configs train on 123D data unchanged | `py123detection.mmcv_export`, plus `py123detection.mmcv_plugin` on the training side | implemented |
| **modern stack**: the mmcv-free path from the master thesis | | not started |
## Why this exists
123D already normalizes a dozen driving datasets into one schema. mmdetection3d natively supports exactly one data format: the nuScenes `info` pickle. Every camera-based detector built on it (PETR,
StreamPETR, BEVDet, CoIn3D) reads that specific data format, and for example CoIn3D's cross-dataset training works by converting Waymo and Lyft into it and concatenating the results.
One converter from 123D to that exact data format makes every 123D dataset trainable with off-the-shelf
configs, individually or mixed.
## How it fits together
There are two routes from a raw dataset to the pickle a detector trains on. The first needs a
hand-written converter for every dataset. The second needs none, because the per-dataset work
already happened when 123D was built.
```mermaid
flowchart TD
RAW["Raw dataset
nuScenes, Argoverse 2, Waymo, ..."]
RAW --> NATIVE["mmdetection3d converter
tools/create_data.py
one per dataset, hand-written"]
RAW --> CONV["123D conversion
py123d-conversion"]
NATIVE --> PKLA["info pickle"]
CONV --> LOGS["123D logs
Arrow tables, one schema
for every dataset"]
LOGS --> EXPORT["py123detection exporter
py123det-export-mmcv
one converter, every dataset"]
EXPORT --> PKLB["info pickle"]
PKLA --> CFG["mmdet3d config
ann_file=..."]
PKLB --> CFG
CFG --> MODEL["PETR / StreamPETR /
BEVDet / CoIn3D"]
style PKLA fill:#eef4fb,stroke:#2a78d6
style PKLB fill:#eef4fb,stroke:#2a78d6
style LOGS fill:#fdf1ea,stroke:#eb6834
style EXPORT fill:#fdf1ea,stroke:#eb6834
```
The two pickles are interchangeable. That claim is measured, not asserted: see
[Does the output match the native converter?](validation.md#does-the-output-match-the-native-converter).
Inside the 123D route, these are the pieces you actually name in your own code or on the command
line. Everything else is internal.
```mermaid
flowchart TD
LOGS["123D logs"] --> SRC
subgraph EXPORTENV ["conversion environment: py123d + numpy"]
SRC["Source
py123detection
which logs, which splits,
what frame rate"]
TAX["Taxonomy
py123detection
123D labels to class names
presets: nuscenes_detection_10cls,
general_3cls, coin3d_3cls, ..."]
CONF["ExportConfig
py123detection.mmcv_export
cameras, reference frame, box layout,
sweeps, velocity, tokens, paths"]
RUN["export_to_mmdet3d()
py123detection.mmcv_export"]
REP["ExportReport
frame / box / class counts,
skips, warnings"]
SRC --> RUN
TAX --> CONF
CONF --> RUN
RUN --> REP
end
RUN --> PKL["info pickle
infos + metadata"]
subgraph TRAINENV ["training environment: mmcv / mmdet3d"]
STOCK["NuScenesDataset
stock mmdet3d,
nothing to install"]
PLUG["Py123DNuScenesDataset
py123detection.mmcv_plugin
portable arrays, taxonomy classes,
evaluation without a nuScenes DB"]
end
PKL --> STOCK
PKL --> PLUG
style PKL fill:#eef4fb,stroke:#2a78d6
style LOGS fill:#fdf1ea,stroke:#eb6834
```
The CLI is the same three objects behind a flag parser: `py123det-export-mmcv export` builds a
`Source` and an `ExportConfig` from its arguments and calls `export_to_mmdet3d`.
```{toctree}
:hidden:
:caption: Getting started
installation
quickstart
examples
```
```{toctree}
:hidden:
:caption: Guides
guides/choosing-what-to-export
guides/extrinsics
guides/sensor-payloads
guides/cross-dataset-training
guides/tokens-and-evaluation
guides/python-version-boundary
other-datasets
```
```{toctree}
:hidden:
:caption: Reference
validation
cli
api/index
```
```{toctree}
:hidden:
:caption: Development
contributing
development
```