devkit.md 2.45 KB
Newer Older
Chengyu Wang's avatar
Chengyu Wang committed
1
# Devkit
zhe chen's avatar
zhe chen committed
2

Chengyu Wang's avatar
Chengyu Wang committed
3
4
5
6
7
Here we describe the API provided by the OpenLane-V2 devkit.

## openlanev2.dataset

### Collection
zhe chen's avatar
zhe chen committed
8
9
10
11
12

is a collection of frames.

#### `Collection.get_frame_via_identifier(identifier : tuple) -> Frame`

Chengyu Wang's avatar
Chengyu Wang committed
13
Returns a frame with the given identifier (split, segment_id, timestamp).
zhe chen's avatar
zhe chen committed
14

Chengyu Wang's avatar
Chengyu Wang committed
15
#### `Collection.get_frame_via_index(index : int) -> (tuple, Frame)`
zhe chen's avatar
zhe chen committed
16

Chengyu Wang's avatar
Chengyu Wang committed
17
18
19
Returns a frame with the given index.

### Frame
zhe chen's avatar
zhe chen committed
20

Chengyu Wang's avatar
Chengyu Wang committed
21
is a data structure containing meta data of a frame.
zhe chen's avatar
zhe chen committed
22
23
24

#### `Frame.get_camera_list() -> list`

Chengyu Wang's avatar
Chengyu Wang committed
25
Retuens a list of camera names.
zhe chen's avatar
zhe chen committed
26

Chengyu Wang's avatar
Chengyu Wang committed
27
#### `Frame.get_pose() -> dict`
zhe chen's avatar
zhe chen committed
28

Chengyu Wang's avatar
Chengyu Wang committed
29
Retuens the pose of ego vehicle.
zhe chen's avatar
zhe chen committed
30

Chengyu Wang's avatar
Chengyu Wang committed
31
#### `Frame.get_image_path(camera : str) -> str`
zhe chen's avatar
zhe chen committed
32

Chengyu Wang's avatar
Chengyu Wang committed
33
Retuens the image path given a camera.
zhe chen's avatar
zhe chen committed
34

Chengyu Wang's avatar
Chengyu Wang committed
35
#### `Frame.get_rgb_image(camera : str) -> np.ndarray`
zhe chen's avatar
zhe chen committed
36

Chengyu Wang's avatar
Chengyu Wang committed
37
Retuens the RGB image given a camera.
zhe chen's avatar
zhe chen committed
38

Chengyu Wang's avatar
Chengyu Wang committed
39
#### `Frame.get_intrinsic(camera : str) -> dict`
zhe chen's avatar
zhe chen committed
40

Chengyu Wang's avatar
Chengyu Wang committed
41
Retuens the intrinsic given a camera.
zhe chen's avatar
zhe chen committed
42

Chengyu Wang's avatar
Chengyu Wang committed
43
#### `Frame.get_extrinsic(camera : str) -> dict`
zhe chen's avatar
zhe chen committed
44

Chengyu Wang's avatar
Chengyu Wang committed
45
Retuens the extrinsic given a camera.
zhe chen's avatar
zhe chen committed
46

Chengyu Wang's avatar
Chengyu Wang committed
47
#### `Frame.get_annotations() -> dict`
zhe chen's avatar
zhe chen committed
48

Chengyu Wang's avatar
Chengyu Wang committed
49
Retuens annotations of the current frame.
zhe chen's avatar
zhe chen committed
50

Chengyu Wang's avatar
Chengyu Wang committed
51
#### `Frame.get_annotations_lane_centerlines() -> dict`
zhe chen's avatar
zhe chen committed
52

Chengyu Wang's avatar
Chengyu Wang committed
53
Retuens lane centerline annotations of the current frame.
zhe chen's avatar
zhe chen committed
54

Chengyu Wang's avatar
Chengyu Wang committed
55
#### `Frame.get_annotations_traffic_elements() -> dict`
zhe chen's avatar
zhe chen committed
56

Chengyu Wang's avatar
Chengyu Wang committed
57
Retuens traffic element annotations of the current frame.
zhe chen's avatar
zhe chen committed
58

Chengyu Wang's avatar
Chengyu Wang committed
59
#### `Frame.get_annotations_topology_lclc() -> list`
zhe chen's avatar
zhe chen committed
60

Chengyu Wang's avatar
Chengyu Wang committed
61
Retuens the adjacent matrix of topology_lclc.
zhe chen's avatar
zhe chen committed
62

Chengyu Wang's avatar
Chengyu Wang committed
63
#### `Frame.get_annotations_topology_lcte() -> list`
zhe chen's avatar
zhe chen committed
64

Chengyu Wang's avatar
Chengyu Wang committed
65
66
67
68
69
Retuens the adjacent matrix of topology_lcte.

## openlanev2.evaluation

#### `evaluate(ground_truth, predictions) -> dict`
zhe chen's avatar
zhe chen committed
70
71
72
73

Given the ground truth and predictions, which are formatted dict or the path to pickle storing the dict that ground
truth is preprocessed pickle file and predictions are formatted as described [here](./submission.md#format), this
function returns a dict storing all metrics defined by our task.
Chengyu Wang's avatar
Chengyu Wang committed
74
75

## openlanev2.io
zhe chen's avatar
zhe chen committed
76
77

This subpackage wraps all IO operations of the OpenLane-V2 devkit. It can be modified for different IO operations.
Chengyu Wang's avatar
Chengyu Wang committed
78
79
80
81

## openlanev2.preprocessing

#### `collect(root_path : str, data_dict : dict, collection : str, point_interval : int = 1) -> None`
zhe chen's avatar
zhe chen committed
82
83
84
85

Given a data_dict storing identifiers of frames, this function collects meta data the frames and stores it into a pickle
file for efficient IO for the following operations.

Chengyu Wang's avatar
Chengyu Wang committed
86
#### `check_results(results : dict) -> None`
zhe chen's avatar
zhe chen committed
87

Chengyu Wang's avatar
Chengyu Wang committed
88
89
90
Check format of results.

## openlanev2.visualization
zhe chen's avatar
zhe chen committed
91

Chengyu Wang's avatar
Chengyu Wang committed
92
This subpackage provides tools for visualization. Please refer to the [tutorial](../tutorial.ipynb) for examples.