Datasets:

Modalities:
Image
Languages:
English
ArXiv:
Tags:
code
License:
eztao commited on
Commit
04846db
·
verified ·
1 Parent(s): 52293ac

modify RefRef.py for downloading

Browse files
Files changed (1) hide show
  1. RefRef.py +4 -5
RefRef.py CHANGED
@@ -72,14 +72,12 @@ class RefRef(datasets.GeneratorBasedBuilder):
72
  # Automatically find all JSON files matching the split patterns
73
  return [
74
  datasets.SplitGenerator(
75
- name=cat,
76
  gen_kwargs={
77
- "filepaths": os.path.join(f"https://huggingface.co/datasets/yinyue27/RefRef/resolve/main/image_data/{cat}/{self.config.name}/{self.config.scene}"),
78
  "filepaths": os.path.join(f"https://huggingface.co/datasets/yinyue27/RefRef/resolve/main/image_data/{cat}/{self.config.name}/",
79
  f"{self.config.scene}_sphere" if cat == "textured_sphere_scene" else self.config.scene),
80
- "split": cat
81
  },
82
- ) for cat in ["textured_sphere_scene", "textured_cube_scene"]
83
  ]
84
 
85
  def _generate_examples(self, filepaths, split):
@@ -89,7 +87,8 @@ class RefRef(datasets.GeneratorBasedBuilder):
89
  try:
90
  data = json.load(f)
91
  except json.JSONDecodeError:
92
- print("error")
 
93
 
94
  scene_name = os.path.basename(os.path.dirname(split_filepaths))
95
 
 
72
  # Automatically find all JSON files matching the split patterns
73
  return [
74
  datasets.SplitGenerator(
75
+ name=f"{'cubeBg' if cat == 'textured_cube_scene' else 'sphereBg' if cat == 'textured_sphere_scene' else 'envMapBg'}_{'singleMatConvex' if cat == 'single-convex' else 'singleMatNonConvex' if cat == 'single-non-convex' else 'multiMatNonConvex'}_{self.config.scene}",
76
  gen_kwargs={
 
77
  "filepaths": os.path.join(f"https://huggingface.co/datasets/yinyue27/RefRef/resolve/main/image_data/{cat}/{self.config.name}/",
78
  f"{self.config.scene}_sphere" if cat == "textured_sphere_scene" else self.config.scene),
 
79
  },
80
+ ) for cat in ["textured_sphere_scene", "textured_cube_scene", "environment_map_scene"]
81
  ]
82
 
83
  def _generate_examples(self, filepaths, split):
 
87
  try:
88
  data = json.load(f)
89
  except json.JSONDecodeError:
90
+ print("Error opening " + split_filepaths)
91
+ continue
92
 
93
  scene_name = os.path.basename(os.path.dirname(split_filepaths))
94