Chengzu Li commited on
Commit
5156d02
·
verified ·
1 Parent(s): cfd89c9

Update topviewrs.py

Browse files
Files changed (1) hide show
  1. topviewrs.py +4 -2
topviewrs.py CHANGED
@@ -41,7 +41,7 @@ _URLS = {
41
  class TOPVIEWRSConfig(datasets.BuilderConfig):
42
  """BuilderConfig for TOPVIEWRS."""
43
 
44
- def __init__(self, task_split, map_type, **kwargs):
45
  """BuilderConfig for TOPVIEWRS.
46
  Args:
47
  **kwargs: keyword arguments forwarded to super.
@@ -49,6 +49,7 @@ class TOPVIEWRSConfig(datasets.BuilderConfig):
49
  super(TOPVIEWRSConfig, self).__init__(**kwargs)
50
  self.task_split = task_split
51
  self.map_type = map_type
 
52
 
53
 
54
  class TOPVIEWRS(datasets.GeneratorBasedBuilder):
@@ -62,6 +63,7 @@ class TOPVIEWRS(datasets.GeneratorBasedBuilder):
62
  description=_DESCRIPTION,
63
  task_split=None,
64
  map_type=None,
 
65
  )
66
  ]
67
 
@@ -110,7 +112,7 @@ class TOPVIEWRS(datasets.GeneratorBasedBuilder):
110
  for k, v in downloaded_files.items():
111
  if v.endswith("zip"):
112
  try:
113
- shutil.unpack_archive(v)
114
  except:
115
  raise FileNotFoundError(f"Unpacking the image data.zip failed. Make sure that you have the zip file at {v}. ")
116
 
 
41
  class TOPVIEWRSConfig(datasets.BuilderConfig):
42
  """BuilderConfig for TOPVIEWRS."""
43
 
44
+ def __init__(self, task_split, map_type, image_save_dir, **kwargs):
45
  """BuilderConfig for TOPVIEWRS.
46
  Args:
47
  **kwargs: keyword arguments forwarded to super.
 
49
  super(TOPVIEWRSConfig, self).__init__(**kwargs)
50
  self.task_split = task_split
51
  self.map_type = map_type
52
+ self.image_save_dir = image_save_dir
53
 
54
 
55
  class TOPVIEWRS(datasets.GeneratorBasedBuilder):
 
63
  description=_DESCRIPTION,
64
  task_split=None,
65
  map_type=None,
66
+ image_save_dir="."
67
  )
68
  ]
69
 
 
112
  for k, v in downloaded_files.items():
113
  if v.endswith("zip"):
114
  try:
115
+ shutil.unpack_archive(v, self.config.image_save_dir)
116
  except:
117
  raise FileNotFoundError(f"Unpacking the image data.zip failed. Make sure that you have the zip file at {v}. ")
118