Instructions to use dchen0/font-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dchen0/font-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="dchen0/font-classifier") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("dchen0/font-classifier") model = AutoModelForImageClassification.from_pretrained("dchen0/font-classifier") - Notebooks
- Google Colab
- Kaggle
Clarify provenance: promoted from lora_r8/result_model in font-model-results
Browse files
README.md
CHANGED
|
@@ -21,7 +21,7 @@ A DINOv2 Vision Transformer fine-tuned with LoRA for font classification across
|
|
| 21 |
|
| 22 |
1. **Base model**: [facebook/dinov2-base-imagenet1k-1-layer](https://huggingface.co/facebook/dinov2-base-imagenet1k-1-layer) (87.2M parameters, frozen).
|
| 23 |
2. **Fine-tuning**: [LoRA](https://arxiv.org/abs/2106.09685) (rank 8, alpha 16) applied to the query and value projections in each ViT attention block, plus a trainable classification head. ~900K trainable parameters (1% of total).
|
| 24 |
-
3. **
|
| 25 |
|
| 26 |
## Performance
|
| 27 |
|
|
|
|
| 21 |
|
| 22 |
1. **Base model**: [facebook/dinov2-base-imagenet1k-1-layer](https://huggingface.co/facebook/dinov2-base-imagenet1k-1-layer) (87.2M parameters, frozen).
|
| 23 |
2. **Fine-tuning**: [LoRA](https://arxiv.org/abs/2106.09685) (rank 8, alpha 16) applied to the query and value projections in each ViT attention block, plus a trainable classification head. ~900K trainable parameters (1% of total).
|
| 24 |
+
3. **Promotion**: This model was promoted from the `lora_r8/result_model` adapter in [dchen0/font-model-results](https://huggingface.co/dchen0/font-model-results) using `promote_model.py`. That script loads the base DINOv2 model, merges the LoRA adapter weights into it (`merge_and_unload()`), and uploads the result as a standalone checkpoint. No adapter or PEFT library needed at inference time.
|
| 25 |
|
| 26 |
## Performance
|
| 27 |
|