Datasets:
Update dataset_setup.py
Browse files- dataset_setup.py +4 -7
dataset_setup.py
CHANGED
|
@@ -16,20 +16,17 @@ def extract_video_tasks():
|
|
| 16 |
tar = subprocess.Popen(cmd, stdin=cat.stdout)
|
| 17 |
cat_return_code = cat.wait()
|
| 18 |
tar_return_code = tar.wait()
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
if tar_return_code != 0:
|
| 22 |
-
raise RuntimeError('Error occured during extraction!')
|
| 23 |
else:
|
| 24 |
-
|
| 25 |
-
tar = subprocess.run(['tar', '-xzfv', bundles[0], '-C', output_dir])
|
| 26 |
print('All video tasks completed!')
|
| 27 |
|
| 28 |
def extract_image_tasks():
|
| 29 |
root = 'image_tasks'
|
| 30 |
for task in ['mmeb_v1', 'visdoc']:
|
| 31 |
print(f'Extracting {task} task ... ...')
|
| 32 |
-
subprocess.run(['tar', '-xzf', os.path.join(root, f'{task}.tar.gz'), '-C', root])
|
| 33 |
print('All image tasks completed!')
|
| 34 |
|
| 35 |
def main():
|
|
|
|
| 16 |
tar = subprocess.Popen(cmd, stdin=cat.stdout)
|
| 17 |
cat_return_code = cat.wait()
|
| 18 |
tar_return_code = tar.wait()
|
| 19 |
+
elif len(bundles) == 1:
|
| 20 |
+
tar = subprocess.run(['tar', '-xzf', bundles[0], '-C', output_dir])
|
|
|
|
|
|
|
| 21 |
else:
|
| 22 |
+
raise ValueError(f'Unexpected size: {len(bundles)}')
|
|
|
|
| 23 |
print('All video tasks completed!')
|
| 24 |
|
| 25 |
def extract_image_tasks():
|
| 26 |
root = 'image_tasks'
|
| 27 |
for task in ['mmeb_v1', 'visdoc']:
|
| 28 |
print(f'Extracting {task} task ... ...')
|
| 29 |
+
tar = subprocess.run(['tar', '-xzf', os.path.join(root, f'{task}.tar.gz'), '-C', root])
|
| 30 |
print('All image tasks completed!')
|
| 31 |
|
| 32 |
def main():
|