|
|
--- |
|
|
tags: |
|
|
- object-detection |
|
|
- rf-detr |
|
|
- commonforms |
|
|
datasets: |
|
|
- jbarrow/CommonForms |
|
|
--- |
|
|
|
|
|
# RF-DETR Fine-tuned on CommonForms |
|
|
|
|
|
This model is an RF-DETR (small) fine-tuned on the [CommonForms](jbarrow/CommonForms) dataset for form field detection. |
|
|
|
|
|
## Model Details |
|
|
|
|
|
- **Model Type:** RF-DETR small |
|
|
- **Dataset:** jbarrow/CommonForms |
|
|
- **Classes:** 3 |
|
|
- **Epochs:** 1 |
|
|
- **Batch Size:** 4 (grad_accum: 4) |
|
|
|
|
|
## Classes |
|
|
|
|
|
[ |
|
|
{ |
|
|
"id": 0, |
|
|
"name": "class_0", |
|
|
"supercategory": "form_element" |
|
|
}, |
|
|
{ |
|
|
"id": 1, |
|
|
"name": "class_1", |
|
|
"supercategory": "form_element" |
|
|
}, |
|
|
{ |
|
|
"id": 2, |
|
|
"name": "class_2", |
|
|
"supercategory": "form_element" |
|
|
} |
|
|
] |
|
|
|
|
|
## Usage |
|
|
|
|
|
```python |
|
|
import torch |
|
|
from PIL import Image |
|
|
|
|
|
# Load model |
|
|
model_path = "path/to/rfdetr_model.pt" |
|
|
# Note: You'll need the rfdetr library installed |
|
|
from rfdetr import RFDETRSmall |
|
|
|
|
|
model = RFDETRSmall() |
|
|
model.load_state_dict(torch.load(model_path)) |
|
|
model.eval() |
|
|
|
|
|
# Run inference |
|
|
image = Image.open("form.jpg") |
|
|
predictions = model.predict(image) |
|
|
print(predictions) |
|
|
``` |
|
|
|
|
|
## Training Details |
|
|
|
|
|
- Learning Rate: 0.0001 |
|
|
- Effective Batch Size: 16 |
|
|
- Dataset: Trained on CommonForms (form field detection) |
|
|
|
|
|
## Metrics |
|
|
|
|
|
(Add your evaluation metrics here after running evaluation) |
|
|
|
|
|
## Citation |
|
|
|
|
|
```bibtex |
|
|
@misc{rfdetr-commonforms, |
|
|
author = {Your Name}, |
|
|
title = {RF-DETR Fine-tuned on CommonForms}, |
|
|
year = {2024}, |
|
|
publisher = {HuggingFace}, |
|
|
howpublished = {\url{https://huggingface.co/andrewluo/rfdetr-commonforms-test}} |
|
|
} |
|
|
``` |
|
|
|