args.machine = os.uname()[1] save_dic_to_json(args.__dict__, json_fn) start_epoch = 0 train_img_shape = tuple([int(x) for x in args.train_img_shape]) img_transform_list = [ Scale(train_img_shape, Image.BILINEAR), ToTensor(), # Normalize([.485, .456, .406], [.229, .224, .225]) ] if args.augment: aug_list = [ RandomRotation(), # RandomVerticalFlip(), # non-realistic RandomHorizontalFlip(), RandomSizedCrop() ] img_transform_list = aug_list + img_transform_list img_transform = Compose(img_transform_list) label_transform = Compose([ Scale(train_img_shape, Image.NEAREST), ToLabel(), ReLabel(255, args.n_class - 1), ]) src_dataset = get_dataset(dataset_name=args.src_dataset,
# Save param dic if resume_flg: json_fn = os.path.join(args.outdir, "param-%s_resume.json" % model_name) else: json_fn = os.path.join(outdir, "param-%s.json" % model_name) check_if_done(json_fn) save_dic_to_json(args.__dict__, json_fn) train_img_shape = tuple([int(x) for x in args.train_img_shape]) img_transform_list = [ Scale(train_img_shape, Image.BILINEAR), ToTensor(), Normalize([.485, .456, .406], [.229, .224, .225]) ] if args.augment: aug_list = [RandomRotation(), RandomHorizontalFlip(), RandomSizedCrop()] img_transform_list = aug_list + img_transform_list img_transform = Compose(img_transform_list) label_transform = Compose([ Scale(train_img_shape, Image.NEAREST), ToLabel(), ReLabel(255, args.n_class - 1), # Last Class is "Void" or "Background" class ]) src_dataset = get_dataset(dataset_name=args.src_dataset, split=args.src_split, img_transform=img_transform, label_transform=label_transform,