Spaces:
Sleeping
Sleeping
from transformers import pipeline | |
import gradio as gr | |
from transformers import pipeline | |
video_model = pipeline("video-classification", model="Rohit1412/deepfakerohit2.0") | |
def classify_video(video): | |
# Classify the uploaded video and return the results | |
predictions = video_model(video) | |
# Create a dictionary of labels and their corresponding scores | |
result = {pred["label"]: pred["score"] for pred in predictions} | |
# Return the result dictionary | |
return result | |
# Create Gradio interface | |
interface = gr.Interface( | |
fn=classify_video, | |
inputs=gr.Video(label="Upload Video"), | |
outputs=gr.Label(num_top_classes=3, label="Predictions"), | |
title="Video deepfake Classification App", | |
description="Upload a video to classify its content." | |
) | |
# Launch the interface | |
if __name__ == "__main__": | |
interface.launch(debug=True) |