def model_generator(params): """Model function generator.""" if params.type == 'retinanet': model_fn = retinanet_model.RetinanetModel(params) else: raise ValueError('Model %s is not supported.'% params.type) return model_fn
def model_generator(params): """Model function generator.""" if params.type == 'retinanet': model_fn = retinanet_model.RetinanetModel(params) elif params.type == 'shapemask': model_fn = shapemask_model.ShapeMaskModel(params) elif params.type == 'mask_rcnn': model_fn = maskrcnn_model.MaskrcnnModel(params) else: raise ValueError('Model %s is not supported.' % params.type) return model_fn
def model_generator(params): """Model function generator.""" if params.type == 'classification': model_fn = classification_model.ClassificationModel(params) elif params.type == 'retinanet': model_fn = retinanet_model.RetinanetModel(params) elif params.type == 'mask_rcnn': model_fn = maskrcnn_model.MaskrcnnModel(params) elif params.type == 'cascade_mask_rcnn': model_fn = cascade_maskrcnn_model.CascadeMaskrcnnModel(params) elif params.type == 'shapemask': model_fn = shapemask_model.ShapeMaskModel(params) elif params.type == 'segmentation': model_fn = segmentation_model.SegmentationModel(params) elif params.type == 'vild': model_fn = vild_model.ViLDModel(params) else: raise ValueError('Model %s is not supported.' % params.type) return model_fn