예제 #1
0
파일: factory.py 프로젝트: zzm422/tpu
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
예제 #2
0
파일: factory.py 프로젝트: zysxjtu/tpu
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
예제 #3
0
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