def main(): args = parse_args() data_dir = 'data/GTA/' out_dir = 'data/GTA/anns/' print('Convert GTA Tracking dataset to COCO style.') if not osp.isfile(out_dir): os.makedirs(out_dir, exist_ok=True) if args.set == 'all': for set_name in data_set_dict: print(osp.join(data_dir, set_name)) ann = convert_track(data_dir, set_name) bu.dump_json(osp.join(out_dir, f'tracking_{set_name}.json'), ann) else: print(osp.join(data_dir, args.set)) ann = convert_track(data_dir, args.set) bu.dump_json(osp.join(out_dir, f'tracking_{args.set}.json'), ann)
def main(): data_dir = 'data/nuscenes' out_dir = 'data/nuscenes/anns' print('Convert Nuscenes Tracking dataset to COCO style.') if not osp.isfile(out_dir): os.makedirs(out_dir, exist_ok=True) print("tracking mini") train_anns, val_anns = convert_track(data_dir, version='v1.0-mini') dump_json(osp.join(out_dir, 'tracking_train_mini.json'), train_anns) dump_json(osp.join(out_dir, 'tracking_val_mini.json'), val_anns) print("tracking trainval") train_anns, val_anns = convert_track(data_dir, version='v1.0-trainval') dump_json(osp.join(out_dir, 'tracking_train.json'), train_anns) dump_json(osp.join(out_dir, 'tracking_val.json'), val_anns) print('tracking test') anns = convert_track(data_dir, version='v1.0-test') dump_json(osp.join(out_dir, 'tracking_test.json'), anns)
def main(): data_dir = 'data/Waymo' out_dir = 'data/Waymo/anns' print('Convert Waymo Tracking dataset to COCO style.') if not osp.isfile(out_dir): os.makedirs(out_dir, exist_ok=True) print("tracking mini") coco_json = convert_track(data_dir, "validation", mini=True) bu.dump_json(osp.join(out_dir, 'tracking_val_mini.json'), coco_json) print("tracking train") coco_json = convert_track(data_dir, "training") bu.dump_json(osp.join(out_dir, 'tracking_train.json'), coco_json) print("tracking validation") coco_json = convert_track(data_dir, "validation") bu.dump_json(osp.join(out_dir, 'tracking_val.json'), coco_json) print("tracking testing") coco_json = convert_track(data_dir, "testing") bu.dump_json(osp.join(out_dir, 'tracking_test.json'), coco_json)
def main(): data_dir = 'data/KITTI/' out_dir = 'data/KITTI/anns' print('Convert KITTI Tracking dataset to COCO style.') if not osp.isfile(out_dir): os.makedirs(out_dir, exist_ok=True) print('tracking validate subset') track_dir = osp.join(data_dir, 'tracking', 'training') ann = convert_track(track_dir, mode='mini') bu.dump_json(osp.join(out_dir, 'tracking_subval_mini.json'), ann) print('tracking validate subset') track_dir = osp.join(data_dir, 'tracking', 'training') ann = convert_track(track_dir, mode='val') bu.dump_json(osp.join(out_dir, 'tracking_subval.json'), ann) print("tracking train") track_dir = osp.join(data_dir, 'tracking', 'training') ann = convert_track(track_dir, mode=None) bu.dump_json(osp.join(out_dir, 'tracking_train.json'), ann) print("tracking train subset") track_dir = osp.join(data_dir, 'tracking', 'training') ann = convert_track(track_dir, mode='train') bu.dump_json(osp.join(out_dir, 'tracking_subtrain.json'), ann) print('tracking test') track_dir = osp.join(data_dir, 'tracking', 'testing') ann = convert_track('tracking/testing', mode=None) bu.dump_json(osp.join(out_dir, 'tracking_test.json'), ann) print('detection train') detect_dir = osp.join(data_dir, 'detection', 'training') ann = convert_det(detect_dir, mode=None) bu.dump_json(osp.join(out_dir, 'detection_train.json'), ann) print('detection train subset') detect_dir = osp.join(data_dir, 'detection', 'training') ann = convert_det(detect_dir, mode='train') bu.dump_json(osp.join(out_dir, 'detection_subtrain.json'), ann) print('detection validate subset') detect_dir = osp.join(data_dir, 'detection', 'training') ann = convert_det(detect_dir, mode='val') bu.dump_json(osp.join(out_dir, 'detection_subval.json'), ann) print('detection test') detect_dir = osp.join(data_dir, 'detection', 'testing') ann = convert_det(detect_dir, mode=None) bu.dump_json(osp.join(out_dir, 'detection_test.json'), ann)