File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 5
5
import torch .utils .benchmark as benchmark
6
6
7
7
import torchcodec
8
- import torchvision .transforms . v2 . functional as F
8
+ from torchvision .transforms import Resize
9
9
10
10
RESIZED_WIDTH = 256
11
11
RESIZED_HEIGHT = 256
12
12
13
13
14
14
def transfer_and_resize_frame (frame , resize_device_string ):
15
- # This should be a no-op if the frame is already on the target device .
15
+ # This should be a no-op if the frame is already on the GPU .
16
16
frame = frame .to (resize_device_string )
17
- frame = F . resize ( frame , (RESIZED_HEIGHT , RESIZED_WIDTH ))
17
+ frame = Resize ( (RESIZED_HEIGHT , RESIZED_WIDTH ))( frame )
18
18
return frame
19
19
20
20
@@ -129,8 +129,8 @@ def main():
129
129
"resize_device_string" : resize_device_string ,
130
130
},
131
131
label = label ,
132
- description = f"video={ os .path .basename (video_path )} " ,
133
- sub_label = f"D={ decode_label } R={ resize_label } " ,
132
+ sub_label = f"video={ os .path .basename (video_path )} " ,
133
+ description = f"D={ decode_label } , R={ resize_label } " ,
134
134
).blocked_autorange ()
135
135
results .append (t )
136
136
compare = benchmark .Compare (results )
You can’t perform that action at this time.
0 commit comments