From 490a1d9bf9a2eaa8912026d7c2161a7f5a4b67fc Mon Sep 17 00:00:00 2001 From: GoldenAnpu Date: Tue, 17 Dec 2024 00:42:26 +0100 Subject: [PATCH] Update environment variable handling to provide defaults for dataset ID and target resolution settings --- src/globals.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/globals.py b/src/globals.py index 7df92cc..ee958ec 100644 --- a/src/globals.py +++ b/src/globals.py @@ -26,10 +26,10 @@ TEAM_ID = int(os.environ['context.teamId']) WORKSPACE_ID = int(os.environ['context.workspaceId']) PROJECT_ID = int(os.environ['modal.state.slyProjectId']) -DATASET_ID = int(os.environ['modal.state.slyDatasetId']) -CHANGE_RESOLUTION = bool(strtobool(os.environ['modal.state.changeResolution'])) -TARGET_HEIGHT = int(os.environ['modal.state.targetResolutionHeight']) -TARGET_WIDTH = int(os.environ['modal.state.targetResolutionWidth']) +DATASET_ID = int(os.environ.get('modal.state.slyDatasetId', None)) +CHANGE_RESOLUTION = bool(strtobool(os.environ.get('modal.state.changeResolution', 'false'))) +TARGET_HEIGHT = int(os.environ.get('modal.state.targetResolutionHeight'), 1280) +TARGET_WIDTH = int(os.environ.get('modal.state.targetResolutionWidth'), 720) target_resolution = (TARGET_WIDTH, TARGET_HEIGHT) TARGET_FPS = float(os.environ['modal.state.targetFps'])