Streamline setup

This commit is contained in:
Evan Peterson
2023-09-15 13:10:05 -06:00
parent ef069f94a9
commit 3f422e4160
3 changed files with 19 additions and 13 deletions
+5
View File
@@ -117,6 +117,9 @@ venv.bak/
# Rope project settings
.ropeproject
# VS Code project settings
.vscode
# mkdocs documentation
/site
@@ -127,3 +130,5 @@ dmypy.json
# Pyre type checker
.pyre/
IDRiD_data
+10 -12
View File
@@ -19,21 +19,17 @@ Keras version implemented by Yuka Kihara can be found [here](https://github.com/
- A [visualisation demo](https://github.com/rmaphoh/RETFound_MAE/blob/main/RETFound_visualize.ipynb) is added
### Install enviroment
### Install environment
Create enviroment with conda:
1. Create environment with conda:
```
conda create -n retfound python=3.7.5 -y
conda activate retfound
```
Install Pytorch 1.81 (cuda 11.1)
```
pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
```
2. Install dependencies
Install others
```
git clone https://github.com/rmaphoh/RETFound_MAE/
cd RETFound_MAE
@@ -43,7 +39,9 @@ pip install -r requirement.txt
### Fine-tuning with RETFound weights
- RETFound pre-trained weights
To fine tune RETFound on your own data, follow these steps:
1. Download the RETFound pre-trained weights
<table><tbody>
<!-- START TABLE -->
<!-- TABLE HEADER -->
@@ -59,14 +57,14 @@ pip install -r requirement.txt
</tr>
</tbody></table>
- Organise data (using IDRiD as an [example](Example.ipynb))
2. Organise your data into this directory structure (using IDRiD as an [example](Example.ipynb))
<p align="left">
<img src="./pic/file_index.jpg" width="160">
</p>
- Start fine-tuning (use IDRiD as example). A fine-tuned checkpoint will be saved during training. Evaluation will be run after training.
3. Start fine-tuning (use IDRiD as example). A fine-tuned checkpoint will be saved during training. Evaluation will be run after training.
```
@@ -85,7 +83,7 @@ python -m torch.distributed.launch --nproc_per_node=1 --master_port=48798 main_f
```
- For evaluation only
4. For evaluation only
```
@@ -106,7 +104,7 @@ python -m torch.distributed.launch --nproc_per_node=1 --master_port=48798 main_f
### Load the model and weights (if you want to call the model in your code)
```
```python
import torch
import models_vit
from util.pos_embed import interpolate_pos_embed
+4 -1
View File
@@ -1,3 +1,7 @@
--find-links https://download.pytorch.org/whl/torch_stable.html
torch==1.8.1+cu111
torchvision==0.9.1+cu111
torchaudio==0.8.1
opencv-python==4.5.3.56
pandas==0.25.3
Pillow==8.3.1
@@ -12,4 +16,3 @@ tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.0
timm==0.3.2
tqdm==4.62.1