From 8327da623268acccce3679943c0e220dbdab8321 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Fri, 20 May 2022 11:12:41 +0100 Subject: [PATCH 1/2] Remove deprecation warning for pts on read_video --- torchvision/io/video.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/torchvision/io/video.py b/torchvision/io/video.py index d026e754546..b9b0ae1fcbd 100644 --- a/torchvision/io/video.py +++ b/torchvision/io/video.py @@ -156,11 +156,11 @@ def _read_from_stream( start_offset = int(math.floor(start_offset * (1 / stream.time_base))) if end_offset != float("inf"): end_offset = int(math.ceil(end_offset * (1 / stream.time_base))) - else: - warnings.warn( - "The pts_unit 'pts' gives wrong results and will be removed in a " - + "follow-up version. Please use pts_unit 'sec'." - ) + # else: + # warnings.warn( + # "The pts_unit 'pts' gives wrong results and will be removed in a " + # + "follow-up version. Please use pts_unit 'sec'." + # ) frames = {} should_buffer = True From 2365b7f74a506bc02949d67c60c06d4ee2c00068 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Fri, 20 May 2022 11:26:38 +0100 Subject: [PATCH 2/2] Fixing linter --- torchvision/io/video.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/torchvision/io/video.py b/torchvision/io/video.py index b9b0ae1fcbd..0ced6fce98b 100644 --- a/torchvision/io/video.py +++ b/torchvision/io/video.py @@ -157,10 +157,10 @@ def _read_from_stream( if end_offset != float("inf"): end_offset = int(math.ceil(end_offset * (1 / stream.time_base))) # else: - # warnings.warn( - # "The pts_unit 'pts' gives wrong results and will be removed in a " - # + "follow-up version. Please use pts_unit 'sec'." - # ) + # warnings.warn( + # "The pts_unit 'pts' gives wrong results and will be removed in a " + # + "follow-up version. Please use pts_unit 'sec'." + # ) frames = {} should_buffer = True