ronnief1 commited on
Commit
b8aaa06
·
verified ·
1 Parent(s): 52c5cbc

Push model using huggingface_hub.

Browse files
Files changed (2) hide show
  1. README.md +3 -70
  2. model.safetensors +2 -2
README.md CHANGED
@@ -3,75 +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
- ## RetFiner-RETFound
13
- This repo contains the weights of RetFiner-RETFound from the paper [RetFiner: A Vision-Language Refinement Scheme for Retinal Foundation Models](https://arxiv.org/abs/2506.22149).
14
-
15
- Project page: [RetFiner](https://github.com/ronnief1/RetFiner)
16
-
17
-
18
- ### Required Libraries
19
- This model requires specific Python libraries:
20
- ```bash
21
- torch==2.4.1+cu118
22
- timm==0.4.12
23
- torchvision==0.19.1+cu118
24
- ```
25
-
26
- To use the model, please download the ViT implementation from [vit.py](https://github.com/ronnief1/RetFiner/blob/main/RetFiner/vit.py)
27
-
28
- Note: if you are using this for downstream inference, adjust the num_classes based on the target dataset.
29
-
30
- ```python
31
- import torch
32
- import torch.nn as nn
33
- from huggingface_hub import PyTorchModelHubMixin
34
- from vit import vit_large_patch16
35
-
36
- class RetFiner(nn.Module, PyTorchModelHubMixin):
37
- """RetFiner: Fine-tuned ViT models for retinal image analysis"""
38
-
39
- def __init__(self, model_name: str = "RetFiner-RETFound", num_classes: int = 2, **kwargs):
40
- super().__init__()
41
-
42
- self.model = vit_large_patch16(
43
- img_size=224,
44
- num_classes=num_classes,
45
- drop_path_rate=0.1,
46
- global_pool=False,
47
- use_proj=True,
48
- **kwargs
49
- )
50
-
51
- self.config = {
52
- "num_classes": num_classes,
53
- **kwargs
54
- }
55
-
56
- def forward(self, x):
57
- return self.model(x)
58
-
59
- model = RetFiner.from_pretrained('ronnief1/RetFiner-RETFound')
60
- ```
61
-
62
-
63
- ## Citation
64
-
65
- Please cite the original paper if you use this model:
66
-
67
- ```python
68
- @misc{fecso2025retfinervisionlanguagerefinementscheme,
69
- title={RetFiner: A Vision-Language Refinement Scheme for Retinal Foundation Models},
70
- author={Ronald Fecso and José Morano and Ursula Schmidt-Erfurth and Hrvoje Bogunović},
71
- year={2025},
72
- eprint={2506.22149},
73
- archivePrefix={arXiv},
74
- primaryClass={cs.CV},
75
- url={https://arxiv.org/abs/2506.22149},
76
- }
77
- ```
 
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:ca1aca0c2dcac3382b9b96c21049915ac6f24c09ad48639332f5e36104b9b857
3
- size 1216393632
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72c72a88f4e9cb81f1cfba56bbdeeccfeee36e0b741fce8748e0b4d0020174c3
3
+ size 1216385256