{"id":28206930,"url":"https://github.com/fzj-inm1-bda/celldetection","last_synced_at":"2025-06-11T22:31:06.747Z","repository":{"id":71026120,"uuid":"349111085","full_name":"FZJ-INM1-BDA/celldetection","owner":"FZJ-INM1-BDA","description":"Scalable Instance Segmentation using PyTorch \u0026 PyTorch Lightning.","archived":false,"fork":false,"pushed_at":"2025-04-22T15:50:43.000Z","size":16190,"stargazers_count":139,"open_issues_count":14,"forks_count":21,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-24T13:05:27.375Z","etag":null,"topics":["cell-counting","cell-detection","cell-segmentation","celldetection","cpn","deep-learning","fpn","instance-segmentation","mask-rcnn","object-detection","pytorch","semantic-segmentation","unet"],"latest_commit_sha":null,"homepage":"https://docs.celldetection.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FZJ-INM1-BDA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-18T14:49:03.000Z","updated_at":"2025-05-20T06:09:06.000Z","dependencies_parsed_at":"2023-02-25T04:45:42.478Z","dependency_job_id":"3445d7c9-e040-4603-a3a4-d74c7b7cd9dd","html_url":"https://github.com/FZJ-INM1-BDA/celldetection","commit_stats":{"total_commits":354,"total_committers":1,"mean_commits":354.0,"dds":0.0,"last_synced_commit":"63dc0b75631586fe524f3c8dfb02f16db5ec193b"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/FZJ-INM1-BDA/celldetection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FZJ-INM1-BDA%2Fcelldetection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FZJ-INM1-BDA%2Fcelldetection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FZJ-INM1-BDA%2Fcelldetection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FZJ-INM1-BDA%2Fcelldetection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FZJ-INM1-BDA","download_url":"https://codeload.github.com/FZJ-INM1-BDA/celldetection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FZJ-INM1-BDA%2Fcelldetection/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259354760,"owners_count":22844923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cell-counting","cell-detection","cell-segmentation","celldetection","cpn","deep-learning","fpn","instance-segmentation","mask-rcnn","object-detection","pytorch","semantic-segmentation","unet"],"created_at":"2025-05-17T12:14:50.060Z","updated_at":"2025-06-11T22:31:06.734Z","avatar_url":"https://github.com/FZJ-INM1-BDA.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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## ⭐ 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## 🛠 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## 💾 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 | [🔗](https://celldetection.org/torch/models/ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c.pt) |\n\n\u003cdetails\u003e\n  \u003csummary style=\"font-weight: bold; color: #888888\"\u003eRun a demo with a pretrained model\u003c/summary\u003e\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] -\u003e 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\u003c/details\u003e\n\n## 🔬 Architectures\n\n```python\nimport celldetection as cd\n```\n\n\u003cdetails\u003e\n  \u003csummary style=\"font-weight: bold; color: #888888\"\u003eContour Proposal Networks\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary style=\"font-weight: bold; color: #888888\"\u003ePyTorch Image Models (timm)\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary style=\"font-weight: bold; color: #888888\"\u003eSegmentation Models PyTorch (smp)\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary style=\"font-weight: bold; color: #888888\"\u003eU-Nets\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary style=\"font-weight: bold; color: #888888\"\u003eMA-Nets\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary style=\"font-weight: bold; color: #888888\"\u003eFeature Pyramid Networks\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary style=\"font-weight: bold; color: #888888\"\u003eConvNeXt Networks\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary style=\"font-weight: bold; color: #888888\"\u003eResidual Networks\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary style=\"font-weight: bold; color: #888888\"\u003eMobile Networks\u003c/summary\u003e\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\u003c/details\u003e\n\n## 🐳 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\u003cdetails\u003e\n    \u003csummary style=\"font-weight: bold; color: #888888\"\u003eCPN inference via Docker with GPU\u003c/summary\u003e\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\u003c/details\u003e\n\u003cdetails\u003e\n    \u003csummary style=\"font-weight: bold; color: #888888\"\u003eCPN inference via Docker with CPU\u003c/summary\u003e\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\u003c/details\u003e\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## 🤗 Hugging Face Spaces\n\nFind us on Hugging Face and upload your own images for segmentation: https://huggingface.co/spaces/ericup/celldetection\n\nThere's also an API (Python \u0026 JavaScript), allowing you to utilize community GPUs (currently Nvidia A100) remotely!\n\n\u003cdetails\u003e\n    \u003csummary style=\"font-weight: bold; color: #888888\"\u003eHugging Face API\u003c/summary\u003e\n\n### Python\n\n```python\nfrom gradio_client import Client\n\n# Define inputs (local filename or URL)\ninputs = 'https://raw.githubusercontent.com/scikit-image/scikit-image/main/skimage/data/coins.png'\n\n# Set up client\nclient = Client(\"ericup/celldetection\")\n\n# Predict\noverlay_filename, img_filename, h5_filename, csv_filename = client.predict(\n    inputs,  # str: Local filepath or URL of your input image\n    \n    # Model name\n    'ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c',\n    \n    # Custom Score Threshold (numeric value between 0 and 1)\n    False, .9,  # bool: Whether to use custom setting; float: Custom setting\n    \n    # Custom NMS Threshold\n    False, .3142,  # bool: Whether to use custom setting; float: Custom setting\n    \n    # Custom Number of Sample Points\n    False, 128,  # bool: Whether to use custom setting; int: Custom setting\n    \n    # Overlapping objects\n    True,  # bool: Whether to allow overlapping objects\n    \n    # API name (keep as is)\n    api_name=\"/predict\"\n)\n\n\n# Example usage: Code below only shows how to use the results\nfrom matplotlib import pyplot as plt\nimport celldetection as cd\nimport pandas as pd\n\n# Read results from local temporary files\nimg = imread(img_filename)\noverlay = imread(overlay_filename)  # random colors per instance; transparent overlap\nproperties = pd.read_csv(csv_filename)\ncontours, scores, label_image = cd.from_h5(h5_filename, 'contours', 'scores', 'labels')\n\n# Optionally display overlay\ncd.imshow_row(img, img, figsize=(16, 9))\ncd.imshow(overlay)\nplt.show()\n\n# Optionally display contours with text\ncd.imshow_row(img, img, figsize=(16, 9))\ncd.plot_contours(contours, texts=['score: %d%%\\narea: %d' % s for s in zip((scores * 100).round(), properties.area)])\nplt.show()\n```\n\n### Javascript\n\n```javascript\nimport { client } from \"@gradio/client\";\n\nconst response_0 = await fetch(\"https://raw.githubusercontent.com/scikit-image/scikit-image/main/skimage/data/coins.png\");\nconst exampleImage = await response_0.blob();\n\t\t\t\t\t\t\nconst app = await client(\"ericup/celldetection\");\nconst result = await app.predict(\"/predict\", [\n    exampleImage,  // blob: Your input image\n    \n    // Model name (hosted model or URL)\n    \"ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c\",\n    \n    // Custom Score Threshold (numeric value between 0 and 1)\n    false, .9,  // bool: Whether to use custom setting; float: Custom setting\n    \n    // Custom NMS Threshold\n    false, .3142,  // bool: Whether to use custom setting; float: Custom setting\n    \n    // Custom Number of Sample Points\n    false, 128,  // bool: Whether to use custom setting; int: Custom setting\n    \n    // Overlapping objects\n    true,  // bool: Whether to allow overlapping objects\n    \n    // API name (keep as is)\n    api_name=\"/predict\"\n]);\n```\n\n\u003c/details\u003e\n\n## 🧑‍💻 Napari Plugin\n\nFind our Napari Plugin here: https://github.com/FZJ-INM1-BDA/celldetection-napari \u003c/br\u003e\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## 🏆 Awards\n\n- [NeurIPS 2022 Cell Segmentation Challenge](https://neurips22-cellseg.grand-challenge.org/): Winner Finalist Award\n\n## 📝 Citing\n\nIf you find this work useful, please consider giving a **star** ⭐️ 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## 🔗 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/science/article/pii/S136184152200024X/pdfft \"Contour Proposal Networks for Biomedical Instance Segmentation\")\n- [PyPI](https://pypi.org/project/celldetection/ \"CellDetection\")\n- [Documentation](https://docs.celldetection.org \"Documentation\")\n\n## 🧑‍🔬 Thanks!\n\n[![Stargazers repo roster for @FZJ-INM1-BDA/celldetection](http://reporoster.com/stars/FZJ-INM1-BDA/celldetection)](https://github.com/FZJ-INM1-BDA/celldetection/stargazers)\n[![Forkers repo roster for @FZJ-INM1-BDA/celldetection](http://reporoster.com/forks/FZJ-INM1-BDA/celldetection)](https://github.com/FZJ-INM1-BDA/celldetection/network/members)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzj-inm1-bda%2Fcelldetection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffzj-inm1-bda%2Fcelldetection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzj-inm1-bda%2Fcelldetection/lists"}