def create_manifest(manifest_path, index_file, annot_dir, image_dir, root_dir):
 records = []
 with open(index_file) as f:
  for img in f:
   tag = img.rstrip(os.linesep)
   image = os.path.join(image_dir, (tag + '.jpg'))
   annot = os.path.join(annot_dir, (tag + '.json'))
   assert os.path.exists(image), 'Path {} not found'.format(image)
   assert os.path.exists(annot), 'Path {} not found'.format(annot)
   records.append((os.path.relpath(image, root_dir), os.path.relpath(annot, root_dir)))
 np.savetxt(manifest_path, records, fmt='%s,%s')

def create_manifest ( manifest_path , index_file , annot_dir , image_dir , root_dir ) : records = [ ] with open ( index_file ) as f : for img in f : tag = img . rstrip ( os . linesep ) image = os . path . join ( image_dir , ( tag + '.jpg' ) ) annot = os . path . join ( annot_dir , ( tag + '.json' ) ) assert os . path . exists ( image ) , 'Path {} not found' . format ( image ) assert os . path . exists ( annot ) , 'Path {} not found' . format ( annot ) records . append ( ( os . path . relpath ( image , root_dir ) , os . path . relpath ( annot , root_dir ) ) ) np . savetxt ( manifest_path , records , fmt = '%s,%s' )
based on a pascalvoc index file .