minor change
parent
d54f80c649
commit
761e1a9983
|
@ -7,7 +7,7 @@ from .custom import CustomDataset
|
||||||
class ISPRSDataset(CustomDataset):
|
class ISPRSDataset(CustomDataset):
|
||||||
"""ISPRS dataset.
|
"""ISPRS dataset.
|
||||||
|
|
||||||
In segmentation map annotation for LoveDA, 0 is the ignore index.
|
In segmentation map annotation for ISPRS, 0 is the ignore index.
|
||||||
``reduce_zero_label`` should be set to True. The ``img_suffix`` and
|
``reduce_zero_label`` should be set to True. The ``img_suffix`` and
|
||||||
``seg_map_suffix`` are both fixed to '.png'.
|
``seg_map_suffix`` are both fixed to '.png'.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -129,7 +129,7 @@ class IoUMetric(BaseMetric):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def intersect_and_union(pred_label: torch.tensor, label: torch.tensor,
|
def intersect_and_union(pred_label: torch.tensor, label: torch.tensor,
|
||||||
num_classes: int, ignore_index: int):
|
num_classes: int, ignore_index: int):
|
||||||
"""Calculate intersection and Union.
|
"""Calculate Intersection and Union.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
pred_label (torch.tensor): Prediction segmentation map
|
pred_label (torch.tensor): Prediction segmentation map
|
||||||
|
@ -175,22 +175,22 @@ class IoUMetric(BaseMetric):
|
||||||
beta: int = 1):
|
beta: int = 1):
|
||||||
"""Calculate evaluation metrics
|
"""Calculate evaluation metrics
|
||||||
Args:
|
Args:
|
||||||
total_area_intersect (ndarray): The intersection of prediction and
|
total_area_intersect (np.ndarray): The intersection of prediction
|
||||||
ground truth histogram on all classes.
|
and ground truth histogram on all classes.
|
||||||
total_area_union (ndarray): The union of prediction and ground
|
total_area_union (np.ndarray): The union of prediction and ground
|
||||||
truth histogram on all classes.
|
truth histogram on all classes.
|
||||||
total_area_pred_label (ndarray): The prediction histogram on all
|
total_area_pred_label (np.ndarray): The prediction histogram on
|
||||||
classes.
|
|
||||||
total_area_label (ndarray): The ground truth histogram on
|
|
||||||
all classes.
|
all classes.
|
||||||
metrics (list[str] | str): Metrics to be evaluated, 'mIoU' and
|
total_area_label (np.ndarray): The ground truth histogram on
|
||||||
|
all classes.
|
||||||
|
metrics (List[str] | str): Metrics to be evaluated, 'mIoU' and
|
||||||
'mDice'.
|
'mDice'.
|
||||||
nan_to_num (int, optional): If specified, NaN values will be
|
nan_to_num (int, optional): If specified, NaN values will be
|
||||||
replaced by the numbers defined by the user. Default: None.
|
replaced by the numbers defined by the user. Default: None.
|
||||||
beta (int): Determines the weight of recall in the combined score.
|
beta (int): Determines the weight of recall in the combined score.
|
||||||
Default: 1.
|
Default: 1.
|
||||||
Returns:
|
Returns:
|
||||||
Dict[str, ndarray]: per category evaluation metrics,
|
Dict[str, np.ndarray]: per category evaluation metrics,
|
||||||
shape (num_classes, ).
|
shape (num_classes, ).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class EncoderDecoder(BaseSegmentor):
|
||||||
whole_inference()/slide_inference(): encoder_decoder()
|
whole_inference()/slide_inference(): encoder_decoder()
|
||||||
encoder_decoder(): extract_feat() -> decode_head.predict()
|
encoder_decoder(): extract_feat() -> decode_head.predict()
|
||||||
|
|
||||||
4 The ``_forward`` method is used to output the tensor by running the model,
|
3. The ``_forward`` method is used to output the tensor by running the model,
|
||||||
which includes two steps: (1) Extracts features to obtain the feature maps
|
which includes two steps: (1) Extracts features to obtain the feature maps
|
||||||
(2)Call the decode head forward function to forward decode head model.
|
(2)Call the decode head forward function to forward decode head model.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue