construct_crossimage.py 540 B

123456789101112131415161718192021
  1. import json
  2. import numpy as np
  3. import nltk
  4. import argparse
  5. import os
  6. import pandas as pd
  7. from ipdb import set_trace
  8. def construct(args):
  9. metafile = pd.read_csv(args.metafile, sep='\t')
  10. if __name__ == '__main__':
  11. '''
  12. Given the metafile, we construct the
  13. Simply run: python construct_crossimage.py
  14. '''
  15. parser = argparse.ArgumentParser()
  16. parser.add_argument('--metafile', type=str, default='/mnt/petrelfs/xujilan/data/cc12m_100/cc12m_filtered_subset.tsv')
  17. args = parser.parse_args()
  18. construct(args)