Image Classification
Transformers
ONNX
Safetensors
timm
vit
detection
deepfake
forensics
deepfake_detection
community
opensight
Instructions to use buildborderless/CommunityForensics-DeepfakeDet-ViT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use buildborderless/CommunityForensics-DeepfakeDet-ViT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="buildborderless/CommunityForensics-DeepfakeDet-ViT") 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("buildborderless/CommunityForensics-DeepfakeDet-ViT") model = AutoModelForImageClassification.from_pretrained("buildborderless/CommunityForensics-DeepfakeDet-ViT", device_map="auto") - timm
How to use buildborderless/CommunityForensics-DeepfakeDet-ViT with timm:
import timm model = timm.create_model("hf_hub:buildborderless/CommunityForensics-DeepfakeDet-ViT", pretrained=True) - Inference
- Notebooks
- Google Colab
- Kaggle
docs: remove test_app references, update ONNX count to 5 variants
Browse files
AGENTS.md
CHANGED
|
@@ -9,8 +9,7 @@ Hugging Face model repo for `buildborderless/CommunityForensics-DeepfakeDet-ViT`
|
|
| 9 |
- **`preprocessor_config.json`** β CLIP-style normalization, resize to 440, center-crop to 384
|
| 10 |
- **`modeling_vit_classifier.py`** β **DEPRECATED** (moved to `scripts/`). Use standard HF path below.
|
| 11 |
- **`pretrained_weights/`** β original `.pt` checkpoints from training (also LFS)
|
| 12 |
-
- **`onnx/`** β
|
| 13 |
-
- **`test_app/`** β local Gradio app for testing PyTorch vs ONNX, benchmarking, and comparison
|
| 14 |
|
| 15 |
## Usage
|
| 16 |
The model is hosted on Hugging Face. The standard way to load it is via `transformers`:
|
|
|
|
| 9 |
- **`preprocessor_config.json`** β CLIP-style normalization, resize to 440, center-crop to 384
|
| 10 |
- **`modeling_vit_classifier.py`** β **DEPRECATED** (moved to `scripts/`). Use standard HF path below.
|
| 11 |
- **`pretrained_weights/`** β original `.pt` checkpoints from training (also LFS)
|
| 12 |
+
- **`onnx/`** β 5 pre-exported ONNX variants (16MBβ84MB) for CPU/GPU deployment. See README for variant guide.
|
|
|
|
| 13 |
|
| 14 |
## Usage
|
| 15 |
The model is hosted on Hugging Face. The standard way to load it is via `transformers`:
|
README.md
CHANGED
|
@@ -143,19 +143,6 @@ logits = output[0][0] # shape [2]: [real_score, fake_score]
|
|
| 143 |
|
| 144 |
## Local Test App
|
| 145 |
|
| 146 |
-
A local Gradio app for testing PyTorch and ONNX models side by side with benchmarks:
|
| 147 |
-
|
| 148 |
-
```bash
|
| 149 |
-
git clone https://huggingface.co/buildborderless/CommunityForensics-DeepfakeDet-ViT
|
| 150 |
-
cd CommunityForensics-DeepfakeDet-ViT
|
| 151 |
-
pip install -r test_app/requirements.txt
|
| 152 |
-
python test_app/app.py
|
| 153 |
-
```
|
| 154 |
-
|
| 155 |
-
Three tabs: PyTorch vs ONNX comparison, Benchmark (all 8 ONNX variants on test images), and help.
|
| 156 |
-
|
| 157 |
-
---
|
| 158 |
-
|
| 159 |
## Citation
|
| 160 |
|
| 161 |
```bibtex
|
|
|
|
| 143 |
|
| 144 |
## Local Test App
|
| 145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
## Citation
|
| 147 |
|
| 148 |
```bibtex
|