Instructions to use SivaResearch/Fake_Detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SivaResearch/Fake_Detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="SivaResearch/Fake_Detection", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModelForImageClassification model = AutoModelForImageClassification.from_pretrained("SivaResearch/Fake_Detection", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
| from transformers import PreTrainedModel | |
| from facenet_pytorch import MTCNN, InceptionResnetV1 | |
| from .deepfakeconfig import DeepFakeConfig | |
| class DeepFakeModel(PreTrainedModel): | |
| config_class = DeepFakeConfig | |
| def __init__(self, config): | |
| super().__init__(config) | |
| self.model = InceptionResnetV1( | |
| pretrained="vggface2", | |
| classify=True, | |
| num_classes=1, | |
| device=config.DEVICE | |
| ) | |
| DeepFakeConfig.register_for_auto_class() | |
| DeepFakeModel.register_for_auto_class("AutoModelForImageClassification") |