YOLOv8 Nano model used for real-time AI-powered exam proctoring in the GradicAI platform.
Source du modèle
Description de la source
YOLOv8 Nano model used for real-time AI-powered exam proctoring in the GradicAI platform.
This is the standard model from , pre-trained on the COCO dataset. It is used as-is (no fine-tuning) for the GradicAI proctoring service to detect prohibited objects and suspicious behavior during online exams.
Sources
1 sourceVérifié 5 août
Artefacts du modèle
1 artefactExtraits de sources
2 extraits| Property | Value |
|---|---|
| Architecture | YOLOv8 Nano |
| Parameters | 3.2M |
| Model Size | ~6 MB |
| Training Data | COCO (80 classes) |
| Input Resolution | 640×640 |
| Inference Speed | ~100-300ms (CPU) |
Out of the 80 COCO classes, GradicAI uses only 3 for proctoring:
| COCO Class ID | Label | Proctoring Action |
|---|---|---|
| 0 | person | Count persons — warn if 0 or >1 |
| 67 | cell phone | ⚠️ Warning: phone detected |
| 73 | book | ⚠️ Warning: study material detected |
if person_count == 0 → "face_absent" warning
if person_count > 1 → "multiple_persons" warning
if phone detected → "phone" warning
if book detected → "book" warning
3 warnings → exam terminated
pip install ultralytics
from ultralytics import YOLO
# Load model
model = YOLO("yolov8n.pt")
# Run inference on an image
results = model("exam_frame.jpg", conf=0.25)
# Process detections
for box in results[0].boxes:
cls = int(box.cls[0])
conf = float(box.conf[0])
label = results[0].names[cls]
print(f"Detected: {label} ({conf:.2f})")
import base64
import io
import numpy as np
from PIL import Image
from ultralytics import YOLO
PERSON_CLASS = 0
PHONE_CLASS = 67
BOOK_CLASS = 73
model = YOLO("yolov8n.pt")
def analyze_frame(b64_data: str) -> dict:
"""Analyze a base64-encoded webcam frame for proctoring violations."""
if "," in b64_data:
b64_data = b64_data.split(",", 1)[1]
raw = base64.b64decode(b64_data)
img = Image.open(io.BytesIO(raw)).convert("RGB")
frame = np.array(img)
results = model(frame, verbose=False, conf=0.25)[0]
persons = 0
violations = []
for box in results.boxes:
cls = int(box.cls[0])
if cls == PERSON_CLASS:
persons += 1
elif cls == PHONE_CLASS:
violations.append("phone")
elif cls == BOOK_CLASS:
violations.append("book")
if persons == 0:
violations.append("face_absent")
elif persons > 1:
violations.append("multiple_persons")
return {"violations": violations, "person_count": persons}
This model powers the proctoring feature of GradicAI — an AI-powered exam and grading platform:
The YOLOv8 model is released under the AGPL-3.0 license by Ultralytics.
@software{yolov8_ultralytics,
author = {Glenn Jocher and Ayush Chaurasia and Jing Qiu},
title = {Ultralytics YOLOv8},
version = {8.0.0},
year = {2023},
url = {https://github.com/ultralytics/ultralytics},
license = {AGPL-3.0}
}
--- license: agpl-3.0 library_name: ultralytics pipeline_tag: object-detection tags: - yolov8 - object-detection - proctoring - exam-monitoring - ultralytics - coco datasets: - coco metrics: - map language: - en --- # 🎓 YOLOv8n — GradicAI Exam Proctoring **YOLOv8 Nano** model used for real-time AI-powered exam proctoring in the [GradicAI](https://github.com/asna14/GradicAI) platform. ## Model Description This is the standard **YOLOv8n (nano)** model from [Ultralytics](https://docs.ultralytics.com/), pre-trained on the COCO dataset. It is used as-is (no fine-tuning) for the GradicAI proctoring service to detect prohibited objects and suspicious behavior during online exams. | Property | Value | |---|---| | **Architecture** | YOLOv8 Nano | | **Parameters** | 3.2M | | **Model Size** | ~6 MB | | **Training Data** | COCO (80 classes) | | **Input Resolution** | 640×640 | | **Inference Speed** | ~100-300ms (CPU) | ## Classes Used for Proctoring Out of the 80 COCO classes, GradicAI uses only 3 for proctoring: | COCO Class ID | Label | Proctoring Action | |---|---|---| | 0 | `person` | Count persons — warn if 0 or >1 | | 67 | `cell phone` | ⚠️ Warning: phone detected | | 73 | `book` | ⚠️ Warning: study material detected | ## Violation Logic ``` if person_count == 0 → "face_absent" warning if person_count > 1 → "multiple_persons" warning if phone detected → "phone" warning if book detected → "book" warning 3 warnings → exam terminated ``` ## How to Use ### Installation ```bash pip install ultralytics ``` ### Python Inference ```python from ultralytics import YOLO # Load model model = YOLO("yolov8n.pt") # Run inference on an image results = model("exam_frame.jpg", conf=0.25) # Process detections for box in results[0].boxes: cls = int(box.cls[0]) conf = float(box.conf[0]) label = results[0].names[cls] print(f"Detected: {label} ({conf:.2f})") ``` ### Integration with GradicAI Proctoring ```python import base64 import io import numpy as np from PIL import Image from ultralytics import YOLO PERSON_CLASS = 0 PHONE_CLASS = 67 BOOK_CLASS = 73 model = YOLO("yolov8n.pt") def analyze_frame(b64_data: str) -> dict: """Analyze a base64-encoded webcam frame for proctoring violations.""" if "," in b64_data: b64_data = b64_data.split(",", 1)[1] raw = base64.b64decode(b64_data) img = Image.open(io.BytesIO(raw)).convert("RGB") frame = np.a...
Source context: 17 downloads · 0 likes · Pipeline object-detection · Library ultralytics · Repo asna14/yolov8n-proctoring