Gonzalo Plaza commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,28 +9,23 @@ pipeline_tag: image-segmentation
|
|
| 9 |
|
| 10 |
## Available checkpoints
|
| 11 |
|
| 12 |
-
We present the
|
| 13 |
|
| 14 |
Datasets, training and inference details can be found in our [GitHub repository](`https://github.com/GonzaloPlaaza/OCULAR`).
|
| 15 |
|
| 16 |
-
|
| 17 |
-
### OCULARNet
|
| 18 |
-
- OCULARNet.pth
|
| 19 |
-
|
| 20 |
-
### Nano OCULARNet
|
| 21 |
-
- nano_fold1.pth
|
| 22 |
-
- nano_fold2.pth
|
| 23 |
-
- nano_fold3.pth
|
| 24 |
-
- nano_fold4.pth
|
| 25 |
-
- nano_fold5.pth
|
| 26 |
-
|
| 27 |
## Usage
|
| 28 |
|
| 29 |
```python
|
| 30 |
import torch
|
| 31 |
|
| 32 |
device = torch.device('cuda:0' if use_cuda else 'cpu')
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
|
|
|
| 9 |
|
| 10 |
## Available checkpoints
|
| 11 |
|
| 12 |
+
We present the OCULARNet model, a base UNet encoder - (256, 128, 64, 32) layer size - coupled with a RepVGG-B3 decoder loaded from `segmentation_models_pytorch` for retinal artery-vein segmentation.
|
| 13 |
|
| 14 |
Datasets, training and inference details can be found in our [GitHub repository](`https://github.com/GonzaloPlaaza/OCULAR`).
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
## Usage
|
| 17 |
|
| 18 |
```python
|
| 19 |
import torch
|
| 20 |
|
| 21 |
device = torch.device('cuda:0' if use_cuda else 'cpu')
|
| 22 |
+
checkpoint = torch.load("OCULARNet.pth", map_location=device)
|
| 23 |
+
|
| 24 |
+
if "model_state_dict" in checkpoint:
|
| 25 |
+
state_dict = checkpoint["model_state_dict"]
|
| 26 |
+
else:
|
| 27 |
+
state_dict = checkpoint
|
| 28 |
+
|
| 29 |
+
model.load_state_dict(state_dict)
|
| 30 |
+
|
| 31 |
|