[fix] dataset ext judge

This commit is contained in:
Zangwei Zheng 2024-04-08 20:42:38 +08:00
parent 3210a691cf
commit 8d3f0f8282

View file

@ -1,3 +1,5 @@
import os
import numpy as np
import torch
import torchvision
@ -94,7 +96,7 @@ def read_video_from_path(path, transform=None, image_size=(256, 256)):
def read_from_path(path, image_size):
ext = path.split(".")[-1]
ext = os.path.splitext(path)[-1].lower()
if ext.lower() in VID_EXTENSIONS:
return read_video_from_path(path, image_size=image_size)
else: