Skip to content

Commit 83bff18

Browse files
authored
[Bugfix] Allow custom visualizer (open-mmlab#3455)
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. ## Motivation Current Visualization Hook can only get instances of `SegLocalVisualizer`. This makes impossible to use any other custom implementation. ## Modification This PR just allows to instantiate a different visualizer (following mmdetection implementation): https://github.com/open-mmlab/mmdetection/blob/main/mmdet/engine/hooks/visualization_hook.py#L58
1 parent e51f511 commit 83bff18

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mmseg/engine/hooks/visualization_hook.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
import mmengine.fileio as fileio
88
from mmengine.hooks import Hook
99
from mmengine.runner import Runner
10+
from mmengine.visualization import Visualizer
1011

1112
from mmseg.registry import HOOKS
1213
from mmseg.structures import SegDataSample
13-
from mmseg.visualization import SegLocalVisualizer
1414

1515

1616
@HOOKS.register_module()
@@ -42,8 +42,7 @@ def __init__(self,
4242
show: bool = False,
4343
wait_time: float = 0.,
4444
backend_args: Optional[dict] = None):
45-
self._visualizer: SegLocalVisualizer = \
46-
SegLocalVisualizer.get_current_instance()
45+
self._visualizer: Visualizer = Visualizer.get_current_instance()
4746
self.interval = interval
4847
self.show = show
4948
if self.show:

0 commit comments

Comments
 (0)