Streamline setup
This commit is contained in:
@@ -117,6 +117,9 @@ venv.bak/
|
|||||||
# Rope project settings
|
# Rope project settings
|
||||||
.ropeproject
|
.ropeproject
|
||||||
|
|
||||||
|
# VS Code project settings
|
||||||
|
.vscode
|
||||||
|
|
||||||
# mkdocs documentation
|
# mkdocs documentation
|
||||||
/site
|
/site
|
||||||
|
|
||||||
@@ -127,3 +130,5 @@ dmypy.json
|
|||||||
|
|
||||||
# Pyre type checker
|
# Pyre type checker
|
||||||
.pyre/
|
.pyre/
|
||||||
|
|
||||||
|
IDRiD_data
|
||||||
|
|||||||
@@ -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
|
- 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 create -n retfound python=3.7.5 -y
|
||||||
conda activate retfound
|
conda activate retfound
|
||||||
```
|
```
|
||||||
|
|
||||||
Install Pytorch 1.81 (cuda 11.1)
|
2. Install dependencies
|
||||||
```
|
|
||||||
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
|
|
||||||
```
|
|
||||||
|
|
||||||
Install others
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/rmaphoh/RETFound_MAE/
|
git clone https://github.com/rmaphoh/RETFound_MAE/
|
||||||
cd RETFound_MAE
|
cd RETFound_MAE
|
||||||
@@ -43,7 +39,9 @@ pip install -r requirement.txt
|
|||||||
|
|
||||||
### Fine-tuning with RETFound weights
|
### 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>
|
<table><tbody>
|
||||||
<!-- START TABLE -->
|
<!-- START TABLE -->
|
||||||
<!-- TABLE HEADER -->
|
<!-- TABLE HEADER -->
|
||||||
@@ -59,14 +57,14 @@ pip install -r requirement.txt
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</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">
|
<p align="left">
|
||||||
<img src="./pic/file_index.jpg" width="160">
|
<img src="./pic/file_index.jpg" width="160">
|
||||||
</p>
|
</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)
|
### Load the model and weights (if you want to call the model in your code)
|
||||||
|
|
||||||
```
|
```python
|
||||||
import torch
|
import torch
|
||||||
import models_vit
|
import models_vit
|
||||||
from util.pos_embed import interpolate_pos_embed
|
from util.pos_embed import interpolate_pos_embed
|
||||||
|
|||||||
+4
-1
@@ -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
|
opencv-python==4.5.3.56
|
||||||
pandas==0.25.3
|
pandas==0.25.3
|
||||||
Pillow==8.3.1
|
Pillow==8.3.1
|
||||||
@@ -12,4 +16,3 @@ tensorboard-data-server==0.6.1
|
|||||||
tensorboard-plugin-wit==1.8.0
|
tensorboard-plugin-wit==1.8.0
|
||||||
timm==0.3.2
|
timm==0.3.2
|
||||||
tqdm==4.62.1
|
tqdm==4.62.1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user