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.0.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.0-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: retinalysis_inference-0.7.0.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.0.tar.gz
Algorithm Hash digest
SHA256 9f4782d4e1511f8dd69903ae8cd1a19358666fdb9fde3ee1ea3231fcff22a4e7
MD5 8db6b350b66acb21087051e167fe5657
BLAKE2b-256 a1e0303e338367e4d9153bddeeab915531d04a16cd5cd2165b0ca91aa1231c36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for retinalysis_inference-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f70e48b8d951cd771a098e8af09de83c9ffe2f6f9417ead169fb27d34d20791
MD5 2d80a05668f701d7ae1f1e2194f166f4
BLAKE2b-256 f6824e64cb82b0f0c8159b84fa7cced437923c55a32dd168173713dea06c2d6c

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