<filename>cocojson/run/map_cat.py<gh_stars>0
import argparse

from cocojson.tools import map_cat_from_files

def main():
    ap = argparse.ArgumentParser()
    ap.add_argument('json', help='Path to coco json')
    ap.add_argument('new_json', help='Path to new categories json')
    ap.add_argument('map_json', help='Path to mapping json')
    ap.add_argument('--out', help='Output json path', type=str)
    ap.add_argument('--keep-old', help='Flag to keep old categories not mentioned in mapping', action='store_true')
    args = ap.parse_args()

    map_cat_from_files(args.json, args.new_json, args.map_json, out_json=args.out, keep_old=args.keep_old)

if __name__ == '__main__':
    main()
<filename>cocojson/run/map_cat.py<gh_stars>0
import argparse

from cocojson.tools import map_cat_from_files

def main():
    ap = argparse.ArgumentParser()
    ap.add_argument('json', help='Path to coco json')
    ap.add_argument('new_json', help='Path to new categories json')
    ap.add_argument('map_json', help='Path to mapping json')
    ap.add_argument('--out', help='Output json path', type=str)
    ap.add_argument('--keep-old', help='Flag to keep old categories not mentioned in mapping', action='store_true')
    args = ap.parse_args()

    map_cat_from_files(args.json, args.new_json, args.map_json, out_json=args.out, keep_old=args.keep_old)

if __name__ == '__main__':
    main()