CellDetection


NameCellDetection JSON
Version 0.4.5 PyPI version JSON
download
home_pagehttps://celldetection.org
SummaryCell Detection with PyTorch.
upload_time2023-11-15 13:31:04
maintainer
docs_urlNone
authorEric Upschulte
requires_python
licenseApache License, Version 2.0
keywords cell detection object segmentation pytorch cpn contour proposal network deep learning unet fzj julich juelich ai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cell Detection

[![Downloads](https://static.pepy.tech/badge/celldetection?l)](https://pepy.tech/project/celldetection)
[![Test](https://github.com/FZJ-INM1-BDA/celldetection/workflows/Test/badge.svg)](https://github.com/FZJ-INM1-BDA/celldetection/actions?query=workflow%3ATest)
[![PyPI](https://img.shields.io/pypi/v/celldetection?l)](https://pypi.org/project/celldetection/)
[![Documentation Status](https://readthedocs.org/projects/celldetection/badge/?version=latest)](https://celldetection.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://zenodo.org/badge/349111085.svg)](https://zenodo.org/badge/latestdoi/349111085)

## ⭐ Showcase

###### NeurIPS 22 Cell Segmentation Competition

![neurips22](https://raw.githubusercontent.com/FZJ-INM1-BDA/celldetection/main/assets/neurips-cellseg-demo.png "NeurIPS 22 Cell Segmentation Competition - Find more information here: https://neurips.cc/Conferences/2022/CompetitionTrack")
*https://openreview.net/forum?id=YtgRjBw-7GJ*

###### Nuclei of U2OS cells in a chemical screen

![bbbc039](https://raw.githubusercontent.com/FZJ-INM1-BDA/celldetection/main/assets/bbbc039-cpn-u22-demo.png "BBBC039 demo with CpnU22 - Find the dataset here: https://bbbc.broadinstitute.org/BBBC039")
*https://bbbc.broadinstitute.org/BBBC039 (CC0)*

###### P. vivax (malaria) infected human blood

![bbbc041](https://raw.githubusercontent.com/FZJ-INM1-BDA/celldetection/main/assets/bbbc041-cpn-u22-demo.png "BBBC041 demo with CpnU22 - Find the dataset here: https://bbbc.broadinstitute.org/BBBC041")
*https://bbbc.broadinstitute.org/BBBC041 (CC BY-NC-SA 3.0)*

## 🛠 Install

Make sure you have [PyTorch](https://pytorch.org/get-started/locally/) installed.

### PyPI

```
pip install -U celldetection
```

### GitHub

```
pip install git+https://github.com/FZJ-INM1-BDA/celldetection.git
```

## 💾 Trained models

```python
model = cd.fetch_model(model_name, check_hash=True)
```

| model name                                  | training data                                                                                                        |                                           link                                            |
|---------------------------------------------|----------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------:| 
| `ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c` | BBBC039, BBBC038, Omnipose, Cellpose, Sartorius - Cell Instance Segmentation, Livecell, NeurIPS 22 CellSeg Challenge | [🔗](https://celldetection.org/torch/models/ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c.pt) |

<details>
  <summary style="font-weight: bold; color: #888888">Run a demo with a pretrained model</summary>

```python
import torch, cv2, celldetection as cd
from skimage.data import coins
from matplotlib import pyplot as plt

# Load pretrained model
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = cd.fetch_model('ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c', check_hash=True).to(device)
model.eval()

# Load input
img = coins()
img = cv2.cvtColor(img, cv2.COLOR_GRAY2RGB)
print(img.dtype, img.shape, (img.min(), img.max()))

# Run model
with torch.no_grad():
    x = cd.to_tensor(img, transpose=True, device=device, dtype=torch.float32)
    x = x / 255  # ensure 0..1 range
    x = x[None]  # add batch dimension: Tensor[3, h, w] -> Tensor[1, 3, h, w]
    y = model(x)

# Show results for each batch item
contours = y['contours']
for n in range(len(x)):
    cd.imshow_row(x[n], x[n], figsize=(16, 9), titles=('input', 'contours'))
    cd.plot_contours(contours[n])
    plt.show()
```

</details>

## 🔬 Architectures

```python
import celldetection as cd
```

<details>
  <summary style="font-weight: bold; color: #888888">Contour Proposal Networks</summary>

- [`cd.models.CPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CPN)
- [`cd.models.CpnU22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnU22)
- [`cd.models.CPNCore`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CPNCore)
- [`cd.models.CpnResUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResUNet)
- [`cd.models.CpnSlimU22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnSlimU22)
- [`cd.models.CpnWideU22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnWideU22)
- [`cd.models.CpnResNet18FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet18FPN)
- [`cd.models.CpnResNet34FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet34FPN)
- [`cd.models.CpnResNet50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet50FPN)
- [`cd.models.CpnResNeXt50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt50FPN)
- [`cd.models.CpnResNet101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet101FPN)
- [`cd.models.CpnResNet152FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet152FPN)
- [`cd.models.CpnResNet18UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet18UNet)
- [`cd.models.CpnResNet34UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet34UNet)
- [`cd.models.CpnResNet50UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet50UNet)
- [`cd.models.CpnResNeXt101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt101FPN)
- [`cd.models.CpnResNeXt152FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt152FPN)
- [`cd.models.CpnResNeXt50UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt50UNet)
- [`cd.models.CpnResNet101UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet101UNet)
- [`cd.models.CpnResNet152UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet152UNet)
- [`cd.models.CpnResNeXt101UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt101UNet)
- [`cd.models.CpnResNeXt152UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt152UNet)
- [`cd.models.CpnWideResNet50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnWideResNet50FPN)
- [`cd.models.CpnWideResNet101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnWideResNet101FPN)
- [`cd.models.CpnMobileNetV3LargeFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnMobileNetV3LargeFPN)
- [`cd.models.CpnMobileNetV3SmallFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnMobileNetV3SmallFPN)

</details>

<details>
  <summary style="font-weight: bold; color: #888888">PyTorch Image Models (timm)</summary>

Also have a look at [Timm Documentation](https://huggingface.co/docs/timm/index).

```python
import timm

timm.list_models(filter='*')  # explore available models
```

- [`cd.models.CpnTimmMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnTimmMaNet)
- [`cd.models.CpnTimmUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnTimmUNet)
- [`cd.models.TimmEncoder`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.timmodels.TimmEncoder)
- [`cd.models.TimmFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.TimmFPN)
- [`cd.models.TimmMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.manet.TimmMaNet)
- [`cd.models.TimmUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.TimmUNet)

</details>

<details>
  <summary style="font-weight: bold; color: #888888">Segmentation Models PyTorch (smp)</summary>

```python
import segmentation_models_pytorch as smp

smp.encoders.get_encoder_names()  # explore available models
```

```python
encoder = cd.models.SmpEncoder(encoder_name='mit_b5', pretrained='imagenet')
```

Find a list of [Smp Encoders](https://smp.readthedocs.io/en/latest/encoders.html) in the `smp` documentation.

- [`cd.models.CpnSmpMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnSmpMaNet)
- [`cd.models.CpnSmpUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnSmpUNet)
- [`cd.models.SmpEncoder`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.smp.SmpEncoder)
- [`cd.models.SmpFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.SmpFPN)
- [`cd.models.SmpMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.manet.SmpMaNet)
- [`cd.models.SmpUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.SmpUNet)

</details>

<details>
    <summary style="font-weight: bold; color: #888888">U-Nets</summary>

```python
# U-Nets are available in 2D and 3D
import celldetection as cd

model = cd.models.ResNeXt50UNet(in_channels=3, out_channels=1, nd=3)
```

- [`cd.models.U22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.U22)
- [`cd.models.U17`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.U17)
- [`cd.models.U12`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.U12)
- [`cd.models.UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.UNet)
- [`cd.models.WideU22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.WideU22)
- [`cd.models.SlimU22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.SlimU22)
- [`cd.models.ResUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResUNet)
- [`cd.models.UNetEncoder`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.UNetEncoder)
- [`cd.models.ResNet50UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNet50UNet)
- [`cd.models.ResNet18UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNet18UNet)
- [`cd.models.ResNet34UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNet34UNet)
- [`cd.models.ResNet152UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNet152UNet)
- [`cd.models.ResNet101UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNet101UNet)
- [`cd.models.ResNeXt50UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNeXt50UNet)
- [`cd.models.ResNeXt152UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNeXt152UNet)
- [`cd.models.ResNeXt101UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNeXt101UNet)
- [`cd.models.WideResNet50UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.WideResNet50UNet)
- [`cd.models.WideResNet101UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.WideResNet101UNet)
- [`cd.models.MobileNetV3SmallUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.MobileNetV3SmallUNet)
- [`cd.models.MobileNetV3LargeUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.MobileNetV3LargeUNet)

</details>

<details>
    <summary style="font-weight: bold; color: #888888">MA-Nets</summary>

```python
# Many MA-Nets are available in 2D and 3D
import celldetection as cd

encoder = cd.models.ConvNeXtSmall(in_channels=3, nd=3)
model = cd.models.MaNet(encoder, out_channels=1, nd=3)
```

- [`cd.models.MaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.manet.MaNet)
- [`cd.models.SmpMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.manet.SmpMaNet)
- [`cd.models.TimmMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.manet.TimmMaNet)

</details>

<details>
    <summary style="font-weight: bold; color: #888888">Feature Pyramid Networks</summary>

- [`cd.models.FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.FPN)
- [`cd.models.ResNet18FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNet18FPN)
- [`cd.models.ResNet34FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNet34FPN)
- [`cd.models.ResNet50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNet50FPN)
- [`cd.models.ResNeXt50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNeXt50FPN)
- [`cd.models.ResNet101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNet101FPN)
- [`cd.models.ResNet152FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNet152FPN)
- [`cd.models.ResNeXt101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNeXt101FPN)
- [`cd.models.ResNeXt152FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNeXt152FPN)
- [`cd.models.WideResNet50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.WideResNet50FPN)
- [`cd.models.WideResNet101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.WideResNet101FPN)
- [`cd.models.MobileNetV3LargeFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.MobileNetV3LargeFPN)
- [`cd.models.MobileNetV3SmallFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.MobileNetV3SmallFPN)

</details>

<details>
    <summary style="font-weight: bold; color: #888888">ConvNeXt Networks</summary>

```python
# ConvNeXt Networks are available in 2D and 3D
import celldetection as cd

model = cd.models.ConvNeXtSmall(in_channels=3, nd=3)
```

- [`cd.models.ConvNeXt`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.convnext.MaNet)
- [`cd.models.ConvNeXtTiny`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.convnext.ConvNeXtTiny)
- [`cd.models.ConvNeXtSmall`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.convnext.ConvNeXtSmall)
- [`cd.models.ConvNeXtBase`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.convnext.ConvNeXtBase)
- [`cd.models.ConvNeXtLarge`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.convnext.ConvNeXtLarge)

</details>

<details>
    <summary style="font-weight: bold; color: #888888">Residual Networks</summary>

```python
# Residual Networks are available in 2D and 3D
import celldetection as cd

model = cd.models.ResNet50(in_channels=3, nd=3)
```

- [`cd.models.ResNet18`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNet18)
- [`cd.models.ResNet34`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNet34)
- [`cd.models.ResNet50`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNet50)
- [`cd.models.ResNet101`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNet101)
- [`cd.models.ResNet152`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNet152)
- [`cd.models.WideResNet50_2`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.WideResNet50_2)
- [`cd.models.ResNeXt50_32x4d`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNeXt50_32x4d)
- [`cd.models.WideResNet101_2`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.WideResNet101_2)
- [`cd.models.ResNeXt101_32x8d`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNeXt101_32x8d)
- [`cd.models.ResNeXt152_32x8d`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNeXt152_32x8d)

</details>

<details>
    <summary style="font-weight: bold; color: #888888">Mobile Networks</summary>

- [`cd.models.MobileNetV3Large`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.mobilenetv3.MobileNetV3Large)
- [`cd.models.MobileNetV3Small`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.mobilenetv3.MobileNetV3Small)

</details>

## 🐳 Docker

Find us on Docker Hub: https://hub.docker.com/r/ericup/celldetection

You can pull the latest version of `celldetection` via:
```
docker pull ericup/celldetection:latest
```

<details>
    <summary style="font-weight: bold; color: #888888">CPN inference via Docker with GPU</summary>

```
docker run --rm \
  -v $PWD/docker/outputs:/outputs/ \
  -v $PWD/docker/inputs/:/inputs/ \
  -v $PWD/docker/models/:/models/ \
  --gpus="device=0" \
  celldetection:latest /bin/bash -c \
  "python cpn_inference.py --tile_size=1024 --stride=768 --precision=32-true"
```
</details>
<details>
    <summary style="font-weight: bold; color: #888888">CPN inference via Docker with CPU</summary>

```
docker run --rm \
  -v $PWD/docker/outputs:/outputs/ \
  -v $PWD/docker/inputs/:/inputs/ \
  -v $PWD/docker/models/:/models/ \
  celldetection:latest /bin/bash -c \
  "python cpn_inference.py --tile_size=1024 --stride=768 --precision=32-true --accelerator=cpu"
```
</details>



### Apptainer

You can also pull our Docker images for the use with [Apptainer](https://apptainer.org/) (formerly [Singularity](https://github.com/apptainer/singularity)) with this command:

```
apptainer pull --dir . --disable-cache docker://ericup/celldetection:latest
```


## 🤗 Hugging Face Spaces

Find us on Hugging Face and upload your own images for segmentation: https://huggingface.co/spaces/ericup/celldetection

<details>
    <summary style="font-weight: bold; color: #888888">Hugging Face API</summary>

### Python

```python
import requests

response = requests.post("https://ericup-celldetection.hf.space/run/predict", json={
    "data": [
        "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",
        "ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c",
    ]
}).json()

data = response["data"]
```

### Javascript

```javascript
const response = await fetch("https://ericup-celldetection.hf.space/run/predict", {
    method: "POST",
    headers: {"Content-Type": "application/json"},
    body: JSON.stringify({
        data: [
            "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",
            "ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c",
        ]
    })
});

const data = await response.json();

```

</details>

## 🧑‍💻 Napari Plugin

Find our Napari Plugin here: https://github.com/FZJ-INM1-BDA/celldetection-napari </br>
Find out more about Napari here: https://napari.org
![bbbc039](https://raw.githubusercontent.com/FZJ-INM1-BDA/celldetection-napari/main/assets/coins-demo.png "Napari Plugin")
You can install it via pip:
```
pip install git+https://github.com/FZJ-INM1-BDA/celldetection-napari.git
```

## 🏆 Awards

- [NeurIPS 2022 Cell Segmentation Challenge](https://neurips22-cellseg.grand-challenge.org/): Winner Finalist Award

## 📝 Citing

If you find this work useful, please consider giving a **star** ⭐️ and **citation**:

```
@article{UPSCHULTE2022102371,
    title = {Contour proposal networks for biomedical instance segmentation},
    journal = {Medical Image Analysis},
    volume = {77},
    pages = {102371},
    year = {2022},
    issn = {1361-8415},
    doi = {https://doi.org/10.1016/j.media.2022.102371},
    url = {https://www.sciencedirect.com/science/article/pii/S136184152200024X},
    author = {Eric Upschulte and Stefan Harmeling and Katrin Amunts and Timo Dickscheid},
    keywords = {Cell detection, Cell segmentation, Object detection, CPN},
}
```

## 🔗 Links

- [Article (sciencedirect)](https://www.sciencedirect.com/science/article/pii/S136184152200024X "Contour Proposal Networks for Biomedical Instance Segmentation")
- [PDF (sciencedirect)](https://www.sciencedirect.com/sdfe/reader/pii/S136184152200024X/pdf "Contour Proposal Networks for Biomedical Instance Segmentation")
- [PyPI](https://pypi.org/project/celldetection/ "CellDetection")
- [Documentation](https://docs.celldetection.org "Documentation")

## 🧑‍🔬 Thanks!

[![Stargazers repo roster for @FZJ-INM1-BDA/celldetection](https://reporoster.com/stars/FZJ-INM1-BDA/celldetection)](https://github.com/FZJ-INM1-BDA/celldetection/stargazers)
[![Forkers repo roster for @FZJ-INM1-BDA/celldetection](https://reporoster.com/forks/FZJ-INM1-BDA/celldetection)](https://github.com/FZJ-INM1-BDA/celldetection/network/members)

            

Raw data

            {
    "_id": null,
    "home_page": "https://celldetection.org",
    "name": "CellDetection",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "cell,detection,object,segmentation,pytorch,cpn,contour,proposal,network,deep,learning,unet,fzj,julich,juelich,ai",
    "author": "Eric Upschulte",
    "author_email": "e.upschulte@fz-juelich.de",
    "download_url": "https://files.pythonhosted.org/packages/07/7f/9a5dc21249aadcadb3fc3f0dad0e50720cefbed9cdb2e44879397ceefd56/CellDetection-0.4.5.tar.gz",
    "platform": null,
    "description": "# Cell Detection\n\n[![Downloads](https://static.pepy.tech/badge/celldetection?l)](https://pepy.tech/project/celldetection)\n[![Test](https://github.com/FZJ-INM1-BDA/celldetection/workflows/Test/badge.svg)](https://github.com/FZJ-INM1-BDA/celldetection/actions?query=workflow%3ATest)\n[![PyPI](https://img.shields.io/pypi/v/celldetection?l)](https://pypi.org/project/celldetection/)\n[![Documentation Status](https://readthedocs.org/projects/celldetection/badge/?version=latest)](https://celldetection.readthedocs.io/en/latest/?badge=latest)\n[![DOI](https://zenodo.org/badge/349111085.svg)](https://zenodo.org/badge/latestdoi/349111085)\n\n## \u2b50 Showcase\n\n###### NeurIPS 22 Cell Segmentation Competition\n\n![neurips22](https://raw.githubusercontent.com/FZJ-INM1-BDA/celldetection/main/assets/neurips-cellseg-demo.png \"NeurIPS 22 Cell Segmentation Competition - Find more information here: https://neurips.cc/Conferences/2022/CompetitionTrack\")\n*https://openreview.net/forum?id=YtgRjBw-7GJ*\n\n###### Nuclei of U2OS cells in a chemical screen\n\n![bbbc039](https://raw.githubusercontent.com/FZJ-INM1-BDA/celldetection/main/assets/bbbc039-cpn-u22-demo.png \"BBBC039 demo with CpnU22 - Find the dataset here: https://bbbc.broadinstitute.org/BBBC039\")\n*https://bbbc.broadinstitute.org/BBBC039 (CC0)*\n\n###### P. vivax (malaria) infected human blood\n\n![bbbc041](https://raw.githubusercontent.com/FZJ-INM1-BDA/celldetection/main/assets/bbbc041-cpn-u22-demo.png \"BBBC041 demo with CpnU22 - Find the dataset here: https://bbbc.broadinstitute.org/BBBC041\")\n*https://bbbc.broadinstitute.org/BBBC041 (CC BY-NC-SA 3.0)*\n\n## \ud83d\udee0 Install\n\nMake sure you have [PyTorch](https://pytorch.org/get-started/locally/) installed.\n\n### PyPI\n\n```\npip install -U celldetection\n```\n\n### GitHub\n\n```\npip install git+https://github.com/FZJ-INM1-BDA/celldetection.git\n```\n\n## \ud83d\udcbe Trained models\n\n```python\nmodel = cd.fetch_model(model_name, check_hash=True)\n```\n\n| model name                                  | training data                                                                                                        |                                           link                                            |\n|---------------------------------------------|----------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------:| \n| `ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c` | BBBC039, BBBC038, Omnipose, Cellpose, Sartorius - Cell Instance Segmentation, Livecell, NeurIPS 22 CellSeg Challenge | [\ud83d\udd17](https://celldetection.org/torch/models/ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c.pt) |\n\n<details>\n  <summary style=\"font-weight: bold; color: #888888\">Run a demo with a pretrained model</summary>\n\n```python\nimport torch, cv2, celldetection as cd\nfrom skimage.data import coins\nfrom matplotlib import pyplot as plt\n\n# Load pretrained model\ndevice = 'cuda' if torch.cuda.is_available() else 'cpu'\nmodel = cd.fetch_model('ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c', check_hash=True).to(device)\nmodel.eval()\n\n# Load input\nimg = coins()\nimg = cv2.cvtColor(img, cv2.COLOR_GRAY2RGB)\nprint(img.dtype, img.shape, (img.min(), img.max()))\n\n# Run model\nwith torch.no_grad():\n    x = cd.to_tensor(img, transpose=True, device=device, dtype=torch.float32)\n    x = x / 255  # ensure 0..1 range\n    x = x[None]  # add batch dimension: Tensor[3, h, w] -> Tensor[1, 3, h, w]\n    y = model(x)\n\n# Show results for each batch item\ncontours = y['contours']\nfor n in range(len(x)):\n    cd.imshow_row(x[n], x[n], figsize=(16, 9), titles=('input', 'contours'))\n    cd.plot_contours(contours[n])\n    plt.show()\n```\n\n</details>\n\n## \ud83d\udd2c Architectures\n\n```python\nimport celldetection as cd\n```\n\n<details>\n  <summary style=\"font-weight: bold; color: #888888\">Contour Proposal Networks</summary>\n\n- [`cd.models.CPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CPN)\n- [`cd.models.CpnU22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnU22)\n- [`cd.models.CPNCore`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CPNCore)\n- [`cd.models.CpnResUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResUNet)\n- [`cd.models.CpnSlimU22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnSlimU22)\n- [`cd.models.CpnWideU22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnWideU22)\n- [`cd.models.CpnResNet18FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet18FPN)\n- [`cd.models.CpnResNet34FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet34FPN)\n- [`cd.models.CpnResNet50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet50FPN)\n- [`cd.models.CpnResNeXt50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt50FPN)\n- [`cd.models.CpnResNet101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet101FPN)\n- [`cd.models.CpnResNet152FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet152FPN)\n- [`cd.models.CpnResNet18UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet18UNet)\n- [`cd.models.CpnResNet34UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet34UNet)\n- [`cd.models.CpnResNet50UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet50UNet)\n- [`cd.models.CpnResNeXt101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt101FPN)\n- [`cd.models.CpnResNeXt152FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt152FPN)\n- [`cd.models.CpnResNeXt50UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt50UNet)\n- [`cd.models.CpnResNet101UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet101UNet)\n- [`cd.models.CpnResNet152UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNet152UNet)\n- [`cd.models.CpnResNeXt101UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt101UNet)\n- [`cd.models.CpnResNeXt152UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnResNeXt152UNet)\n- [`cd.models.CpnWideResNet50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnWideResNet50FPN)\n- [`cd.models.CpnWideResNet101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnWideResNet101FPN)\n- [`cd.models.CpnMobileNetV3LargeFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnMobileNetV3LargeFPN)\n- [`cd.models.CpnMobileNetV3SmallFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnMobileNetV3SmallFPN)\n\n</details>\n\n<details>\n  <summary style=\"font-weight: bold; color: #888888\">PyTorch Image Models (timm)</summary>\n\nAlso have a look at [Timm Documentation](https://huggingface.co/docs/timm/index).\n\n```python\nimport timm\n\ntimm.list_models(filter='*')  # explore available models\n```\n\n- [`cd.models.CpnTimmMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnTimmMaNet)\n- [`cd.models.CpnTimmUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnTimmUNet)\n- [`cd.models.TimmEncoder`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.timmodels.TimmEncoder)\n- [`cd.models.TimmFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.TimmFPN)\n- [`cd.models.TimmMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.manet.TimmMaNet)\n- [`cd.models.TimmUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.TimmUNet)\n\n</details>\n\n<details>\n  <summary style=\"font-weight: bold; color: #888888\">Segmentation Models PyTorch (smp)</summary>\n\n```python\nimport segmentation_models_pytorch as smp\n\nsmp.encoders.get_encoder_names()  # explore available models\n```\n\n```python\nencoder = cd.models.SmpEncoder(encoder_name='mit_b5', pretrained='imagenet')\n```\n\nFind a list of [Smp Encoders](https://smp.readthedocs.io/en/latest/encoders.html) in the `smp` documentation.\n\n- [`cd.models.CpnSmpMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnSmpMaNet)\n- [`cd.models.CpnSmpUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.cpn.CpnSmpUNet)\n- [`cd.models.SmpEncoder`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.smp.SmpEncoder)\n- [`cd.models.SmpFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.SmpFPN)\n- [`cd.models.SmpMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.manet.SmpMaNet)\n- [`cd.models.SmpUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.SmpUNet)\n\n</details>\n\n<details>\n    <summary style=\"font-weight: bold; color: #888888\">U-Nets</summary>\n\n```python\n# U-Nets are available in 2D and 3D\nimport celldetection as cd\n\nmodel = cd.models.ResNeXt50UNet(in_channels=3, out_channels=1, nd=3)\n```\n\n- [`cd.models.U22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.U22)\n- [`cd.models.U17`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.U17)\n- [`cd.models.U12`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.U12)\n- [`cd.models.UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.UNet)\n- [`cd.models.WideU22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.WideU22)\n- [`cd.models.SlimU22`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.SlimU22)\n- [`cd.models.ResUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResUNet)\n- [`cd.models.UNetEncoder`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.UNetEncoder)\n- [`cd.models.ResNet50UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNet50UNet)\n- [`cd.models.ResNet18UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNet18UNet)\n- [`cd.models.ResNet34UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNet34UNet)\n- [`cd.models.ResNet152UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNet152UNet)\n- [`cd.models.ResNet101UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNet101UNet)\n- [`cd.models.ResNeXt50UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNeXt50UNet)\n- [`cd.models.ResNeXt152UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNeXt152UNet)\n- [`cd.models.ResNeXt101UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.ResNeXt101UNet)\n- [`cd.models.WideResNet50UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.WideResNet50UNet)\n- [`cd.models.WideResNet101UNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.WideResNet101UNet)\n- [`cd.models.MobileNetV3SmallUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.MobileNetV3SmallUNet)\n- [`cd.models.MobileNetV3LargeUNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.unet.MobileNetV3LargeUNet)\n\n</details>\n\n<details>\n    <summary style=\"font-weight: bold; color: #888888\">MA-Nets</summary>\n\n```python\n# Many MA-Nets are available in 2D and 3D\nimport celldetection as cd\n\nencoder = cd.models.ConvNeXtSmall(in_channels=3, nd=3)\nmodel = cd.models.MaNet(encoder, out_channels=1, nd=3)\n```\n\n- [`cd.models.MaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.manet.MaNet)\n- [`cd.models.SmpMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.manet.SmpMaNet)\n- [`cd.models.TimmMaNet`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.manet.TimmMaNet)\n\n</details>\n\n<details>\n    <summary style=\"font-weight: bold; color: #888888\">Feature Pyramid Networks</summary>\n\n- [`cd.models.FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.FPN)\n- [`cd.models.ResNet18FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNet18FPN)\n- [`cd.models.ResNet34FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNet34FPN)\n- [`cd.models.ResNet50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNet50FPN)\n- [`cd.models.ResNeXt50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNeXt50FPN)\n- [`cd.models.ResNet101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNet101FPN)\n- [`cd.models.ResNet152FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNet152FPN)\n- [`cd.models.ResNeXt101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNeXt101FPN)\n- [`cd.models.ResNeXt152FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.ResNeXt152FPN)\n- [`cd.models.WideResNet50FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.WideResNet50FPN)\n- [`cd.models.WideResNet101FPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.WideResNet101FPN)\n- [`cd.models.MobileNetV3LargeFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.MobileNetV3LargeFPN)\n- [`cd.models.MobileNetV3SmallFPN`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.fpn.MobileNetV3SmallFPN)\n\n</details>\n\n<details>\n    <summary style=\"font-weight: bold; color: #888888\">ConvNeXt Networks</summary>\n\n```python\n# ConvNeXt Networks are available in 2D and 3D\nimport celldetection as cd\n\nmodel = cd.models.ConvNeXtSmall(in_channels=3, nd=3)\n```\n\n- [`cd.models.ConvNeXt`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.convnext.MaNet)\n- [`cd.models.ConvNeXtTiny`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.convnext.ConvNeXtTiny)\n- [`cd.models.ConvNeXtSmall`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.convnext.ConvNeXtSmall)\n- [`cd.models.ConvNeXtBase`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.convnext.ConvNeXtBase)\n- [`cd.models.ConvNeXtLarge`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.convnext.ConvNeXtLarge)\n\n</details>\n\n<details>\n    <summary style=\"font-weight: bold; color: #888888\">Residual Networks</summary>\n\n```python\n# Residual Networks are available in 2D and 3D\nimport celldetection as cd\n\nmodel = cd.models.ResNet50(in_channels=3, nd=3)\n```\n\n- [`cd.models.ResNet18`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNet18)\n- [`cd.models.ResNet34`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNet34)\n- [`cd.models.ResNet50`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNet50)\n- [`cd.models.ResNet101`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNet101)\n- [`cd.models.ResNet152`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNet152)\n- [`cd.models.WideResNet50_2`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.WideResNet50_2)\n- [`cd.models.ResNeXt50_32x4d`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNeXt50_32x4d)\n- [`cd.models.WideResNet101_2`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.WideResNet101_2)\n- [`cd.models.ResNeXt101_32x8d`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNeXt101_32x8d)\n- [`cd.models.ResNeXt152_32x8d`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.resnet.ResNeXt152_32x8d)\n\n</details>\n\n<details>\n    <summary style=\"font-weight: bold; color: #888888\">Mobile Networks</summary>\n\n- [`cd.models.MobileNetV3Large`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.mobilenetv3.MobileNetV3Large)\n- [`cd.models.MobileNetV3Small`](https://docs.celldetection.org/en/latest/celldetection.models.html#celldetection.models.mobilenetv3.MobileNetV3Small)\n\n</details>\n\n## \ud83d\udc33 Docker\n\nFind us on Docker Hub: https://hub.docker.com/r/ericup/celldetection\n\nYou can pull the latest version of `celldetection` via:\n```\ndocker pull ericup/celldetection:latest\n```\n\n<details>\n    <summary style=\"font-weight: bold; color: #888888\">CPN inference via Docker with GPU</summary>\n\n```\ndocker run --rm \\\n  -v $PWD/docker/outputs:/outputs/ \\\n  -v $PWD/docker/inputs/:/inputs/ \\\n  -v $PWD/docker/models/:/models/ \\\n  --gpus=\"device=0\" \\\n  celldetection:latest /bin/bash -c \\\n  \"python cpn_inference.py --tile_size=1024 --stride=768 --precision=32-true\"\n```\n</details>\n<details>\n    <summary style=\"font-weight: bold; color: #888888\">CPN inference via Docker with CPU</summary>\n\n```\ndocker run --rm \\\n  -v $PWD/docker/outputs:/outputs/ \\\n  -v $PWD/docker/inputs/:/inputs/ \\\n  -v $PWD/docker/models/:/models/ \\\n  celldetection:latest /bin/bash -c \\\n  \"python cpn_inference.py --tile_size=1024 --stride=768 --precision=32-true --accelerator=cpu\"\n```\n</details>\n\n\n\n### Apptainer\n\nYou can also pull our Docker images for the use with [Apptainer](https://apptainer.org/) (formerly [Singularity](https://github.com/apptainer/singularity)) with this command:\n\n```\napptainer pull --dir . --disable-cache docker://ericup/celldetection:latest\n```\n\n\n## \ud83e\udd17 Hugging Face Spaces\n\nFind us on Hugging Face and upload your own images for segmentation: https://huggingface.co/spaces/ericup/celldetection\n\n<details>\n    <summary style=\"font-weight: bold; color: #888888\">Hugging Face API</summary>\n\n### Python\n\n```python\nimport requests\n\nresponse = requests.post(\"https://ericup-celldetection.hf.space/run/predict\", json={\n    \"data\": [\n        \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==\",\n        \"ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c\",\n    ]\n}).json()\n\ndata = response[\"data\"]\n```\n\n### Javascript\n\n```javascript\nconst response = await fetch(\"https://ericup-celldetection.hf.space/run/predict\", {\n    method: \"POST\",\n    headers: {\"Content-Type\": \"application/json\"},\n    body: JSON.stringify({\n        data: [\n            \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==\",\n            \"ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c\",\n        ]\n    })\n});\n\nconst data = await response.json();\n\n```\n\n</details>\n\n## \ud83e\uddd1\u200d\ud83d\udcbb Napari Plugin\n\nFind our Napari Plugin here: https://github.com/FZJ-INM1-BDA/celldetection-napari </br>\nFind out more about Napari here: https://napari.org\n![bbbc039](https://raw.githubusercontent.com/FZJ-INM1-BDA/celldetection-napari/main/assets/coins-demo.png \"Napari Plugin\")\nYou can install it via pip:\n```\npip install git+https://github.com/FZJ-INM1-BDA/celldetection-napari.git\n```\n\n## \ud83c\udfc6 Awards\n\n- [NeurIPS 2022 Cell Segmentation Challenge](https://neurips22-cellseg.grand-challenge.org/): Winner Finalist Award\n\n## \ud83d\udcdd Citing\n\nIf you find this work useful, please consider giving a **star** \u2b50\ufe0f and **citation**:\n\n```\n@article{UPSCHULTE2022102371,\n    title = {Contour proposal networks for biomedical instance segmentation},\n    journal = {Medical Image Analysis},\n    volume = {77},\n    pages = {102371},\n    year = {2022},\n    issn = {1361-8415},\n    doi = {https://doi.org/10.1016/j.media.2022.102371},\n    url = {https://www.sciencedirect.com/science/article/pii/S136184152200024X},\n    author = {Eric Upschulte and Stefan Harmeling and Katrin Amunts and Timo Dickscheid},\n    keywords = {Cell detection, Cell segmentation, Object detection, CPN},\n}\n```\n\n## \ud83d\udd17 Links\n\n- [Article (sciencedirect)](https://www.sciencedirect.com/science/article/pii/S136184152200024X \"Contour Proposal Networks for Biomedical Instance Segmentation\")\n- [PDF (sciencedirect)](https://www.sciencedirect.com/sdfe/reader/pii/S136184152200024X/pdf \"Contour Proposal Networks for Biomedical Instance Segmentation\")\n- [PyPI](https://pypi.org/project/celldetection/ \"CellDetection\")\n- [Documentation](https://docs.celldetection.org \"Documentation\")\n\n## \ud83e\uddd1\u200d\ud83d\udd2c Thanks!\n\n[![Stargazers repo roster for @FZJ-INM1-BDA/celldetection](https://reporoster.com/stars/FZJ-INM1-BDA/celldetection)](https://github.com/FZJ-INM1-BDA/celldetection/stargazers)\n[![Forkers repo roster for @FZJ-INM1-BDA/celldetection](https://reporoster.com/forks/FZJ-INM1-BDA/celldetection)](https://github.com/FZJ-INM1-BDA/celldetection/network/members)\n",
    "bugtrack_url": null,
    "license": "Apache License, Version 2.0",
    "summary": "Cell Detection with PyTorch.",
    "version": "0.4.5",
    "project_urls": {
        "Homepage": "https://celldetection.org"
    },
    "split_keywords": [
        "cell",
        "detection",
        "object",
        "segmentation",
        "pytorch",
        "cpn",
        "contour",
        "proposal",
        "network",
        "deep",
        "learning",
        "unet",
        "fzj",
        "julich",
        "juelich",
        "ai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f08e134eb420fe5651b1ebd379759c55e276da60dc0c17e4824b859d478ed77d",
                "md5": "405b6b558f30d5fe610f53da7e3370ed",
                "sha256": "a9b3152d5a58370a7e8c0162b088e00c236abfc121fe6bbe60525eb8f4369ee1"
            },
            "downloads": -1,
            "filename": "CellDetection-0.4.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "405b6b558f30d5fe610f53da7e3370ed",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 125326,
            "upload_time": "2023-11-15T13:31:02",
            "upload_time_iso_8601": "2023-11-15T13:31:02.488472Z",
            "url": "https://files.pythonhosted.org/packages/f0/8e/134eb420fe5651b1ebd379759c55e276da60dc0c17e4824b859d478ed77d/CellDetection-0.4.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "077f9a5dc21249aadcadb3fc3f0dad0e50720cefbed9cdb2e44879397ceefd56",
                "md5": "571f35d7db7b0a2c2fd1b057a2ccd21b",
                "sha256": "bb0591784167c2b2c9371db902e2aadfe5f5c6f3d5ea9ac5375eb750bd048296"
            },
            "downloads": -1,
            "filename": "CellDetection-0.4.5.tar.gz",
            "has_sig": false,
            "md5_digest": "571f35d7db7b0a2c2fd1b057a2ccd21b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 111972,
            "upload_time": "2023-11-15T13:31:04",
            "upload_time_iso_8601": "2023-11-15T13:31:04.604411Z",
            "url": "https://files.pythonhosted.org/packages/07/7f/9a5dc21249aadcadb3fc3f0dad0e50720cefbed9cdb2e44879397ceefd56/CellDetection-0.4.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-15 13:31:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "celldetection"
}
        
Elapsed time: 0.14912s