Datasets:

Modalities:
Image
Languages:
English
ArXiv:
Tags:
code
License:
eztao commited on
Commit
e5a84b8
·
verified ·
1 Parent(s): a044009

Update RefRef.py

Browse files
Files changed (1) hide show
  1. RefRef.py +4 -4
RefRef.py CHANGED
@@ -73,17 +73,17 @@ class RefRef(datasets.GeneratorBasedBuilder):
73
 
74
  def _generate_examples(self, filepaths, split):
75
  for split in ["train", "val", "test"]:
76
- filepaths = os.path.join(filepaths, f"transforms_{split}.json")
77
- with open(filepaths, "r", encoding="utf-8") as f:
78
  try:
79
  data = json.load(f)
80
  except json.JSONDecodeError:
81
  print("error")
82
 
83
- scene_name = os.path.basename(os.path.dirname(filepaths))
84
 
85
  for frame_idx, frame in enumerate(data.get("frames", [])):
86
- base_dir = os.path.dirname(filepaths)
87
 
88
  yield f"{scene_name}_{frame_idx}", {
89
  "image": os.path.join(base_dir, frame["file_path"]+".png"),
 
73
 
74
  def _generate_examples(self, filepaths, split):
75
  for split in ["train", "val", "test"]:
76
+ split_filepaths = os.path.join(filepaths, f"transforms_{split}.json")
77
+ with open(split_filepaths, "r", encoding="utf-8") as f:
78
  try:
79
  data = json.load(f)
80
  except json.JSONDecodeError:
81
  print("error")
82
 
83
+ scene_name = os.path.basename(os.path.dirname(split_filepaths))
84
 
85
  for frame_idx, frame in enumerate(data.get("frames", [])):
86
+ base_dir = os.path.dirname(split_filepaths)
87
 
88
  yield f"{scene_name}_{frame_idx}", {
89
  "image": os.path.join(base_dir, frame["file_path"]+".png"),