AlexBlck commited on
Commit
66f74a6
1 Parent(s): 01f93ad
Files changed (1) hide show
  1. ANAKIN.py +6 -2
ANAKIN.py CHANGED
@@ -129,7 +129,9 @@ class Anakin(datasets.GeneratorBasedBuilder):
129
  data_dir = dl_manager.download(data_urls)
130
  # data_dir = dl_manager.iter_files(data_dir)
131
  mask_dir = {
132
- idx: dl_manager.download_and_extract(root_url + f"masks/{idx}.zip")
 
 
133
  for idx in ids
134
  }
135
 
@@ -167,7 +169,9 @@ class Anakin(datasets.GeneratorBasedBuilder):
167
  for key, sample in enumerate(files):
168
  idx = sample["trimmed"].split("/")[-1].split(".")[0]
169
  if df[df["video-id"] == idx]["has-masks"].values[0]:
170
- sample["masks"] = [m for m in masks[idx]]
 
 
171
  print(os.listdir(masks[idx]))
172
  else:
173
  sample["masks"] = None
 
129
  data_dir = dl_manager.download(data_urls)
130
  # data_dir = dl_manager.iter_files(data_dir)
131
  mask_dir = {
132
+ idx: dl_manager.iter_archive(
133
+ dl_manager.download(root_url + f"masks/{idx}.zip")
134
+ )
135
  for idx in ids
136
  }
137
 
 
169
  for key, sample in enumerate(files):
170
  idx = sample["trimmed"].split("/")[-1].split(".")[0]
171
  if df[df["video-id"] == idx]["has-masks"].values[0]:
172
+ sample["masks"] = [
173
+ {"path": p, "bytes": im.read()} for p, im in masks[idx]
174
+ ]
175
  print(os.listdir(masks[idx]))
176
  else:
177
  sample["masks"] = None