Skip to main content

Retinal model inference package

Project description

Retinalysis models inference

This repository implements inference ensembles for retinalysis model releases. It includes the same pre-processing code that was used to train the models. For example, fundus preprocessing will detect bounds, crop the smalles square that contains these bounds, and resize it to a fixed resolution, currently 1024x1024px.

Models have been tested to run on a single nvidia GPU with at least 10GB VRAM. Using them for distributed inference in multiple GPUs will require some adaptation.

Installation

  1. Install torch and torchvision that match your cuda environment. For example:
pip3 install torch torchvision torchaudio  # pip and CUDA 12
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia # conda and CUDA 12
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 # pip and CUDA 11
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia # conda and CUDA 11

Pytorch installation instructions are here.

We did not include torch as a dependency of rtnls-inference. These must be installed manually beforehand.

  1. Install rtnls_fundusprep and rtnls-inference:
pip install retinalysis-fundusprep
pip install retinalysis-inference
  1. Done! You can now download and use rtnls-inference ensembles. See this notebook for an example. The models are automatically downloaded from huggingface.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retinalysis_inference-0.7.1.tar.gz (12.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

retinalysis_inference-0.7.1-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file retinalysis_inference-0.7.1.tar.gz.

File metadata

  • Download URL: retinalysis_inference-0.7.1.tar.gz
  • Upload date:
  • Size: 12.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for retinalysis_inference-0.7.1.tar.gz
Algorithm Hash digest
SHA256 d4a16306f2078137228a75227826f6cbce28a2555b25abc82129d775f4bc116b
MD5 3c82ac3d26dcd27422bd8416f320c173
BLAKE2b-256 028c3b44a7cce3c49a473989721edbe149dede33adb34aeb7f42bbcb6ce0c25e

See more details on using hashes here.

File details

Details for the file retinalysis_inference-0.7.1-py3-none-any.whl.

File metadata

File hashes

Hashes for retinalysis_inference-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77f648b2c122cd691b2e2a59fec593f1ac0b8a3dc131e0501a9e69edb46f3199
MD5 d98c17f98a4504cb7af3893f15df5394
BLAKE2b-256 ef3dd6ca17e31c697553292c3824f46f52ee259fb8c6a1d6030c812d6bebfe33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page