Cellpose是一种先进的细胞分割工具,专为处理多种类型的图像而设计,尤其在应对显微镜图像中常见的噪声、模糊或欠采样等问题时表现出色。其最新版本 Cellpose3 针对这些图像质量挑战进行了优化,显著提升了分割性能和图像质量。与传统方法不同,过去的模型通常专注于恢复图像的像素值,而 Cellpose3 采用了一种创新的训练策略:它训练模型生成能够被通用分割模型良好分割的图像,同时保持与原始目标图像的感知相似性。这种方法不仅优化了分割效果,还特别适用于显微镜图像中常见的复杂场景。为了确保对用户提供的各种图像具有良好的适应性,Cellpose3 在一个大型且多样化的数据集上进行了训练。这种广泛的训练基础赋予了它出色的泛化能力,使其能够“开箱即用”地处理不同来源的图像。此外,Cellpose3 的使用极为便捷。用户可以通过 Cellpose 的图形界面中的“一键”按钮轻松调用其功能,也可以通过 Cellpose API 集成到自己的工作流程中,为科研人员和开发者提供了极大的便利。
v3.1+ update (Feb 2025)
pip install cellpose –upgrade to get all the new features and bug fixes!
support for big data
new options to improve 3D segmentation like flow3D_smooth and pretrained_model_ortho,
GPU-accelerated mask creation in 2D and 3D (benchmarks)
better support for Mac Silicon chips (MPS), although new mask creation code not supported by Mac yet
本地安装:
System requirements
Linux, Windows and Mac OS are supported for running the code. For running the graphical interface you will need a Mac OS later than Yosemite. At least 8GB of RAM is required to run the software. 16GB-32GB may be required for larger images and 3D volumes. The software has been heavily tested on Windows 10 and Ubuntu 18.04 and less well-tested on Mac OS. Please open an issue if you have problems with installation.
依赖包:
cellpose relies on the following excellent packages (which are automatically installed with conda/pip if missing):
pytorch
pyqtgraph
PyQt5
numpy (>=1.16.0)
numba
scipy
natsort
tifffile
imagecodecs
roifile
fastremap
If you have an older cellpose
environment you can remove it with conda env remove -n cellpose
before creating a new one.
If you are using a GPU, make sure its drivers and the cuda libraries are correctly installed.
- Install a miniforge distribution of Python. Note you might need to use an anaconda prompt if you did not add anaconda to the path.
- Open an anaconda prompt / command prompt which has
conda
for python 3 in the path - Create a new environment with
conda create --name cellpose python=3.10
. We recommend python 3.10, but python 3.9 and 3.11 will also work. - To activate this new environment, run
conda activate cellpose
- (option 1) To install cellpose with the GUI, run
python -m pip install cellpose[gui]
. If you’re on a zsh server, you may need to use ‘ ‘:python -m pip install 'cellpose[gui]'
. - (option 2) To install cellpose without the GUI, run
python -m pip install cellpose
.
To upgrade cellpose (package here), run the following in the environment:
python -m pip install cellpose --upgrade
Note you will always have to run conda activate cellpose
before you run cellpose. If you want to run jupyter notebooks in this environment, then also python -m pip install notebook
and python -m pip install matplotlib
.
You can also try to install cellpose and the GUI dependencies from your base environment using the command
python -m pip install cellpose[gui]
If you have issues with installation, see the docs for more details. You can also use the cellpose environment file included in the repository and create a cellpose environment with conda env create -f environment.yml
which may solve certain dependency issues.
If these suggestions fail, open an issue.
Venv (tutorial, for those interested) is a built-in tool in python for creating virtual environments. It is a good alternative if you don’t want to install conda and already have python3 on your machine. The main difference is that you will need to choose where to install the environment and the packages. Cellpose will then live in this environment and not be accessible from other environments. You will need to navigate to the environment directory and activate it each time before running cellpose. The steps are similar to the conda installation:
If you are using a GPU, make sure its drivers and the cuda libraries are correctly installed.
- Install python3.8 or later from python.org. This will be the version of python that will be used in the environment. You can check your python version with
python --version
. - Navigate to the directory where you want to create the environment and run
python3 -m venv cellpose
to create a new environment calledcellpose
. - Activate the environment with
source cellpose/bin/activate
on Mac/Linux orcellpose\Scripts\activate
on Windows. A prefix(cellpose)
should appear in the terminal. - Install cellpose into the
cellpose
venv using pip withpython -m pip install cellpose
. - Install the cellpose GUI, with
python -m pip install cellpose[gui]
. Depending on your terminal software, you may need to use quotes like this:python -m pip install 'cellpose[gui]'
. - You can now run cellpose from this environment with
python -m cellpose
orcellpose
if you are in the cellpose directory. - To deactivate the environment, run
deactivate
.
If you plan on running many images, you may want to install a GPU version of torch. To use your NVIDIA GPU with python, you will need to make sure the NVIDIA driver for your GPU is installed, check out this website to download it. You can also install the CUDA toolkit, or use the pytorch cudatoolkit (installed below with conda). If you have trouble with the below install, we recommend installing the CUDA toolkit yourself, choosing one of the 11.x releases here.
With the latest versions of pytorch, as long as the NVIDIA drivers are installed, the GPU version is installed by default with pip. You can check if the GPU support is working by opening the GUI. If the GPU is working then the GPU
box will be checked and the CUDA
version will be displayed in the command line.
If it’s not working, we will need to remove the CPU version of torch:
pip uninstall torch
To install the GPU version of torch, follow the instructions here. The conda install is strongly recommended, and then choose the CUDA version that is supported by your GPU (newer GPUs may need newer CUDA versions > 10.2). For instance this command will install the 11.6 version on Linux and Windows (note the torchvision
and torchaudio
commands are removed because cellpose doesn’t require them):
conda install pytorch pytorch-cuda=11.6 -c pytorch -c nvidia
If the latest CUDA versions don’t work, try an older version like cuda 11.3:
conda install pytorch==1.12.0 cudatoolkit=11.3 -c pytorch
Info on how to install several older versions is available here. After install you can check conda list
for pytorch
, and its version info should have cuXX.X
, not cpu
.
如若转载,请注明出处:https://www.ouq.net/3463.html