hello.mmseg.infer module¶
pip install mmsegmentation
- hello.mmseg.infer.func(root, config_file, checkpoint_file, testdata, out_dir, add_zero_label=False)[source]¶
Inference test data.
- Parameters:
root (_type_) – _description_
config_file (_type_) – _description_
checkpoint_file (_type_) – _description_
testdata (_type_) – _description_
out_dir (_type_) – _description_
add_zero_label (bool, optional) – Defaults to False.
- hello.mmseg.infer.test_image(model, img, palette, out_dir, out_name, add_zero_label=False)[source]¶
Inference image.
- Parameters:
model (nn.Module) – The loaded segmentor.
img (str/ndarray) – Image file or loaded image.
palette (list[list[int]]) – The palette of segmentation map.
out_dir (pathlib.Path) – The directory to save.
out_name (str) – The file name to save.
add_zero_label (bool, optional) – Defaults to False.
- hello.mmseg.infer.test_images(model, image_paths, palette, out_dir, add_zero_label=False)[source]¶
Inference images.
- Parameters:
model (nn.Module) – The loaded segmentor.
image_paths (list[str]) – Image files to inference.
palette (list[list[int]]) – The palette of segmentation map.
out_dir (pathlib.Path) – The directory to save.
add_zero_label (bool, optional) – Defaults to False.
- hello.mmseg.infer.test_video(model, video_path, palette, out_dir, add_zero_label=False)[source]¶
Inference video.
- Parameters:
model (nn.Module) – The loaded segmentor.
video_path (str) – Video file to inference.
palette (list[list[int]]) – The palette of segmentation map.
out_dir (pathlib.Path) – The directory to save.
add_zero_label (bool, optional) – Defaults to False.
- hello.mmseg.infer.test_videos(model, video_paths, palette, out_dir, add_zero_label=False)[source]¶
Inference videos.
- Parameters:
model (nn.Module) – The loaded segmentor.
video_paths (list[str]) – Video files to inference.
palette (list[list[int]]) – The palette of segmentation map.
out_dir (pathlib.Path) – The directory to save.
add_zero_label (bool, optional) – Defaults to False.