Instructions to use thegoatcc/classpulse-edge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use thegoatcc/classpulse-edge with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("thegoatcc/classpulse-edge", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Download verify_dataset.py from thegoatcc/classpulse-edge: direct link, hf CLI and curl.
- Browser
- Download file 2.21 kB
-
https://huggingface.co/thegoatcc/classpulse-edge/resolve/main/verify_dataset.py
- Command line
-
hf download hf://thegoatcc/classpulse-edge/verify_dataset.py
-
curl -L -o verify_dataset.py https://huggingface.co/thegoatcc/classpulse-edge/resolve/main/verify_dataset.py
2.21 kB
| from __future__ import annotations | |
| import json | |
| from pathlib import Path | |
| import sqlite3 | |
| import numpy as np | |
| from modules.ingestion.frame_sampler import FrameSampler | |
| DB_PATH = Path("data/classroom.db") | |
| def main() -> None: | |
| print("=== 1. CAMERA HARDWARE PROBE (LAPTOP + USB WEBCAMS) ===") | |
| cams = FrameSampler.probe_available_cameras(max_index=4) | |
| if not cams: | |
| print(" [WARN] No active webcams detected.") | |
| else: | |
| for c in cams: | |
| print(f" [OK] Camera {c['index']}: {c['label']} @ {c['resolution']}") | |
| print("\n=== 2. SQLITE DATASET INTEGRITY AUDIT (data/classroom.db) ===") | |
| if not DB_PATH.exists(): | |
| print(" [INFO] data/classroom.db will be created when main.py starts.") | |
| return | |
| conn = sqlite3.connect(DB_PATH) | |
| conn.row_factory = sqlite3.Row | |
| tables = [ | |
| "courses", "lecturers", "students", "course_enrollments", | |
| "enrolled_face_profiles", "class_sessions", "frame_sightings", | |
| "attendance_sightings", "attendance_logs", "unknown_faces", | |
| "attention_logs", "behavior_logs", "flagged_events", | |
| ] | |
| for t in tables: | |
| cnt = conn.execute(f"SELECT COUNT(*) AS c FROM {t}").fetchone()["c"] | |
| print(f" - {t:<24}: {cnt} row(s)") | |
| print("\n=== 3. UPLOADED COURSES & STUDENTS CHECK ===") | |
| for c in conn.execute("SELECT course_code, course_name FROM courses").fetchall(): | |
| print(f" Course: [{c['course_code']}] {c['course_name']}") | |
| for s in conn.execute("SELECT student_id, student_name FROM students").fetchall(): | |
| profs = conn.execute( | |
| "SELECT profile_id, source_image, embedding_vector FROM enrolled_face_profiles WHERE student_id = ?", | |
| (s["student_id"],), | |
| ).fetchall() | |
| dims = [len(json.loads(p["embedding_vector"])) for p in profs] | |
| norms = [round(float(np.linalg.norm(json.loads(p["embedding_vector"]))), 4) for p in profs] | |
| print( | |
| f" Student: [{s['student_id']}] {s['student_name']} -> {len(profs)} real face profile(s) " | |
| f"(dims={dims}, L2_norms={norms})" | |
| ) | |
| conn.close() | |
| if __name__ == "__main__": | |
| main() | |