|
|
@ -9,8 +9,6 @@ from torch.utils.data import Dataset, DataLoader
|
|
|
|
from torch.utils.data.distributed import DistributedSampler
|
|
|
|
from torch.utils.data.distributed import DistributedSampler
|
|
|
|
from pathlib import Path
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
sys.path.insert(0, "../") # run under the project directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
image_extensions = ['.jpg', '.png']
|
|
|
|
image_extensions = ['.jpg', '.png']
|
|
|
|
def load_images_cached(images_dir_path):
|
|
|
|
def load_images_cached(images_dir_path):
|
|
|
|
image_paths = sorted([f for f in Path(images_dir_path).glob("*") if f.suffix.lower() in image_extensions])
|
|
|
|
image_paths = sorted([f for f in Path(images_dir_path).glob("*") if f.suffix.lower() in image_extensions])
|
|
|
|