Downloads · 30 days
17
7% of all-time downloads
h43lb1t0/yolo12l-person-seg
yolo12l-person-seg is a object detection model from h43lb1t0. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as agpl-3.0.
A YOLO12-large (YOLO12l) instance segmentation model trained specifically for detecting and segmenting people with high precision.
Downloads · 30 days
17
7% of all-time downloads
All-time downloads
259
Public
Repo size
351 MB
Likes
1
Public
Click a slice to open those files.
.onnx230 MB · 66%
From the Hugging Face model README
A YOLO12-large (YOLO12l) instance segmentation model trained specifically for detecting and segmenting people with high precision.
This model is a fine-tuned YOLO12-seg model optimized exclusively for person segmentation. It uses the large (L) scale configuration of YOLO12, featuring 28.76M parameters and 510 layers with a depth and width of 1.0.
This repository contains two model versions:
yolo12l-person-seg.pt: The original model trained for 100 epochs.yolo12l-person-seg-extended.pt: The improved model after extended training for 300 epochs
(recommended).The model was trained on a filtered version of the COCO dataset containing only images with people:
single_cls=True and classes=0overlap_mask=True and mask_ratio=4The model achieves the following metrics on the COCO person validation set:
| Metric | Value |
|---|---|
| Box mAP50-95 (COCO) | 0.642 |
| Box mAP50 (COCO) | 0.851 |
| Mask mAP50-95 | 0.537 |
| Mask mAP50 | 0.837 |
| Box Precision | 0.840 |
| Box Recall | 0.759 |
| Mask Precision | 0.843 |
| Mask Recall | 0.748 |
Note: These metrics reflect the performance of the extended 300-epoch model
(yolo12l-person-seg-extended.pt).
These metrics were computed on the standard COCO val2017 validation set.
The model effectively segments people in various poses, lighting conditions, and contexts, providing accurate masks even with complex backgrounds. As shown in these examples, the segmentation masks (highlighted in color) precisely outline the human subjects, making this model ideal for applications requiring detailed person isolation.
This model is ideal for applications requiring precise person segmentation:
The model can be used directly with Ultralytics YOLO:
from ultralytics import YOLO
# Load the model
model = YOLO('path/to/yolo12l-person-seg-extended.pt') # Or yolo12l-person-seg.pt for the original
# Perform inference
results = model('image.jpg')
# Process results (segmentation masks and bounding boxes)
for result in results:
boxes = result.boxes # Tensor operations can be performed on boxes
masks = result.masks # Segmentation masks
if masks is not None:
# Process masks
for mask in masks:
# Use the mask for your application
pass
For segmentation visualization:
import cv2
import numpy as np
from ultralytics import YOLO
# Load the model and image
model = YOLO('path/to/yolo12l-person-seg-extended.pt') # Or yolo12l-person-seg.pt for the original
image = cv2.imread('image.jpg')
# Perform inference
results = model(image)
# Process and visualize the first result
result = results[0]
if result.masks is not None:
masks = result.masks.data.cpu().numpy()
for i, mask in enumerate(masks):
# Create a colored overlay for each mask
color = [np.random.randint(0, 255) for _ in range(3)]
mask_image = np.zeros_like(image, dtype=np.uint8)
mask_image[mask.astype(bool)] = color
image = cv2.addWeighted(image, 1.0, mask_image, 0.5, 0)
# Display or save the image
cv2.imwrite('segmented_image.jpg', image)
This model is available under the GNU Affero General Public License v3.0 (AGPL-3.0).
This model was trained using the Ultralytics YOLO framework, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). As per the terms of the AGPL-3.0 license, any derivative works (including trained models) must also be distributed under the same license.