Push model using huggingface_hub.
Browse files- README.md +3 -68
- model.safetensors +2 -2
README.md
CHANGED
|
@@ -3,73 +3,8 @@ pipeline_tag: image-classification
|
|
| 3 |
tags:
|
| 4 |
- model_hub_mixin
|
| 5 |
- pytorch_model_hub_mixin
|
| 6 |
-
- OCT
|
| 7 |
-
- retinal-imaging
|
| 8 |
-
- classification
|
| 9 |
---
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
Project page: [RetFiner](https://github.com/ronnief1/RetFiner)
|
| 15 |
-
|
| 16 |
-
### Required Libraries
|
| 17 |
-
This model requires specific Python libraries:
|
| 18 |
-
```bash
|
| 19 |
-
torch==2.4.1+cu118
|
| 20 |
-
timm==0.4.12
|
| 21 |
-
torchvision==0.19.1+cu118
|
| 22 |
-
```
|
| 23 |
-
|
| 24 |
-
To use this model, please download the ViT implementation from [vit.py](https://github.com/ronnief1/RetFiner/blob/main/RetFiner/vit.py).
|
| 25 |
-
|
| 26 |
-
Note: if you are using this for downstream inference, adjust the num_classes based on the target dataset.
|
| 27 |
-
|
| 28 |
-
```python
|
| 29 |
-
import torch
|
| 30 |
-
import torch.nn as nn
|
| 31 |
-
from huggingface_hub import PyTorchModelHubMixin
|
| 32 |
-
from vit import vit_base_patch16
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
class RetFiner(nn.Module, PyTorchModelHubMixin):
|
| 36 |
-
"""RetFiner: Fine-tuned ViT models for retinal image analysis"""
|
| 37 |
-
|
| 38 |
-
def __init__(self, model_name: str = "RetFiner-UrFound", num_classes: int = 2, **kwargs):
|
| 39 |
-
super().__init__()
|
| 40 |
-
|
| 41 |
-
self.model = vit_base_patch16(
|
| 42 |
-
img_size=224,
|
| 43 |
-
num_classes=num_classes,
|
| 44 |
-
drop_path_rate=0.1,
|
| 45 |
-
global_pool=False,
|
| 46 |
-
use_proj=False,
|
| 47 |
-
**kwargs
|
| 48 |
-
)
|
| 49 |
-
|
| 50 |
-
self.config = {
|
| 51 |
-
"num_classes": num_classes,
|
| 52 |
-
**kwargs
|
| 53 |
-
}
|
| 54 |
-
|
| 55 |
-
def forward(self, x):
|
| 56 |
-
return self.model(x)
|
| 57 |
-
|
| 58 |
-
model = RetFiner.from_pretrained('ronnief1/RetFiner-UrFound')
|
| 59 |
-
```
|
| 60 |
-
|
| 61 |
-
## Citation
|
| 62 |
-
|
| 63 |
-
Please cite the original paper if you use this model:
|
| 64 |
-
|
| 65 |
-
```python
|
| 66 |
-
@misc{fecso2025retfinervisionlanguagerefinementscheme,
|
| 67 |
-
title={RetFiner: A Vision-Language Refinement Scheme for Retinal Foundation Models},
|
| 68 |
-
author={Ronald Fecso and José Morano and Ursula Schmidt-Erfurth and Hrvoje Bogunović},
|
| 69 |
-
year={2025},
|
| 70 |
-
eprint={2506.22149},
|
| 71 |
-
archivePrefix={arXiv},
|
| 72 |
-
primaryClass={cs.CV},
|
| 73 |
-
url={https://arxiv.org/abs/2506.22149},
|
| 74 |
-
}
|
| 75 |
-
```
|
|
|
|
| 3 |
tags:
|
| 4 |
- model_hub_mixin
|
| 5 |
- pytorch_model_hub_mixin
|
|
|
|
|
|
|
|
|
|
| 6 |
---
|
| 7 |
|
| 8 |
+
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
|
| 9 |
+
- Library: ronnief1/RetFiner
|
| 10 |
+
- Docs: [More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9727f3662ef3fd159888882fb7078582695dc552ee4aeb40f84105d412fd44e2
|
| 3 |
+
size 343209448
|