cellpose icon indicating copy to clipboard operation
cellpose copied to clipboard

[BUG] cpsam output image pixelated with large diameter

Open romainGuiet opened this issue 6 months ago • 0 comments

Hi @carsen-stringer , Hi @mrariden , Hi all,

Describe the bug

if the images have a lot of pixels per cells (here diameter 1000) the results with cpsam looks pixelated while with cyto3 it is very smooth, cf table below.

Input Image cyto3 , cellpose 3.1.1.1 cpsam , cellpose 4.0.4
Image Image Image

To Reproduce environment with cellpose 3.1.1.1

python -Xutf8 -m cellpose --dir PATH --pretrained_model cyto3--chan 0 --chan2 0 --diameter 1000.0 --verbose --save_tif --no_npy --use_gpu

environment with cellpose 4.0.4

python -m cellpose --dir PATH  --pretrained_model cpsam --chan 0 --chan2 0 --diameter 1000.0 --verbose --save_tif --no_npy --use_gpu

Run log


Welcome to CellposeSAM, cellpose v
cellpose version: 	4.0.4 
platform:       	win32 
python version: 	3.8.20 
torch version:  	2.4.1! The neural network component of
CPSAM is much larger than in previous versions and CPU excution is slow. 
We encourage users to use GPU/MPS if available. 


2025-06-24 09:00:33,355 [INFO] WRITING LOG OUTPUT TO C:\Users\guiet\.cellpose\run.log
2025-06-24 09:00:33,355 [INFO] 
cellpose version: 	4.0.4 
platform:       	win32 
python version: 	3.8.20 
torch version:  	2.4.1
2025-06-24 09:00:33,604 [INFO] ** TORCH CUDA version installed and working. **
2025-06-24 09:00:33,605 [INFO] >>>> using GPU (CUDA)
2025-06-24 09:00:33,605 [WARNING] the '--no_resample' flag is deprecated in v4.0.1+ and no longer used
2025-06-24 09:00:33,605 [WARNING] the '--diam_mean' flag is deprecated in v4.0.1+ and no longer used
2025-06-24 09:00:33,613 [INFO] >>>> running cellpose on 1 images using all channels
2025-06-24 09:00:35,623 [INFO] >>>> loading model C:\Users\guiet\.cellpose\models\cpsam
2025-06-24 09:00:36,426 [INFO] 0%|          | 0/1 [00:00<?, ?it/s]
2025-06-24 09:00:36,474 [WARNING] Found more than 3 channels, only using first 3
2025-06-24 09:00:37,821 [INFO] 100%|##########| 1/1 [00:01<00:00,  1.39s/it]
2025-06-24 09:00:37,822 [INFO] 100%|##########| 1/1 [00:01<00:00,  1.40s/it]
2025-06-24 09:00:37,822 [INFO] >>>> completed in 4.217 sec

Thank you for your help,

Best,

Romain

romainGuiet avatar Jun 24 '25 07:06 romainGuiet