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.
- VascX models are available in this huggingface repository but don't need to be downloaded manually. See this notebook.
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
- 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.
- Install rtnls_fundusprep and rtnls-inference:
pip install retinalysis-fundusprep
pip install retinalysis-inference
-
Done! You can now download and use rtnls-inference ensembles. See this notebook for an example. The models are automatically downloaded from huggingface.
-
(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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9ce81138b1459315b3aa40fb1d6ddbaa0979214cf808ff7c19b42fb7f1fc237
|
|
| MD5 |
52762ae9d212b368fecbd280f7d07d9e
|
|
| BLAKE2b-256 |
bf6e33fa06449534ef1e2d73c5dbe1ff66cfd441c34627956638314fceb4b205
|
File details
Details for the file retinalysis_inference-0.5.0-py3-none-any.whl.
File metadata
- Download URL: retinalysis_inference-0.5.0-py3-none-any.whl
- Upload date:
- Size: 43.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2169cfd906ecd53d4c4d2ab6258e173f2639bcf720de6da50a91dab55aa8aed0
|
|
| MD5 |
8835860bf84d203c984c6d649f21939c
|
|
| BLAKE2b-256 |
8ad2c77e49b35cb2937538afaa3370aa64623f2c76fafddf5e4b6659125d0def
|