Downloads · 30 days
0
DhanushSGowda/yolov8n-gender-classification
yolov8n-gender-classification is a image classification model from DhanushSGowda. Use it when you need a label for an image. The card lists the license as mit.
This repository contains a YOLOv8 classification model trained to identify gender (Male/Female) using the Gender Classification Dataset.
Downloads · 30 days
0
Access
Public
Updated Feb 3, 2026
Repo size
9.5 MB
Likes
3
Public
Click a slice to open those files.
.pt3 MB · 100%
From the Hugging Face model README
This repository contains a YOLOv8 classification model trained to identify gender (Male/Female) using the Gender Classification Dataset.
Architecture: YOLOv8n-cls (Nano Classification)
Task: Single-label Image Classification
Classes: 2 (Male, Female)
Framework: Ultralytics YOLOv8
The model was trained on the Gender Classification Dataset from Kaggle.
Train Images: 47,009
Validation Images: 11,649
Structure: Folder-based classification (each class in its own subdirectory).
The dataset used for this training (Gender Classification Dataset) does not provide explicit citations or provenance for the images included.
Privacy: Be aware that this dataset contains biometric data (faces). Use of this model should comply with local privacy laws (e.g., GDPR, CCPA).
Bias: Classification models trained on facial data can inherit biases present in the source imagery.
Proper Use: This model is intended for educational and research purposes.
The model reached high accuracy within 10 epochs.
| Metric | Value |
| Top-1 Accuracy | 0.977 (97.7%) |
| Top-5 Accuracy | 1.0 |
| Training Time | ~0.636 hours (Tesla T4) |
| Model Size | 3.0 MB (FP16) |
Ensure you have the latest Ultralytics package installed.
pip install ultralytics
This is the recommended way to run inference using the official ultralytics API.
from ultralytics import YOLO
# 1. Load your custom-trained model
model = YOLO("best.pt")
# 2. Run inference on an image
# source can be a path, URL, PIL image, or OpenCV array
results = model.predict(source="path/to/image.jpg", imgsz=224)
# 3. Process results
for result in results:
# Print the top-1 class name and confidence
top1_idx = result.probs.top1
top1_conf = result.probs.top1conf.item()
print(f"Predicted Class: {result.names[top1_idx]} with {top1_conf:.4f} confidence")
# Optional: Display or save the annotated image
# result.show()
# result.save(filename='result.jpg')
You can also run predictions directly from your terminal:
yolo classify predict model=best.pt source='path/to/image.jpg'
For reproducibility, the following parameters were used during training:
from ultralytics import YOLO
import torch
# Load a pretrained YOLOv8n-cls model
model = YOLO("yolov8n-cls.pt")
# Start training
model.train(
data="path/to/dataset", # Root directory of your dataset
epochs=10,
batch=128,
imgsz=224,
device="cuda" if torch.cuda.is_available() else "cpu",
verbose=True
)
To use this model in mobile or web applications, you can export it to various formats:
model.export(format="onnx") # ONNX for general deployment
model.export(format="tflite") # TFLite for mobile/Android
model.export(format="coreml") # CoreML for iOS