Datasets:
Update dataset_setup.py
Browse files- dataset_setup.py +3 -2
dataset_setup.py
CHANGED
|
@@ -12,17 +12,18 @@ def extract_video_tasks():
|
|
| 12 |
bundles = [os.path.join(root, x) for x in bundles]
|
| 13 |
if len(bundles) > 1:
|
| 14 |
cat = subprocess.Popen(['cat'] + bundles, stdout=subprocess.PIPE)
|
|
|
|
|
|
|
| 15 |
cmd = ['tar', '-xzf', '-', '-C', output_dir]
|
| 16 |
tar = subprocess.Popen(cmd, stdin=cat.stdout)
|
| 17 |
tar.wait()
|
| 18 |
-
cat.stdout.close()
|
| 19 |
else:
|
| 20 |
assert len(bundles) == 1, f'Unexpected size'
|
| 21 |
tar = subprocess.run(['tar', '-xzfv', bundles[0], '-C', output_dir])
|
| 22 |
print('Extracting video tasks completed!')
|
| 23 |
|
| 24 |
def extract_image_tasks():
|
| 25 |
-
root =
|
| 26 |
for task in ['mmeb_v1', 'visdoc']:
|
| 27 |
print(f'Extracting {task} task ... ...')
|
| 28 |
subprocess.run(['tar', '-xzf', os.path.join(root, f'{task}.tar.gz'), '-C', root])
|
|
|
|
| 12 |
bundles = [os.path.join(root, x) for x in bundles]
|
| 13 |
if len(bundles) > 1:
|
| 14 |
cat = subprocess.Popen(['cat'] + bundles, stdout=subprocess.PIPE)
|
| 15 |
+
cat.wait()
|
| 16 |
+
cat.stdout.close()
|
| 17 |
cmd = ['tar', '-xzf', '-', '-C', output_dir]
|
| 18 |
tar = subprocess.Popen(cmd, stdin=cat.stdout)
|
| 19 |
tar.wait()
|
|
|
|
| 20 |
else:
|
| 21 |
assert len(bundles) == 1, f'Unexpected size'
|
| 22 |
tar = subprocess.run(['tar', '-xzfv', bundles[0], '-C', output_dir])
|
| 23 |
print('Extracting 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 |
subprocess.run(['tar', '-xzf', os.path.join(root, f'{task}.tar.gz'), '-C', root])
|