Instructions to use DhruvJariwala/deepfake_vs_real_image_detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DhruvJariwala/deepfake_vs_real_image_detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="DhruvJariwala/deepfake_vs_real_image_detection") 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("DhruvJariwala/deepfake_vs_real_image_detection") model = AutoModelForImageClassification.from_pretrained("DhruvJariwala/deepfake_vs_real_image_detection", device_map="auto") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
This is a model finetuned on "google/vit-base-patch16-224-in21k" model for the image classification task to detect if the image is deepfake or not. Use following commands for inference.
import libraries
from transformers import pipeline from PIL import Image
Create a pipeline for image classification tasks.
model_name = "DhruvJariwala/deepfake_vs_real_image_detection"
- 'device': Specifies the device to use for running the model (0 for GPU, -1 for CPU).
pipe = pipeline('image-classification', model=model_name, device=0)
#load the image image_path = "/you_input_path/your_image.jpg" # Replace this with the path to your image image = Image.open(image_path)
Apply the 'pipe' function to process the 'image' variable.
pipe(image)
- Downloads last month
- 205