Image Classification
Transformers
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") - 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
add "do_center_crop": true to preprocessor_config.json
Browse filesin https://github.com/huggingface/transformers/blob/cecacd374f575ad7ffe37dcd69a98cf00b551011/src/transformers/image_processing_utils_fast.py#L298 the default do_center_crop is None, so it will not crop in https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/image_processing_vit_fast.py
Update to fix
- preprocessor_config.json +2 -1
preprocessor_config.json
CHANGED
|
@@ -6,5 +6,6 @@
|
|
| 6 |
"resample": 3,
|
| 7 |
"size": 440,
|
| 8 |
"crop_size": 384,
|
| 9 |
-
"crop_pct": 0.875
|
|
|
|
| 10 |
}
|
|
|
|
| 6 |
"resample": 3,
|
| 7 |
"size": 440,
|
| 8 |
"crop_size": 384,
|
| 9 |
+
"crop_pct": 0.875,
|
| 10 |
+
"do_center_crop": true
|
| 11 |
}
|