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.6.1.tar.gz (10.2 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.6.1-py3-none-any.whl (48.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: retinalysis_inference-0.6.1.tar.gz
  • Upload date:
  • Size: 10.2 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.6.1.tar.gz
Algorithm Hash digest
SHA256 f3f27d8fc66038f648e61f7c992bf3191d3ad83dd8a176d8d624babfa767a580
MD5 59b1117f9723002668f4b6a936086bb0
BLAKE2b-256 ed40e270bfc5c3d06632b21377acbee937a53b7f7a4206e56aed9a8dd56dd991

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for retinalysis_inference-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba4c7be44996e93dd4d1a77e6de03169dab47209e20372e724795e258b7a185f
MD5 66be643f2ed91822a67461e5ed0bbc5e
BLAKE2b-256 11de4cffd6b141a93caf7dee1d90c29c371c427a05400e05e371d2244bf4ff18

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