INNER CODE UNIT · Python
config
GeekAlexis/FastMOT · app.py:58
config = json.load(cfg_file, cls=ConfigDecoder, object_hook=lambda d: SimpleNamespace(**d))
# load labels if given
if args.labels is not None:
with open(args.labels) as label_file:
label_map = label_file.read().splitlines()
fastmot.models.set_label_map(label_map)
stream = fastmot.VideoIO(config.resize_to, args.input_uri, args.output_uri, **vars(config.stream_cfg))
mot = None
txt = None
if args.mot:
draw = args.show or args.output_uri is not None
mot = fastmot.MOT(config.resize_to, **vars(config.mot_cfg), draw=draw)
mot.reset(stream.cap_dt)
if args.txt is not None:
Path(args.txt).parent.mkdir(parents=True, exist_ok=True)