Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def dataset(config):
"""Reads and initializes a dataset specified by a passed configuration.
Args:
config: Configuration object.
Returns:
A dataset.
"""
if config['name'] in datasets:
return datasets[config['name']].create(config)
elif config['name'] == 'patchy_san':
return PatchySan.create(config)
else:
raise ValueError('Dataset not found.')
def dataset(config):
"""Reads and initializes a dataset specified by a passed configuration.
Args:
config: Configuration object.
Returns:
A dataset.
"""
if config['name'] in datasets:
return datasets[config['name']].create(config)
elif config['name'] == 'patchy_san':
return PatchySan.create(config)
else:
raise ValueError('Dataset not found.')
def dataset(config):
"""Reads and initializes a dataset specified by a passed configuration.
Args:
config: Configuration object.
Returns:
A dataset.
"""
if config['name'] in datasets:
return datasets[config['name']].create(config)
elif config['name'] == 'patchy_san':
return PatchySan.create(config)
else:
raise ValueError('Dataset not found.')
def main(argv=None):
pascal = PascalVOC()
grapher = SegmentationGrapher(
slic_generator(300), [adjacency_euclidean_distance])
patchy = PatchySan(pascal, grapher, distort_inputs=True, num_nodes=300,
write_num_epochs=10)