Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/mouseland/cellpose
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed Sep 7, 2024
2 parents 572527b + a2b297d commit 79bd598
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ If you are using a GPU, make sure its drivers and the cuda libraries are correct

1. Install an [Anaconda](https://www.anaconda.com/products/distribution) distribution of Python. Note you might need to use an anaconda prompt if you did not add anaconda to the path.
2. Open an anaconda prompt / command prompt which has `conda` for **python 3** in the path
3. Create a new environment with `conda create --name cellpose python=3.8`. We recommend python 3.8, but python 3.9 and 3.10 will likely work as well.
3. Create a new environment with `conda create --name cellpose python=3.9`. We recommend python 3.9, but python 3.10 will likely work as well.
4. To activate this new environment, run `conda activate cellpose`
5. (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]'`.
6. (option 2) To install cellpose without the GUI, run `python -m pip install cellpose`.
Expand Down
12 changes: 11 additions & 1 deletion cellpose/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,26 @@ def main():
builtin_size = False
if args.all_channels:
channels = None
img = io.imread(image_names[0])
if img.ndim == 3:
nchan = min(img.shape)
elif img.ndim == 2:
nchan = 1
channels = None
else:
nchan = 2

pretrained_model = None if model_type is not None else pretrained_model
if restore_type is None:
model = models.CellposeModel(gpu=gpu, device=device,
pretrained_model=pretrained_model,
model_type=model_type,
nchan=nchan,
backbone=backbone)
else:
model = denoise.CellposeDenoiseModel(
gpu=gpu, device=device, pretrained_model=pretrained_model,
model_type=model_type, restore_type=restore_type,
model_type=model_type, restore_type=restore_type, nchan=nchan,
chan2_restore=args.chan2_restore)

# handle diameters
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ this code at the beginning of your notebook before you import cellpose:
M1 Mac installation
~~~~~~~~~~~~~~~~~~~~~~~

Please use the instructions provided on `image.sc <https://forum.image.sc/t/cellpose-on-macos-m1-pro-apple-silicon-arm64/68018/4>`
Please use the instructions provided on `image.sc <https://forum.image.sc/t/cellpose-on-macos-m1-pro-apple-silicon-arm64/68018/4>`_
by Peter Sobolewski. From the command line you can choose the Mac device with

::
Expand Down

0 comments on commit 79bd598

Please sign in to comment.