# HG changeset patch
# User bgruening
# Date 1742059449 0
# Node ID 5251ce4c4a1154a6281cc3c10ab66b1366b0d965
# Parent 32153c43126cbeb71d6ee21ded74ddcbd9d37203
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
diff -r 32153c43126c -r 5251ce4c4a11 cellpose.xml
--- a/cellpose.xml Tue Feb 11 14:48:08 2025 +0000
+++ b/cellpose.xml Sat Mar 15 17:24:09 2025 +0000
@@ -2,7 +2,7 @@
with Cellpose
3.1.0
- 0
+ 1
@@ -19,6 +19,7 @@
echo "@VERSION@"
-
+
@@ -115,7 +116,9 @@
-
+
diff -r 32153c43126c -r 5251ce4c4a11 cp_segmentation.py
--- a/cp_segmentation.py Tue Feb 11 14:48:08 2025 +0000
+++ b/cp_segmentation.py Sat Mar 15 17:24:09 2025 +0000
@@ -3,11 +3,24 @@
import os
import warnings
+# Make sure, that `MKL_NUM_THREADS` is set to 1, to ensure reproducibility:
+# https://forum.image.sc/t/reproducibility-how-we-spent-years-building-containers-and-then-mkl-decided-to-screw-our-results/109599
+if str(os.environ['MKL_NUM_THREADS']) != '1':
+ warnings.warn('MKL_NUM_THREADS must be set to 1 to ensure reproducibility, and will be adjusted accordingly for now.')
+ os.environ['MKL_NUM_THREADS'] = '1'
+
+# Load the remaining packages *after* adjusting `MKL_NUM_THREADS` (this likely necessary for it to take effect)
import matplotlib.pyplot as plt
import numpy as np
import skimage.io
+import torch
from cellpose import models, plot, transforms
+# Apply PyTorch guidelines for reproducibility
+torch.backends.cudnn.benchmark = True
+torch.backends.cudnn.deterministic = True
+torch.manual_seed(0)
+
def main(inputs, img_path, img_format, output_dir):
"""
diff -r 32153c43126c -r 5251ce4c4a11 test-data/img02_cp_masks_rescale.tif
Binary file test-data/img02_cp_masks_rescale.tif has changed
diff -r 32153c43126c -r 5251ce4c4a11 test-data/img02_cp_segm_cyto.png
Binary file test-data/img02_cp_segm_cyto.png has changed
diff -r 32153c43126c -r 5251ce4c4a11 test-data/img02_cp_segm_diameter.png
Binary file test-data/img02_cp_segm_diameter.png has changed
diff -r 32153c43126c -r 5251ce4c4a11 test-data/img02_cp_segm_gpu.png
Binary file test-data/img02_cp_segm_gpu.png has changed