Shortcuts

ConcatImageVisualizer

class mmedit.visualization.ConcatImageVisualizer(fn_key: str, img_keys: Sequence[str], pixel_range={}, bgr2rgb=False, name: str = 'visualizer', *args, **kwargs)[source]

Visualize multiple images by concatenation.

This visualizer will horizontally concatenate images belongs to different keys and vertically concatenate images belongs to different frames to visualize.

Image to be visualized can be:
  • torch.Tensor or np.array

  • Image sequences of shape (T, C, H, W)

  • Multi-channel image of shape (1/3, H, W)

  • Single-channel image of shape (C, H, W)

Parameters
  • fn_key (str) – key used to determine file name for saving image. Usually it is the path of some input image. If the value is dir/basename.ext, the name used for saving will be basename.

  • img_keys (str) – keys, values of which are images to visualize.

  • pixel_range (dict) – min and max pixel value used to denormalize images, note that only float array or tensor will be denormalized, uint8 arrays are assumed to be unnormalized.

  • bgr2rgb (bool) – whether to convert the image from BGR to RGB.

  • name (str) – name of visualizer. Default: ‘visualizer’.

  • **kwargs (*args and) – Other arguments are passed to Visualizer. # noqa

add_datasample(data_sample: mmedit.structures.edit_data_sample.EditDataSample, step=0) None[source]

Concatenate image and draw.

Parameters
  • input (torch.Tensor) – Single input tensor from data_batch.

  • data_sample (EditDataSample) – Single data_sample from data_batch.

  • output (EditDataSample) – Single prediction output by model.

  • step (int) – Global step value to record. Default: 0.

Read the Docs v: zyh/doc-notfound-extend
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.