Skip to content
Snippets Groups Projects
Unverified Commit 1388b4ec authored by David de la Iglesia Castro's avatar David de la Iglesia Castro Committed by GitHub
Browse files

[Refactor]: Add deprecate warnings of LoadImage (#4813)

* Remove LoadImage

* Add deprecation warning
parent 263ae90c
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,10 @@ def init_detector(config, checkpoint=None, device='cuda:0', cfg_options=None): ...@@ -54,7 +54,10 @@ def init_detector(config, checkpoint=None, device='cuda:0', cfg_options=None):
class LoadImage(object): class LoadImage(object):
"""A simple pipeline to load image.""" """Deprecated.
A simple pipeline to load image.
"""
def __call__(self, results): def __call__(self, results):
"""Call function to load images into results. """Call function to load images into results.
...@@ -62,10 +65,13 @@ class LoadImage(object): ...@@ -62,10 +65,13 @@ class LoadImage(object):
Args: Args:
results (dict): A result dict contains the file name results (dict): A result dict contains the file name
of the image to be read. of the image to be read.
Returns: Returns:
dict: ``results`` will be returned containing loaded image. dict: ``results`` will be returned containing loaded image.
""" """
warnings.simplefilter('once')
warnings.warn('`LoadImage` is deprecated and will be removed in '
'future releases. You may use `LoadImageFromWebcam` '
'from `mmdet.datasets.pipelines.` instead.')
if isinstance(results['img'], str): if isinstance(results['img'], str):
results['filename'] = results['img'] results['filename'] = results['img']
results['ori_filename'] = results['img'] results['ori_filename'] = results['img']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment