Sazzz02 commited on
Commit
79772b4
·
verified ·
1 Parent(s): 1024902

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
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=gr.Image(source="webcam", streaming=True),
20
- outputs=[gr.Image(label="Live Feed"), gr.Image(label="Cheating Score Graph")],
21
- live=True,
 
 
22
  title="AI Proctoring System",
23
- description="Detects cheating based on number of persons and head orientation using YOLOv8."
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()