Downloads · 30 days
27
47% of all-time downloads
btehubsolutions/alertdrive-model
alertdrive-model is a image classification model from btehubsolutions. Use it when you need a label for an image. It is set up for keras. The card lists the license as mit.
AlertDrive AI is a lightweight, production-grade driver drowsiness detection system designed for high-performance deployment on both cloud servers and resource-constrained edge devices (e.g., in-vehicle embedded syste…
Downloads · 30 days
27
47% of all-time downloads
All-time downloads
58
Public
Repo size
30.2 MB
Likes
1
Trending 1
Click a slice to open those files.
.h514 MB · 46%
From the Hugging Face model README
AlertDrive AI is a lightweight, production-grade driver drowsiness detection system designed for high-performance deployment on both cloud servers and resource-constrained edge devices (e.g., in-vehicle embedded systems, Raspberry Pi, and mobile devices).
This repository hosts both the fully optimized fine-tuned functional Keras Model (.h5) and the highly optimized Float16 Quantized TFLite Model (.tflite).
DROWSY, 1 = NATURAL / Alert)| Model Variant | Test Accuracy | ROC AUC | Model Size | Target Deployment Platform |
|---|---|---|---|---|
| Keras Fine-Tuned (.h5) | 93.18% | 0.9890 | 13.31 MB | High-end Edge Systems / Cloud Servers |
| Quantized TFLite (Float16) | 93.32% | 0.9890 | 4.94 MB | Microcontrollers / Low-resource Edge Devices |
The Float16 quantized model achieves a 62.9% reduction in model footprint while perfectly preserving evaluation accuracy.
from huggingface_hub import hf_hub_download
import tensorflow as tf
# Download and load model
model_path = hf_hub_download(
repo_id="btehubsolutions/alertdrive-model",
filename="alertdrive_finetuned_model.h5"
)
model = tf.keras.models.load_model(model_path)
# Perform inference
# input_image must be preprocessed to (224, 224, 3) and rescaled by 1/255.0
prediction = model.predict(input_image)
class_label = "NATURAL" if prediction[0][0] > 0.5 else "DROWSY"
import numpy as np
import tensorflow as tf
from huggingface_hub import hf_hub_download
# Download TFLite model file
tflite_path = hf_hub_download(
repo_id="btehubsolutions/alertdrive-model",
filename="alertdrive_model_quantized.tflite"
)
# Initialize Interpreter
interpreter = tf.lite.Interpreter(model_path=tflite_path)
interpreter.allocate_tensors()
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()
# Input image array shape must be [1, 224, 224, 3] and float32 normalized
interpreter.set_tensor(input_details[0]['index'], input_image_array)
interpreter.invoke()
output_data = interpreter.get_tensor(output_details[0]['index'])
class_label = "NATURAL" if output_data[0][0] > 0.5 else "DROWSY"
To complement the classifiers, the production deployment codebase supports active facial telemetry extraction:
SAFE, WARNING ALERT, CRITICAL ALERT).To ensure driver-safety features never experience fatal runtime crashes, the pipeline incorporates an automatic Mathematical Fallback Pipeline that gracefully estimates nominal metrics even if local environments experience library incompatibilities or missing system camera devices.
Developed by the BTEHub Team for deployment within Nigerian Road Safety and transport environments.