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")# pip install -U transformers accelerate # 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
Update config.json
Browse files- config.json +28 -26
config.json
CHANGED
|
@@ -1,30 +1,32 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
"
|
| 12 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
},
|
| 14 |
-
"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
"
|
| 19 |
-
"Real": 0
|
| 20 |
},
|
| 21 |
-
"
|
| 22 |
-
"
|
| 23 |
-
"
|
| 24 |
-
"num_channels": 3,
|
| 25 |
-
"num_hidden_layers": 12,
|
| 26 |
-
"patch_size": 16,
|
| 27 |
-
"qkv_bias": true,
|
| 28 |
-
"torch_dtype": "float32",
|
| 29 |
-
"transformers_version": "4.48.3"
|
| 30 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"model": {
|
| 3 |
+
"variant": "vit_small_patch16_384.augreg_in21k_ft_in1k",
|
| 4 |
+
"input_size": 384,
|
| 5 |
+
"patch_size": 16,
|
| 6 |
+
"freeze_backbone": false,
|
| 7 |
+
"hidden_size": 384,
|
| 8 |
+
"num_hidden_layers": 12,
|
| 9 |
+
"num_attention_heads": 12,
|
| 10 |
+
"qkv_bias": true,
|
| 11 |
+
"num_channels": 3,
|
| 12 |
+
"hidden_act": "gelu",
|
| 13 |
+
"hidden_dropout_prob": 0.0,
|
| 14 |
+
"attention_probs_dropout_prob": 0.0,
|
| 15 |
+
"layer_norm_eps": 1e-6,
|
| 16 |
+
"num_classes": 1,
|
| 17 |
+
"head": {
|
| 18 |
+
"in_features": 384,
|
| 19 |
+
"out_features": 1,
|
| 20 |
+
"bias": true
|
| 21 |
+
}
|
| 22 |
},
|
| 23 |
+
"preprocessing": {
|
| 24 |
+
"norm_mean": [0.48145466, 0.4578275, 0.40821073],
|
| 25 |
+
"norm_std": [0.26862954, 0.26130258, 0.27577711],
|
| 26 |
+
"resize_size": 440,
|
| 27 |
+
"crop_size": 384
|
|
|
|
| 28 |
},
|
| 29 |
+
"device": "cuda",
|
| 30 |
+
"dtype": "float32",
|
| 31 |
+
"checkpoint_path": "pretrained_weights/model_v11_ViT_384_base_ckpt.pt"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
}
|