-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import global constants from config #222
Conversation
argoverse/utils/calibration.py
Outdated
img_width = RING_IMG_WIDTH | ||
img_height = RING_IMG_HEIGHT | ||
else: | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the argoverse-v1.1 calibration files have image dimensions in them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, they don't
img_height = STEREO_IMG_HEIGHT | ||
else: | ||
try: | ||
camera_sensor_config = getattr(ArgoverseConfig.camera_sensors, camera_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be a little bit more readable if we moved validation into ArgoverseConfig.camera_sensors
and avoided repeating this try/except elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
making a quick note that we discussed leaving it here, for backwards compatibility
demo_usage/cuboids_to_bboxes.py
Outdated
@@ -40,8 +41,8 @@ | |||
|
|||
# jigger lane pixel values by [-10,10] range | |||
LANE_COLOR_NOISE = 20 | |||
STEREO_FPS = 5 | |||
RING_CAM_FPS = 30 | |||
STEREO_FPS = ArgoverseConfig.stereo_cam_fps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What did you think about typing these with typing_extensions
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should brainstorm alternatives to setting global variables from configuration files? I guess this would require cleaning up other stuff files ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure -- do you mean just
STEREO_FPS: int = ArgoverseConfig.stereo_cam_fps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated now to use typing_extensions.Final
… use-global-constants
Previously, global constants like frame rate and image dimensions were scattered across the codebase, including in data_loading/synchronization_database.py and utils/camera_stats.py. This loads them from a single config file -- increasing readability for the codebase.