|
import warnings |
|
from torchvision.datasets import * |
|
from datasets.base import * |
|
from datasets.cityscapes import CitySegmentation |
|
|
|
|
|
datasets = { |
|
'citys': CitySegmentation, |
|
} |
|
|
|
def get_dataset(name, **kwargs): |
|
return datasets[name.lower()](**kwargs) |
|
|
|
def _make_deprecate(meth, old_name): |
|
new_name = meth.__name__ |
|
|
|
def deprecated_init(*args, **kwargs): |
|
return meth(*args, **kwargs) |
|
|
|
deprecated_init.__doc__ = r""" |
|
{old_name}(...) |
|
.. warning:: |
|
This method is now deprecated in favor of :func:`torch.nn.init.{new_name}`. |
|
See :func:`~torch.nn.init.{new_name}` for details.""".format( |
|
old_name=old_name, new_name=new_name) |
|
deprecated_init.__name__ = old_name |
|
return deprecated_init |
|
|
|
get_segmentation_dataset = _make_deprecate(get_dataset, 'get_segmentation_dataset') |
|
|