Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from PIL import Image
|
3 |
+
import requests
|
4 |
+
from transformers import pipeline
|
5 |
+
|
6 |
+
# Load the pipeline
|
7 |
+
model_name = "AP4556/Do-Model" #AP4556/Do-Model #vm24bho/net_dfm_myimg
|
8 |
+
pipe = pipeline('image-classification', model=model_name)
|
9 |
+
|
10 |
+
st.title("Deepfake vs Real Image Detection")
|
11 |
+
|
12 |
+
uploaded_file = st.file_uploader("Choose an image...", type="jpg")
|
13 |
+
if uploaded_file is not None:
|
14 |
+
image = Image.open(uploaded_file)
|
15 |
+
st.image(image, caption='Uploaded Image.', use_column_width=True)
|
16 |
+
st.write("")
|
17 |
+
st.write("Classifying...")
|
18 |
+
|
19 |
+
# Apply the model
|
20 |
+
result = pipe(image)
|
21 |
+
|
22 |
+
# Display the result
|
23 |
+
st.write(result)
|