Update README.md
Browse files
README.md
CHANGED
@@ -2,10 +2,73 @@
|
|
2 |
license: cc-by-nc-4.0
|
3 |
pipeline_tag: image-segmentation
|
4 |
tags:
|
|
|
|
|
|
|
5 |
- model_hub_mixin
|
6 |
- pytorch_model_hub_mixin
|
7 |
---
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
license: cc-by-nc-4.0
|
3 |
pipeline_tag: image-segmentation
|
4 |
tags:
|
5 |
+
- artery-vein
|
6 |
+
- retinal-imaging
|
7 |
+
- segmentation
|
8 |
- model_hub_mixin
|
9 |
- pytorch_model_hub_mixin
|
10 |
---
|
11 |
|
12 |
+
# rrwnet-rite
|
13 |
+
|
14 |
+
This repo contains the the official weights of the RRWNet model trained on the RITE dataset, from the paper ["RRWNet: Recursive Refinement Network for Effective Retinal Artery/Vein Segmentation and Classification"](https://doi.org/10.1016/j.eswa.2024.124970), by José Morano, Guilherme Aresta, and Hrvoje Bogunović, published in _Expert Systems with Applications_ (2024).
|
15 |
+
|
16 |
+
[[`arXiv`](https://doi.org/10.48550/arXiv.2402.03166)] [`ESWA`](https://doi.org/10.1016/j.eswa.2024.124970)] [[`GitHub`](https://github.com/j-morano/rrwnet)] [[`BibTeX`](#citation)]
|
17 |
+
|
18 |
+
|
19 |
+

|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
## RRWNet models
|
24 |
+
|
25 |
+
Model | Dataset | Train resolution | Weights
|
26 |
+
--- | --- | --- | ---
|
27 |
+
RRWNet | RITE | 720x576 (original) | [Download](https://huggingface.co/j-morano/rrwnet-rite)
|
28 |
+
RRWNet | HRF | 1024 width (resized) | [Download](https://huggingface.co/j-morano/rrwnet-hrf)
|
29 |
+
|
30 |
+
Please note that the size of the images used for training is important when using the weights for predictions.
|
31 |
+
|
32 |
+
|
33 |
+
## Usage
|
34 |
+
|
35 |
+
The model can be loaded using the `PyTorchModelHubMixin` from the `huggingface_hub` package and the code from the `model.py` file in our repo (<https://github.com/j-morano/rrwnet>).
|
36 |
+
|
37 |
+
```python
|
38 |
+
from huggingface_hub import PyTorchModelHubMixin
|
39 |
+
from model import RRWNet as RRWNetModel
|
40 |
+
|
41 |
+
|
42 |
+
class RRWNet(RRWNetModel, PyTorchModelHubMixin):
|
43 |
+
def __init__(self, input_ch=3, output_ch=3, base_ch=64, iterations=5):
|
44 |
+
super().__init__(input_ch, output_ch, base_ch, iterations)
|
45 |
+
|
46 |
+
|
47 |
+
model = RRWNet.from_pretrained("j-morano/rrwnet-hrf")
|
48 |
+
```
|
49 |
+
|
50 |
+
|
51 |
+
## Preprocessing
|
52 |
+
|
53 |
+
Models are trained using enhanced images and masks.
|
54 |
+
You can preprocess the images offline using the `preprocessing.py` script in the repo.
|
55 |
+
The script will enhance the images and masks and save them in the specified directory.
|
56 |
+
|
57 |
+
```bash
|
58 |
+
python3 preprocessing.py --images-path data/images/ --masks-path data/masks/ --save-path data/enhanced
|
59 |
+
```
|
60 |
+
|
61 |
+
|
62 |
+
## Citation
|
63 |
+
|
64 |
+
If you use this code, the weights, the preprocessed data, or the predictions in your research, we would greatly appreciate it if you give a star to the repo and cite our work:
|
65 |
+
|
66 |
+
```
|
67 |
+
@article{morano2024rrwnet,
|
68 |
+
title={RRWNet: Recursive Refinement Network for Effective Retinal Artery/Vein Segmentation and Classification},
|
69 |
+
author={Morano, Jos{\'e} and Aresta, Guilherme and Bogunovi{\'c}, Hrvoje},
|
70 |
+
journal={Expert Systems with Applications},
|
71 |
+
year={2024},
|
72 |
+
doi={10.1016/j.eswa.2024.124970}
|
73 |
+
}
|
74 |
+
```
|