INNER CODE UNIT · Python
Winoground
linzhiqiu/t2v_metrics · dataset.py:230
class Winoground(Dataset):
def __init__(self,
image_preprocess=None,
root_dir='./',
return_image_paths=True):
self.root_dir = os.path.join(root_dir, "winoground")
if not os.path.exists(self.root_dir):
subprocess.call(
["gdown", "--no-cookies", "1Lril_90vjsbL_2qOaxMu3I-aPpckCDiF", "--output",
os.path.join(root_dir, "winoground.zip")]
)
subprocess.call(
["unzip", "-q", "winoground.zip"],
cwd=root_dir
)
csv_file = os.path.join(self.root_dir, 'metadata.csv')
self.metadata = pd.read_csv(csv_file).to_dict(orient='records')
json_file = os.path.join(self.root_dir, 'examples.jsonl')