feat: The flag for removing boundary objects was added to the config

master
laynholt 2 days ago
parent e9a590a040
commit 6618c74ae3

@ -11,6 +11,7 @@ class DatasetCommonConfig(BaseModel):
device: str = "cuda:0" # Device used for training/testing (e.g., 'cpu' or 'cuda')
use_amp: bool = False # Flag to use Automatic Mixed Precision (AMP)
roi_size: int = 512 # The size of the square window for cropping
remove_boundary_objects: bool = True # Flag to remove boundary objects when testing
masks_subdir: str = "" # Subdirectory where the required masks are located, e.g. 'masks/cars'
predictions_dir: str = "." # Directory to save predictions
pretrained_weights: str = "" # Path to pretrained weights

@ -648,6 +648,8 @@ class CellSegmentator:
logger.info(f"├─ Seed: {common.seed}")
logger.info(f"├─ Device: {common.device}")
logger.info(f"├─ Use AMP: {'yes' if common.use_amp else 'no'}")
logger.info(f"├─ ROI size: {common.roi_size}")
logger.info(f"├─ Remove boundary objects: {'yes' if common.remove_boundary_objects else 'no'}")
logger.info(f"├─ Masks subdirectory: {common.masks_subdir}")
logger.info(f"└─ Predictions output dir: {common.predictions_dir}")
logger.info(f"├─ Pretrained weights: {common.pretrained_weights or 'None'}")
@ -1124,7 +1126,7 @@ class CellSegmentator:
batch_prediction=predicted_masks,
iou_threshold=iou_threshold,
return_error_masks=return_error_masks,
remove_boundary_objects=True
remove_boundary_objects=self._dataset_setup.common.remove_boundary_objects
)
tp = stats["tp"]
fp = stats["fp"]

Loading…
Cancel
Save