"""Factory to provide model configs."""

from configs import retinanet_config
from configs import shapemask_config
from hyperparameters import params_dict


def config_generator(model):
  """Model function generator."""
  if model == 'retinanet':
    default_config = retinanet_config.RETINANET_CFG
    restrictions = retinanet_config.RETINANET_RESTRICTIONS
  elif model == 'shapemask':
    default_config = shapemask_config.SHAPEMASK_CFG
    restrictions = shapemask_config.SHAPEMASK_RESTRICTIONS
  else:
    raise ValueError('Model %s is not supported.' % model)

  return params_dict.ParamsDict(default_config, restrictions)

"""Factory to provide model configs."""

from configs import retinanet_config
from hyperparameters import params_dict


def config_generator(model):
  """Model function generator."""
  if model == 'retinanet':
    default_config = retinanet_config.RETINANET_CFG
    restrictions = retinanet_config.RETINANET_RESTRICTIONS
  elif model == 'shapemask':
    default_config = shapemask_config.SHAPEMASK_CFG
    restrictions = shapemask_config.SHAPEMASK_RESTRICTIONS
  else:
    raise ValueError('Model %s is not supported.' % model)

  return params_dict.ParamsDict(default_config, restrictions)

Fix shapemask_config import to handle copy.bara masking that allows cloud detection test to pass.
Fix shapemask_config import to handle copy.bara masking that allows cloud detection test to pass.

PiperOrigin-RevId: 267404830

  """Factory to provide model configs."""
  
  from configs import retinanet_config
- from configs import shapemask_config
  from hyperparameters import params_dict
  
  
  def config_generator(model):
    """Model function generator."""
    if model == 'retinanet':
      default_config = retinanet_config.RETINANET_CFG
      restrictions = retinanet_config.RETINANET_RESTRICTIONS
    elif model == 'shapemask':
      default_config = shapemask_config.SHAPEMASK_CFG
      restrictions = shapemask_config.SHAPEMASK_RESTRICTIONS
    else:
      raise ValueError('Model %s is not supported.' % model)
  
    return params_dict.ParamsDict(default_config, restrictions)
  
Fix shapemask_config import to handle copy.bara masking that allows cloud detection test to pass.
## Code Before:
"""Factory to provide model configs."""

from configs import retinanet_config
from configs import shapemask_config
from hyperparameters import params_dict


def config_generator(model):
  """Model function generator."""
  if model == 'retinanet':
    default_config = retinanet_config.RETINANET_CFG
    restrictions = retinanet_config.RETINANET_RESTRICTIONS
  elif model == 'shapemask':
    default_config = shapemask_config.SHAPEMASK_CFG
    restrictions = shapemask_config.SHAPEMASK_RESTRICTIONS
  else:
    raise ValueError('Model %s is not supported.' % model)

  return params_dict.ParamsDict(default_config, restrictions)

## Instruction:
Fix shapemask_config import to handle copy.bara masking that allows cloud detection test to pass.
## Code After:
"""Factory to provide model configs."""

from configs import retinanet_config
from hyperparameters import params_dict


def config_generator(model):
  """Model function generator."""
  if model == 'retinanet':
    default_config = retinanet_config.RETINANET_CFG
    restrictions = retinanet_config.RETINANET_RESTRICTIONS
  elif model == 'shapemask':
    default_config = shapemask_config.SHAPEMASK_CFG
    restrictions = shapemask_config.SHAPEMASK_RESTRICTIONS
  else:
    raise ValueError('Model %s is not supported.' % model)

  return params_dict.ParamsDict(default_config, restrictions)
