Skip to content

Commit

Permalink
Improve dataset handling in framerate change function
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenAnpu committed Dec 16, 2024
1 parent 580b8eb commit ae199f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ae199f4

Please sign in to comment.