-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermediate saving of seg_npy, tif and png for batch processing #151
Comments
I've changed the CLI script so it runs in a loop as well, thanks for noticing this, this is better behavior |
I wanted to try running this via CLI, but received the following error. When I go back to the previous version of cellpose, it runs fine, but without the loop behaviour. ` (cellpose2) E:\CELLPOSE_GIT\cellpose>python -m cellpose --dir E:/DATA/MichaelShannon/Benchmarking_Data/3D_nuclei/MJSdataTimelapse/test/ --pretrained_model nuclei --diameter 24 --save_png --use_gpu --do_3D --save_tif --batch_size 4
running YX: 22 planes of size (1024, 1024) 25 16 0%| | 0/22 [00:00<?, ?it/s][12:13:00] c:\jenkins\workspace\mxnet-tag\mxnet\src\operator\nn\cudnn./cudnn_algoreg-inl.h:97: Running performance tests to find the best convolution algorithm, this can take a while... (set the environment variable MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 to disable) 5%|████████▊ | 1/22 [00:07<02:44, 7.81s/it] 0%| | 0/22 [00:00<?, ?it/s] 0%| | 0/22 [00:00<?, ?it/s] 0%| | 0/22 [00:00<?, ?it/s] running ZY: 1024 planes of size (22, 1024) 5 16 0%| | 0/342 [00:00<?, ?it/s][12:14:05] c:\jenkins\workspace\mxnet-tag\mxnet\src\operator\nn\cudnn./cudnn_algoreg-inl.h:97: Running performance tests to find the best convolution algorithm, this can take a while... (set the environment variable MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 to disable) |
sorry about that, can you try the master branch now? I'm trying to make the 3D batches run faster, particularly in YZ and XZ |
Yes I will do, thanks for the fast fix. I will be able to try again next week. |
Would like to confirm that this is fully fixed now. |
Hiya
It would be useful to (as default) have cellpose save the segmentation results of each timepoint directly after processing them in batch mode, rather than right at the end.
At the moment, cellpose only saves seg_npy, tif and png of the masks after completing processing from the entire dataset when run in batch either from jupyter or in command line.
Let's say you have a 100 timepoint 3D dataset, each timepoint consisting of a separate z stack made of 50 planes - if the computer fails, does an update, or another lab member presses the wrong key at timepoint 99, all segmentation data will be lost.
To fix this, in Jupyter a simple for loop would work (provided by Carsen):
for filename in filenames:
img = io.imread(filename)
masks, flows, styles, diams = model.eval(img, diameter=diameter, channels=channels)
io.masks_flows_to_seg(img, masks, flows, diams, filename, channels)
io.save_masks(img, masks, flows, filename, tif=True)
It would be good to also have this working from command line.
Thanks,
Michael
The text was updated successfully, but these errors were encountered: