Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ if st.button("Check News"):
|
|
23 |
st.subheader("πΈ Deepfake Image Detection")
|
24 |
uploaded_image = st.file_uploader("Upload an Image", type=["jpg", "png", "jpeg"])
|
25 |
|
26 |
-
def compress_image(image, quality=50, max_size=(
|
27 |
img = Image.open(image).convert("RGB")
|
28 |
img.thumbnail(max_size)
|
29 |
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".jpg")
|
@@ -58,7 +58,7 @@ def compress_video(video):
|
|
58 |
|
59 |
# β
Further Reduce Video Resolution
|
60 |
frame_width = 200
|
61 |
-
frame_height =
|
62 |
out = cv2.VideoWriter(temp_file.name, fourcc, 12.0, (frame_width, frame_height)) # β
Lower FPS to 12
|
63 |
|
64 |
while cap.isOpened():
|
|
|
23 |
st.subheader("πΈ Deepfake Image Detection")
|
24 |
uploaded_image = st.file_uploader("Upload an Image", type=["jpg", "png", "jpeg"])
|
25 |
|
26 |
+
def compress_image(image, quality=50, max_size=(20, 20)): # β
Better quality & small size
|
27 |
img = Image.open(image).convert("RGB")
|
28 |
img.thumbnail(max_size)
|
29 |
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".jpg")
|
|
|
58 |
|
59 |
# β
Further Reduce Video Resolution
|
60 |
frame_width = 200
|
61 |
+
frame_height = 50
|
62 |
out = cv2.VideoWriter(temp_file.name, fourcc, 12.0, (frame_width, frame_height)) # β
Lower FPS to 12
|
63 |
|
64 |
while cap.isOpened():
|