| 12345678910111213141516171819202122232425262728 | import osimport torchdevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')  # sets device for model and PyTorch tensors# Model parametersimage_w = 112image_h = 112channel = 3emb_size = 512# Training parametersnum_workers = 1  # for data-loading; right now, only 1 works with h5pygrad_clip = 5.  # clip gradients at an absolute value ofprint_freq = 100  # print training/validation stats  every __ batchescheckpoint = None  # path to checkpoint, None if none# Data parametersnum_classes = 93431num_samples = 5179510DATA_DIR = 'data'# faces_ms1m_folder = 'data/faces_ms1m_112x112'faces_ms1m_folder = 'data/ms1m-retinaface-t1'path_imgidx = os.path.join(faces_ms1m_folder, 'train.idx')path_imgrec = os.path.join(faces_ms1m_folder, 'train.rec')IMG_DIR = 'data/images'pickle_file = 'data/faces_ms1m_112x112.pickle'
 |