XingjianL commited on
Commit
e3e0292
1 Parent(s): fed1122
Files changed (1) hide show
  1. tomatotest.py +7 -4
tomatotest.py CHANGED
@@ -57,9 +57,12 @@ class RGBSemanticDepthDataset(GeneratorBasedBuilder):
57
  return Image.open(io.BytesIO(bytes_stream))
58
 
59
  def _split_generators(self, dl_manager):
60
- print(self.config.dataset_type)
61
- archives = dl_manager.download({"train":["data/images_1730238419.175364.tar"],
62
- "val":["data/images_1730238419.175364.tar"]})
 
 
 
63
  split_metadata = dl_manager.download(_metadata_urls)
64
  return [
65
  SplitGenerator(
@@ -101,5 +104,5 @@ class RGBSemanticDepthDataset(GeneratorBasedBuilder):
101
  def _get_dataset_filenames(self):
102
  fs = HfFileSystem()
103
  all_files = fs.ls("datasets/xingjianli/tomatotest/data")
104
- filenames = ['/'.join(f['name'].split('/')[-2:]) for f in all_files]
105
  return filenames
 
57
  return Image.open(io.BytesIO(bytes_stream))
58
 
59
  def _split_generators(self, dl_manager):
60
+ if 'full' == self.config.dataset_type:
61
+ archives = dl_manager.download({"train":self._get_dataset_filenames(),
62
+ "val":self._get_dataset_filenames()})
63
+ else:
64
+ archives = dl_manager.download({"train":self._get_dataset_filenames()[0],
65
+ "val":self._get_dataset_filenames()[0]})
66
  split_metadata = dl_manager.download(_metadata_urls)
67
  return [
68
  SplitGenerator(
 
104
  def _get_dataset_filenames(self):
105
  fs = HfFileSystem()
106
  all_files = fs.ls("datasets/xingjianli/tomatotest/data")
107
+ filenames = sorted(['/'.join(f['name'].split('/')[-2:]) for f in all_files])
108
  return filenames