Skip to content

Commit

Permalink
updated base model adapter(more about doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mese79 committed Oct 12, 2024
1 parent 893a800 commit 790c121
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/featureforest/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(
self.device = device
# set patch size and overlap
self.patch_size = 512
self.overlap = 3 * self.patch_size // 4
self.overlap = self.patch_size // 2
# input image transforms
self.input_transforms = tv_transforms2.Compose([
tv_transforms2.Resize(
Expand All @@ -53,15 +53,16 @@ def __init__(
])

def _set_patch_size(self) -> None:
"""Sets the proper patch size and patch overlap with respect to the model
"""Sets the proper patch size and patch overlap
with respect to the model & image resolution.
"""
raise NotImplementedError

def get_features_patches(
self, in_patches: Tensor
) -> Tensor:
"""Returns a tensor of model's extracted features.
This function is more like an abstract function, and should be overridden.
"""Returns model's extracted features.
This is an abstract function, and should be overridden.
Args:
in_patches (Tensor): input patches
Expand All @@ -83,7 +84,7 @@ def get_features_patches(
return feature_patches

def get_total_output_channels(self) -> int:
"""Returns total number of model output channels (a.k.a. number of feature maps).
"""Returns total number of model output channels (number of feature maps).
Returns:
int: total number of output channels
Expand Down

0 comments on commit 790c121

Please sign in to comment.