File size: 1,318 Bytes
db651b7
 
 
 
 
 
 
 
 
 
 
 
f036ad4
9d09bdd
f036ad4
 
797d116
 
 
 
 
 
f036ad4
 
6d2185b
 
 
797d116
6d2185b
 
 
 
 
e2bd3a1
 
6d2185b
 
 
 
 
 
 
f036ad4
 
9d09bdd
 
 
f036ad4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6d2185b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
title: Diabetic Retinopathy Detection
emoji: 👁️
colorFrom: gray
colorTo: pink
sdk: gradio
sdk_version: 4.32.2
app_file: app.py
pinned: false
license: apache-2.0
---

# Diabetic Retinopathy Detection with AI

## Setup

### Cloning the repo

```bash
git clone https://github.com/SDAIA-KAUST-AI/diabetic-retinopathy-detection.git
```

### Gradio app environment

Install from pip requirements file:

```bash
conda create -y -n retinopathy_app python=3.10
conda activate retinopathy_app
pip install -r requirements.txt
python app.py
```

The app will download 280 MB of files from S3 and launch.

Install manually:

```bash
pip install pytorch --index-url  https://download.pytorch.org/whl/cpu
pip install gradio
pip install transformers
```

### Training environment

Create conda environment from YAML:
```bash
mamba env create -n retinopathy_train -f environment.yml
```

Download the data from [Kaggle](https://www.kaggle.com/competitions/diabetic-retinopathy-detection/data) or use kaggle API:

```bash
pip install kaggle
kaggle competitions download -c diabetic-retinopathy-detection
mkdir retinopathy_data/
unzip diabetic-retinopathy-detection.zip -d retinopathy_data/
```

Launch training:
```bash
conda activate retinopathy_train
python train.py
```
The trained model will be put into `lightning_logs/`.