Shortcuts

AimVisBackend

class mmengine.visualization.AimVisBackend(save_dir=None, init_kwargs=None)[source]

Aim visualization backend class.

Examples

>>> from mmengine.visualization import AimVisBackend
>>> import numpy as np
>>> aim_vis_backend = AimVisBackend()
>>> img=np.random.randint(0, 256, size=(10, 10, 3))
>>> aim_vis_backend.add_image('img', img)
>>> aim_vis_backend.add_scalar('mAP', 0.6)
>>> aim_vis_backend.add_scalars({'loss': 0.1, 'acc': 0.8})
>>> cfg = Config(dict(a=1, b=dict(b1=[0, 1])))
>>> aim_vis_backend.add_config(cfg)

Note

  1. New in version 0.9.0.

  2. Refer to Github issue , Aim is not unable to be install on Windows for now.

Parameters:
  • save_dir (str, optional) – The root directory to save the files produced by the visualizer.

  • init_kwargs (dict, optional) – Aim initialization parameters. See Aim for details. Defaults to None.

add_config(config, **kwargs)[source]

Record the config to Aim.

Parameters:

config (Config) – The Config object

Return type:

None

add_image(name, image, step=0, **kwargs)[source]

Record the image.

Parameters:
  • name (str) – The image identifier.

  • image (np.ndarray) – The image to be saved. The format should be RGB. Defaults to None.

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

Return type:

None

add_scalar(name, value, step=0, **kwargs)[source]

Record the scalar data to Aim.

Parameters:
  • name (str) – The scalar identifier.

  • value (int, float, torch.Tensor, np.ndarray) – Value to save.

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

Return type:

None

add_scalars(scalar_dict, step=0, file_path=None, **kwargs)[source]

Record the scalar’s data to wandb.

Parameters:
  • scalar_dict (dict) – Key-value pair storing the tag and corresponding values.

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

  • file_path (str, optional) – Useless parameter. Just for interface unification. Defaults to None.

Return type:

None

close()[source]

Close the Aim.

Return type:

None

property experiment

Return Aim object.