def main():
    args = vars(argument_parser())
    with open(args['properties']) as f:
        properties_str = json.load(f)
        properties_str = json.dumps(
            properties_str) if properties_str is not None else None

    engine = ObjectDetector(properties_str=properties_str,
                            inference=build_engine(args['capsule']))

    engine.run()
    return 0
def main():
    args = vars(argument_parser())
    with open(args['properties']) as f:
        properties_str = json.load(f)
        properties_str = json.dumps(
            properties_str) if properties_str is not None else None

    if args['is_detector']:
        engine = ObjectDetector(properties_str=properties_str,
                                inference=build_detection_engine(
                                    args['model'], args['label']))
    else:
        engine = FrameClassifier(properties_str=properties_str,
                                 inference=build_classification_engine(
                                     args['model'], args['label']))

    engine.run()
    return 0
def main():
    args = vars(argument_parser())
    with open(args['properties']) as f:
        properties_str = json.load(f)
        properties_str = json.dumps(
            properties_str) if properties_str is not None else None

    model = detectron2_models.get(args['model'], None)
    if model is None:
        log.error(
            f"Unrecognied model {args['model']}. Should be one of \n{detectron2_models.keys()}"
        )
        return 1

    engine = ObjectDetector(properties_str=properties_str,
                            inference=build_engine(model))
    engine.run()
    return 0
Beispiel #4
0
def main():
    args = vars(argument_parser())
    with open(args['properties']) as f:
        properties_str = json.load(f)
        properties_str = json.dumps(
            properties_str) if properties_str is not None else None

    tv_model = tv_models[args['model']]

    if tv_model.type == 'detection':
        engine = ObjectDetector(properties_str=properties_str,
                                inference=build_detection_engine(
                                    tv_model.model, args['label']))
    elif tv_model.type == 'classification':
        engine = FrameClassifier(properties_str=properties_str,
                                 inference=build_classification_engine(
                                     tv_model.model, args['label']))
    else:
        log.error('Unrecognized model type.')
        return 1

    engine.run()
    return 0