Skip to content

Commit 912e0e1

Browse files
committed
chore: minor chores
1 parent c579722 commit 912e0e1

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

cellseg_models_pytorch/datasets/_base_dataset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def __init__(
4747
inst_transforms : List[str]
4848
A list containg all the transformations that are applied to only the
4949
instance labelled masks. Allowed ones: "cellpose", "contour", "dist",
50-
"edgeweight", "hovernet", "omnipose", "smooth_dist", "binarize"
50+
"edgeweight", "hovernet", "omnipose", "smooth_dist", "binarize",
51+
"strong_augment
5152
normalization : str, optional
5253
Apply img normalization after all the transformations. One of "minmax",
5354
"norm", "percentile", None.

cellseg_models_pytorch/utils/mask_utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -568,13 +568,11 @@ def remove_debris_semantic(sem_map: np.ndarray, min_size: int = 10000):
568568
classes = classes[1:]
569569

570570
for i in classes:
571-
572571
area = np.array(res == i, np.int32)
573572
inst_map = ndi.label(area)[0]
574573
labels, counts = np.unique(inst_map, return_counts=True)
575574

576575
for label, npixls in zip(labels, counts):
577-
578576
if npixls < min_size:
579577
res[inst_map == label] = 0
580578

@@ -922,10 +920,7 @@ def majority_vote_parallel(type_map: np.ndarray, inst_map: np.ndarray) -> np.nda
922920
return tmap
923921

924922

925-
def majority_vote_sequential(
926-
type_map: np.ndarray,
927-
inst_map: np.ndarray,
928-
) -> np.ndarray:
923+
def majority_vote_sequential(type_map: np.ndarray, inst_map: np.ndarray) -> np.ndarray:
929924
"""Do a majority voting on the type_map pixels by broadcasting.
930925
931926
Adapted from:

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ keywords = ["cell segmentation", "nuclei segmentation", "pytorch", "pytorch-ligh
1212

1313
[tool.poetry.dependencies]
1414
python = "^3.8,<3.10"
15-
torch = "^1.8.1"
1615
numpy = "^1.22,<1.24"
17-
scipy = "^1.7"
18-
scikit-image = "^0.19"
1916
pathos = ">=0.2.8,<0.4.0"
20-
opencv-python = "^4.2.0.32"
2117
timm = ">=0.5.4,<0.7.0"
2218
numba = ">=0.55.2,<0.58.0"
19+
torch = "^1.8.1"
20+
scipy = "^1.7"
21+
scikit-image = "^0.19"
22+
opencv-python = "^4.2.0.32"
2323
tqdm = "^4.64.0"
2424
scikit-learn = "^1.0.2"
2525
pytorch-lightning = {version = "^1.6.0", optional = true}

0 commit comments

Comments
 (0)