From ae199f48b660637bde63a1764eee45794f6bdc4c Mon Sep 17 00:00:00 2001 From: GoldenAnpu Date: Mon, 16 Dec 2024 22:36:57 +0100 Subject: [PATCH] Improve dataset handling in framerate change function --- src/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index a3eed1c..693acfa 100644 --- a/src/main.py +++ b/src/main.py @@ -15,11 +15,12 @@ @sly.timeit def change_framerate(api: sly.Api, target_fps, result_project_name): - if g.DATASET_ID and g.PROJECT_ID is None: + if g.DATASET_ID: datasets = [api.dataset.get_info_by_id(g.DATASET_ID)] - g.PROJECT_ID = datasets[0].project_id + sly.logger.info(f'Processing single dataset ID {g.DATASET_ID} in project ID {g.PROJECT_ID}') else: datasets = api.dataset.get_list(g.PROJECT_ID) + sly.logger.info(f'Processing all datasets in project ID {g.PROJECT_ID}') if not result_project_name: project_info = api.project.get_info_by_id(g.PROJECT_ID)