Example #1
0
def get_model(model_name, task):
    if task == "seg":
        try:
            return {
                "fcn": fcn_seg(n_classes=19),
                "frrnA": frrn_seg(model_type="A", n_classes=19),
                "segnet": segnet_seg(n_classes=19),
                "deeplab": deeplab_seg(n_classes=19),
                "dispnet": dispnet_seg(n_classes=19),
                "fcrn": fcrn_seg(n_classes=19),
            }[model_name]
        except:
            raise ("Model {} not available".format(model_name))
    elif task == "depth":
        try:
            return {
                "fcn": fcn_depth(),
                "frrnA": frrn_depth(model_type="A"),
                "segnet": segnet_depth(),
                "deeplab": deeplab_depth(),
                "dispnet": dispnet_depth(),
                "fcrn": fcrn_depth(),
            }[model_name]
        except:
            raise ("Model {} not available".format(model_name))
def get_model(model_name):
    try:
        return {
            "fcn": fcn_depth(),
            "frrnA": frrn_depth(model_type="A"),
            "segnet": segnet_depth(),
            "deeplab": deeplab_depth(),
            "dispnet": dispnet_depth(),
            "fcrn": fcrn_depth(),
        }[model_name]
    except:
        raise ("Model {} not available".format(model_name))