/ Модель

Характеристики

Лицензия
CC BY-NC-ND 4.0
Архитектура
mobilenet_v2 · dense
Опубликована
22 июл 2024

open-closed-eye-classification-mobilev2

Классификация изображенийИзображение → label3 профессии

Дообученный MobileNetV2 классифицирует изображения глаз как открытые или закрытые, в том числе для обнаружения признаков сонливости.

107скачиваний за 30 дней1лайквеса обновлены23 июл 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель разработал Michał Młodawski: это дообученная версия MobileNetV2 для классификации изображений глаз на открытые и закрытые. В README указана базовая модель google/mobilenet_v2_1.4_224 и заявлена точность 99%; репозиторий содержит варианты PyTorch, Safetensors и ONNX. Модель принимает изображение и выдаёт один из двух классов: «глаза открыты» или «глаза закрыты».

Классификатор подходит для оценки закрытости глаз на изображениях, например, в системах обнаружения сонливости водителя, анализа внимательности и обработки фотографий. Датасет карточки — MichalMlodawski/closed-open-eyes. Лицензия CC BY-NC-ND 4.0 запрещает коммерческое использование и распространение производных версий. Качество зависит от входных изображений; заявленная точность не подтверждена описанием условий оценки, поэтому результаты нужно проверять перед применением, особенно в критически важных системах.

Сценарии применения

  • определение закрытых глаз на фотографии
  • обнаружение признаков сонливости водителя
  • оценка внимательности по изображению лица
  • проверка положения глаз при анализе фотографий
  • классификация состояния глаз в интерфейсах взаимодействия с человеком

Ограничения

Заявленная точность 99% не сопровождается описанием условий и методики оценки, а результат зависит от качества и характера изображения. Модель не следует использовать как единственное основание для решений в критически важных системах без проверки; лицензия CC BY-NC-ND 4.0 ограничивает коммерческое использование и распространение производных версий.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

👁️ Open-Closed Eye Classification mobilenet_v2 👁️

Model Overview 🔍

This model is a fine-tuned version of mobilenet_v2, specifically designed for classifying images of eyes as either open or closed. With an impressive accuracy of 99%, this classifier excels in distinguishing between open and closed eyes in various contexts.

Model Details 📊

  • Model Name: open-closed-eye-classification-focalnet-base
  • Base Model: google/mobilenet_v2_1.4_224
  • Fine-tuned By: Michał Młodawski
  • Categories:
    • 0: Closed Eyes 😴
    • 1: Open Eyes 👀
  • Accuracy: 99% 🎯

Use Cases 💡

This high-accuracy model is particularly useful for applications involving:

  • Driver Drowsiness Detection 🚗
  • Attentiveness Monitoring in Educational Settings 🏫
  • Medical Diagnostics related to Eye Conditions 🏥
  • Facial Analysis in Photography and Videography 📸
  • Human-Computer Interaction Systems 💻

How It Works 🛠️

The model takes an input image and classifies it into one of two categories:

  • Closed Eyes (0): Images where the subject's eyes are fully or mostly closed.
  • Open Eyes (1): Images where the subject's eyes are open.

The classification leverages the advanced image processing capabilities of the FocalNet architecture, fine-tuned on a carefully curated dataset of eye images.

Getting Started 🚀

To start using the open-closed-eye-classification-focalnet-base, you can integrate it into your projects with the following steps:

Installation

pip install transformers==4.37.2
pip install torch==2.3.1
pip install Pillow

Usage

import os
from PIL import Image
import torch
from torchvision import transforms
from transformers import AutoImageProcessor, MobileNetV2ForImageClassification

# Path to the folder with images
image_folder = ""
# Path to the model
model_path = "MichalMlodawski/open-closed-eye-classification-mobilev2"

# List of jpg files in the folder
jpg_files = [file for file in os.listdir(image_folder) if file.lower().endswith(".jpg")]

# Check if there are jpg files in the folder
if not jpg_files:
    print("🚫 No jpg files found in folder:", image_folder)
    exit()

# Load the model and image processor
image_processor = AutoImageProcessor.from_pretrained(model_path)
model = MobileNetV2ForImageClassification.from_pretrained(model_path)
model.eval()

# Image transformations
transform = transforms.Compose([
    transforms.Resize((256, 256)),
    transforms.ToTensor()
])

# Processing and prediction for each image
results = []
for jpg_file in jpg_files:
    selected_image = os.path.join(image_folder, jpg_file)
    image = Image.open(selected_image).convert("RGB")
    image_tensor = transform(image).unsqueeze(0)
    
    # Process image using image_processor
    inputs = image_processor(images=image, return_tensors="pt")
    
    # Prediction using the model
    with torch.no_grad():
        outputs = model(**inputs)
        probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
        confidence, predicted = torch.max(probabilities, 1)
    
    results.append((jpg_file, predicted.item(), confidence.item() * 100))

# Display results
print("🖼️  Image Classification Results 🖼️")
print("=" * 40)

for jpg_file, prediction, confidence in results:
    emoji = "👁️" if prediction == 1 else "❌"
    confidence_bar = "🟩" * int(confidence // 10) + "⬜" * (10 - int(confidence // 10))
    
    print(f"📄 File name: {jpg_file}")
    print(f"{emoji} Prediction: {'Open' if prediction == 1 else 'Closed'}")
    print(f"🎯 Confidence: {confidence:.2f}% {confidence_bar}")
    print(f"{'=' * 40}")

print("🏁 Classification completed! 🎉")

Disclaimer ⚠️

This model is provided for research and development purposes only. The creators and distributors of this model do not assume any legal responsibility for its use or misuse. Users are solely responsible for ensuring that their use of this model complies with applicable laws, regulations, and ethical standards. The model's performance may vary depending on the quality and nature of input images. Always validate results in critical applications.

🚫 Do not use this model for any illegal, unethical, or potentially harmful purposes.

📝 Please note that while the model demonstrates high accuracy, it should not be used as a sole decision-making tool in safety-critical systems without proper validation and human oversight.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · image-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
MobileNetV2ForImageClassification
Ревизия весов
5d0e623

0 моделей