-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #222 from argoai/use-global-constants
Import global constants from config
- Loading branch information
Showing
7 changed files
with
104 additions
and
50 deletions.
There are no files selected for viewing
26 changes: 24 additions & 2 deletions
26
argoverse/config/argoverse1.1.yaml → argoverse/config/argoverse-v1.1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,76 @@ | ||
SensorDatasetConfig: | ||
_target_: argoverse.sensor_dataset_config.SensorDatasetConfig | ||
dataset_name: argoverse1.1 | ||
dataset_name: argoverse-v1.1 | ||
ring_cam_fps: 30 | ||
stereo_cam_fps: 5 | ||
|
||
# all ring cameras are `landscape` aspect ratio | ||
sensors: | ||
camera_sensors: | ||
_target_: argoverse.sensor_dataset_config.SensorSuiteConfig | ||
|
||
ring_front_center: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 1200 | ||
img_width: 1920 | ||
name: ring_front_center | ||
|
||
ring_front_left: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 1200 | ||
img_width: 1920 | ||
name: ring_front_left | ||
|
||
ring_front_right: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 1200 | ||
img_width: 1920 | ||
name: ring_front_right | ||
|
||
ring_side_left: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 1200 | ||
img_width: 1920 | ||
name: ring_side_left | ||
|
||
ring_side_right: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 1200 | ||
img_width: 1920 | ||
name: ring_side_right | ||
|
||
ring_rear_left: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 1200 | ||
img_width: 1920 | ||
name: ring_rear_left | ||
|
||
ring_rear_right: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 1200 | ||
img_width: 1920 | ||
name: ring_rear_right | ||
|
||
stereo_front_right: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 2056 | ||
img_width: 2464 | ||
name: stereo_front_right | ||
|
||
stereo_front_left: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 2056 | ||
img_width: 2464 | ||
name: stereo_front_left | ||
|
||
# Rectified stereo images | ||
stereo_front_left_rect: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 2056 | ||
img_width: 2464 | ||
name: stereo_front_left_rect | ||
|
||
stereo_front_right_rect: | ||
_target_: argoverse.sensor_dataset_config.SensorConfig | ||
img_height: 2056 | ||
img_width: 2464 | ||
name: stereo_front_right_rect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import hydra | ||
from hydra.utils import instantiate | ||
|
||
from argoverse.sensor_dataset_config import SensorDatasetConfig | ||
|
||
|
||
def test_sensor_dataset_config(): | ||
"""Ensure that config fields are populated correctly from YAML.""" | ||
dataset_name = "argoverse-v1.1" | ||
|
||
with hydra.initialize_config_module(config_module="argoverse.config"): | ||
cfg = hydra.compose(config_name=f"{dataset_name}.yaml") | ||
argoverse_config: SensorDatasetConfig = instantiate(cfg.SensorDatasetConfig) | ||
|
||
# check a few camera names | ||
assert argoverse_config.camera_sensors.has_camera("ring_rear_left") | ||
assert argoverse_config.camera_sensors.has_camera("stereo_front_left_rect") | ||
assert not argoverse_config.camera_sensors.has_camera("ring_rear_dummyname") | ||
|
||
# check sample camera dimensions | ||
assert argoverse_config.camera_sensors.ring_rear_left.img_width == 1920 | ||
assert argoverse_config.camera_sensors.ring_rear_left.img_height == 1200 | ||
|
||
# check other properties | ||
assert argoverse_config.dataset_name == "argoverse-v1.1" | ||
assert argoverse_config.ring_cam_fps == 30 | ||
assert argoverse_config.stereo_cam_fps == 5 |