Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import cv2
|
|
|
|
| 3 |
from detector import detect_cheating
|
| 4 |
from utils import plot_cheating_graph, update_score
|
| 5 |
|
|
@@ -14,13 +15,18 @@ def process_frame(frame):
|
|
| 14 |
graph = plot_cheating_graph()
|
| 15 |
return frame, graph
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
iface = gr.Interface(
|
| 18 |
fn=process_frame,
|
| 19 |
-
inputs=
|
| 20 |
-
outputs=[
|
| 21 |
-
|
|
|
|
|
|
|
| 22 |
title="AI Proctoring System",
|
| 23 |
-
description="
|
| 24 |
)
|
| 25 |
|
| 26 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import cv2
|
| 3 |
+
import numpy as np
|
| 4 |
from detector import detect_cheating
|
| 5 |
from utils import plot_cheating_graph, update_score
|
| 6 |
|
|
|
|
| 15 |
graph = plot_cheating_graph()
|
| 16 |
return frame, graph
|
| 17 |
|
| 18 |
+
# Updated input to use live webcam
|
| 19 |
+
webcam = gr.Camera(type="image", label="Live Webcam")
|
| 20 |
+
|
| 21 |
iface = gr.Interface(
|
| 22 |
fn=process_frame,
|
| 23 |
+
inputs=webcam,
|
| 24 |
+
outputs=[
|
| 25 |
+
gr.Image(label="Processed Frame"),
|
| 26 |
+
gr.Image(label="Cheating Score Graph")
|
| 27 |
+
],
|
| 28 |
title="AI Proctoring System",
|
| 29 |
+
description="Real-time cheating detection system using webcam input and YOLOv8."
|
| 30 |
)
|
| 31 |
|
| 32 |
iface.launch()
|