Shortcuts

SemanticSegmentation

class flash.image.segmentation.model.SemanticSegmentation(num_classes, backbone='resnet50', backbone_kwargs=None, head='fpn', head_kwargs=None, pretrained=True, loss_fn=None, optimizer=torch.optim.AdamW, optimizer_kwargs=None, scheduler=None, scheduler_kwargs=None, metrics=None, learning_rate=0.001, multi_label=False, serializer=None, postprocess=None)[source]

SemanticSegmentation is a Task for semantic segmentation of images. For more details, see Semantic Segmentation.

Parameters
  • num_classes (int) – Number of classes to classify.

  • backbone (Union[str, Module]) – A string or model to use to compute image features.

  • backbone_kwargs (Optional[Dict]) – Additional arguments for the backbone configuration.

  • head (str) – A string or (model, num_features) tuple to use to compute image features.

  • head_kwargs (Optional[Dict]) – Additional arguments for the head configuration.

  • pretrained (Union[bool, str]) – Use a pretrained backbone.

  • loss_fn (Optional[Callable]) – Loss function for training.

  • optimizer (Type[Optimizer]) – Optimizer to use for training.

  • optimizer_kwargs (Optional[Dict[str, Any]]) – Additional kwargs to use when creating the optimizer (if not passed as an instance).

  • scheduler (Union[Type[LRScheduler], str, LRScheduler, None]) – The scheduler or scheduler class to use.

  • scheduler_kwargs (Optional[Dict[str, Any]]) – Additional kwargs to use when creating the scheduler (if not passed as an instance).

  • metrics (Union[Metric, Callable, Mapping, Sequence, None]) – Metrics to compute for training and evaluation. Can either be an metric from the torchmetrics package, a custom metric inherenting from torchmetrics.Metric, a callable function or a list/dict containing a combination of the aforementioned. In all cases, each metric needs to have the signature metric(preds,target) and return a single scalar tensor. Defaults to torchmetrics.IOU.

  • learning_rate (float) – Learning rate to use for training.

  • multi_label (bool) – Whether the targets are multi-label or not.

  • serializer (Union[Serializer, Mapping[str, Serializer], None]) – The Serializer to use when serializing prediction outputs.

Read the Docs v: latest
Versions
latest
stable
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0post1
Downloads
pdf
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.