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.

  2. (optional) To be able to load manually-downloaded models by name from a folder define:

export RTNLS_MODEL_RELEASES = /path/to/models

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.5.0.tar.gz (49.0 kB 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.5.0-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: retinalysis_inference-0.5.0.tar.gz
  • Upload date:
  • Size: 49.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for retinalysis_inference-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a9ce81138b1459315b3aa40fb1d6ddbaa0979214cf808ff7c19b42fb7f1fc237
MD5 52762ae9d212b368fecbd280f7d07d9e
BLAKE2b-256 bf6e33fa06449534ef1e2d73c5dbe1ff66cfd441c34627956638314fceb4b205

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for retinalysis_inference-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2169cfd906ecd53d4c4d2ab6258e173f2639bcf720de6da50a91dab55aa8aed0
MD5 8835860bf84d203c984c6d649f21939c
BLAKE2b-256 8ad2c77e49b35cb2937538afaa3370aa64623f2c76fafddf5e4b6659125d0def

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