hello.mmlab.mmseg module

hello.mmlab.mmseg.draw_sem_seg(sem_seg, classes, palette)[source]
hello.mmlab.mmseg.func(root, config_file, checkpoint_file, cfg_options, testdata, out_dir, add_zero_label=False)[source]

Inference test data.

Parameters:
  • root (_type_) – _description_

  • config_file (_type_) – _description_

  • checkpoint_file (_type_) – _description_

  • cfg_options (_type_) – _description_

  • testdata (_type_) – _description_

  • out_dir (_type_) – _description_

  • add_zero_label (bool, optional) – Defaults to False.

hello.mmlab.mmseg.main(args=None)[source]
hello.mmlab.mmseg.parse_args(args=None)[source]
hello.mmlab.mmseg.tensor2ndarray(value)[source]
hello.mmlab.mmseg.test_image(model, classes, palette, img, out_name, out_dir, add_zero_label=False)[source]

Inference image.

Parameters:
  • model (nn.Module) – The loaded segmentor.

  • img (str/ndarray) – Image file or loaded image.

  • out_name (str) – The file name to save.

  • out_dir (pathlib.Path) – The directory to save.

  • add_zero_label (bool, optional) – Defaults to False.

hello.mmlab.mmseg.test_images(model, image_paths, out_dir, add_zero_label=False)[source]

Inference images.

Parameters:
  • model (nn.Module) – The loaded segmentor.

  • image_paths (list[str]) – Image files to inference.

  • out_dir (pathlib.Path) – The directory to save.

  • add_zero_label (bool, optional) – Defaults to False.

hello.mmlab.mmseg.test_videos(model, video_paths, out_dir, add_zero_label=False)[source]

Inference videos.

Parameters:
  • model (nn.Module) – The loaded segmentor.

  • video_paths (list[str]) – Video files to inference.

  • out_dir (pathlib.Path) – The directory to save.

  • add_zero_label (bool, optional) – Defaults to False.