Image Feature Extraction
Transformers
Safetensors
timm
edgeface
feature-extraction
face-recognition
face-verification
face-embedding
custom_code
Instructions to use anjith2006/edgeface with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anjith2006/edgeface with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="anjith2006/edgeface", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("anjith2006/edgeface", trust_remote_code=True, device_map="auto") - timm
How to use anjith2006/edgeface with timm:
import timm model = timm.create_model("hf_hub:anjith2006/edgeface", pretrained=True) - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -20,12 +20,12 @@ EdgeFace replaces the classifier of an `edgenext` (timm) backbone with a 512-d e
|
|
| 20 |
|
| 21 |
## Model variants
|
| 22 |
|
| 23 |
-
| Subfolder | Backbone | Low-rank ratio | Params |
|
| 24 |
-
|---|---|---|---|
|
| 25 |
-
| `edgeface-base` | `edgenext_base` | — | ~18 M |
|
| 26 |
-
| `edgeface-s-gamma-05` | `edgenext_small` | 0.5 | ~5 M |
|
| 27 |
-
| `edgeface-xs-gamma-06` | `edgenext_x_small` | 0.6 | ~3 M |
|
| 28 |
-
| `edgeface-xxs` | `edgenext_xx_small` | — | ~1 M |
|
| 29 |
|
| 30 |
## Installation
|
| 31 |
|
|
@@ -38,6 +38,16 @@ pip install mediapipe opencv-python
|
|
| 38 |
|
| 39 |
## Quick start
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
```python
|
| 42 |
import torch
|
| 43 |
import torch.nn.functional as F
|
|
@@ -136,6 +146,15 @@ model = get_peft_model(model, lora_cfg)
|
|
| 136 |
model.print_trainable_parameters()
|
| 137 |
```
|
| 138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
|
| 140 |
## License
|
| 141 |
|
|
|
|
| 20 |
|
| 21 |
## Model variants
|
| 22 |
|
| 23 |
+
| Subfolder | Backbone | Low-rank ratio | Params | |
|
| 24 |
+
|---|---|---|---|---|
|
| 25 |
+
| `edgeface-base` | `edgenext_base` | — | ~18 M | **default** |
|
| 26 |
+
| `edgeface-s-gamma-05` | `edgenext_small` | 0.5 | ~5 M | |
|
| 27 |
+
| `edgeface-xs-gamma-06` | `edgenext_x_small` | 0.6 | ~3 M | |
|
| 28 |
+
| `edgeface-xxs` | `edgenext_xx_small` | — | ~1 M | |
|
| 29 |
|
| 30 |
## Installation
|
| 31 |
|
|
|
|
| 38 |
|
| 39 |
## Quick start
|
| 40 |
|
| 41 |
+
### Pipeline (default — edgeface-xxs)
|
| 42 |
+
|
| 43 |
+
```python
|
| 44 |
+
from transformers import pipeline
|
| 45 |
+
|
| 46 |
+
pipe = pipeline("image-feature-extraction", model="anjith2006/edgeface", trust_remote_code=True)
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
### AutoModel (any variant)
|
| 50 |
+
|
| 51 |
```python
|
| 52 |
import torch
|
| 53 |
import torch.nn.functional as F
|
|
|
|
| 146 |
model.print_trainable_parameters()
|
| 147 |
```
|
| 148 |
|
| 149 |
+
## Source files
|
| 150 |
+
|
| 151 |
+
| File | Purpose |
|
| 152 |
+
|---|---|
|
| 153 |
+
| `configuration_edgeface.py` | `EdgeFaceConfig` |
|
| 154 |
+
| `modeling_edgeface.py` | `EdgeFaceModel`, `LowRankLinear`, `EdgeFaceOutput` |
|
| 155 |
+
| `image_processing_edgeface.py` | `EdgeFaceImageProcessor` (MediaPipe alignment + normalize) |
|
| 156 |
+
| `convert_edgeface.py` | Download original `.pt` checkpoints, convert, push |
|
| 157 |
+
| `example.py` | Same-person / different-person sanity check |
|
| 158 |
|
| 159 |
## License
|
| 160 |
|