This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
def set_nested_dict_value(d, keys, value): | |
d_next = d | |
for key in keys: | |
if '_dirs' not in d_next: | |
d_next['_dirs'] = dict() | |
if key not in d_next['_dirs']: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import torch | |
from torchvision.datasets import ImageFolder | |
from torchvision.transforms import ToTensor, PILToTensor | |
from tqdm import tqdm | |
def main(data_path, save_name, out_dir='./', is_to01=False): |