take off split name
Browse files94 unmodified lines95969798991001011021031041051061071081091101111121131 unmodified line11511611711811912012194 unmodified linesreturn [datasets.SplitGenerator(name=datasets.Split.TRAIN,gen_kwargs={"files_paths": [files_path[self.config.name]["train"]], "images_paths": [train_img_path], "split_name": "train"},),datasets.SplitGenerator(name=datasets.Split.VALIDATION,gen_kwargs={"files_paths": [files_path[self.config.name]["validation"]], "images_paths": [validation_img_path], "split_name": "dev"},),datasets.SplitGenerator(name=datasets.Split.TEST,gen_kwargs={"files_paths": [files_path[self.config.name]["test1"], files_path[self.config.name]["test2"]], "images_paths": [test1_img_path, test2_img_path], "split_name": "test"},),]def _generate_examples(self, files_paths, images_paths, split_name):idx = 0for i, files_path in enumerate(files_paths):for line in open(files_path).readlines():1 unmodified linecommon_img_identifier = ex["identifier"].split("-")left_img_identifier = f"{common_img_identifier[0]}-{common_img_identifier[1]}-{common_img_identifier[2]}-img0.png"right_img_identifier = f"{common_img_identifier[0]}-{common_img_identifier[1]}-{common_img_identifier[2]}-img1.png"if split_name == "train":directory = str(ex["directory"])left_image_path = str(os.path.join(images_paths[i], directory, left_img_identifier))right_image_path = str(os.path.join(images_paths[i], directory, right_img_identifier))94 unmodified lines95969798991001011021031041051061071081091101111121131 unmodified line11511611711811912012194 unmodified linesreturn [datasets.SplitGenerator(name=datasets.Split.TRAIN,gen_kwargs={"files_paths": [files_path[self.config.name]["train"]], "images_paths": [train_img_path]},),datasets.SplitGenerator(name=datasets.Split.VALIDATION,gen_kwargs={"files_paths": [files_path[self.config.name]["validation"]], "images_paths": [validation_img_path]},),datasets.SplitGenerator(name=datasets.Split.TEST,gen_kwargs={"files_paths": [files_path[self.config.name]["test1"], files_path[self.config.name]["test2"]], "images_paths": [test1_img_path, test2_img_path]},),]def _generate_examples(self, files_paths, images_paths):idx = 0for i, files_path in enumerate(files_paths):for line in open(files_path).readlines():1 unmodified linecommon_img_identifier = ex["identifier"].split("-")left_img_identifier = f"{common_img_identifier[0]}-{common_img_identifier[1]}-{common_img_identifier[2]}-img0.png"right_img_identifier = f"{common_img_identifier[0]}-{common_img_identifier[1]}-{common_img_identifier[2]}-img1.png"if common_img_identifier[0] == "train":directory = str(ex["directory"])left_image_path = str(os.path.join(images_paths[i], directory, left_img_identifier))right_image_path = str(os.path.join(images_paths[i], directory, right_img_identifier))
NLVR2.py+5-5