Skip to content

Partially labeled images #934

Closed as not planned
Closed as not planned

Description

@christuchez

When training detection models, sometimes only certain regions of an image are labeled to reduce labeling costs. For example, in footage of a zoo, we might label only the birds inside an area and ignore birds outside the area.

The request is to add a flag that, when enabled, restricts training, validation, and testing to the labeled regions of each image. These regions would be computed automatically by enclosing the labeled bounding boxes in a polygon (such as a convex hull) or a bounding rectangle.

During training, the loss should only be computed within these regions, so the model isn't penalized for detecting unlabeled objects outside them. During validation and testing, any detections outside the regions would be ignored and not counted as false positives. This would ensure both training and evaluation focus only on the labeled areas, producing accurate metrics for partially labeled datasets.

Activity

  1. EHxuban11 commented on Oct 17, 2026

    @EHxuban11
    Contributor

    Hey @christuchez ,

    Thank you for opening this issue, as always!

    I've been thinking about it today, and I don't think it's a good addition to LibreYOLO at the moment because it would touch sensitive parts of training and validation in basically every model, and those are the parts I least want to break.

    I think this belongs in preprocessing. Since your cameras are fixed, you can paint the unlabeled part of each camera's view flat gray (114, 114, 114), one polygon per camera, or crop to the labeled area, and do it the same way for training, validation and inference. That way the model never sees the unlabeled birds, so it isn't taught they are background.

    I'm open to changing my mind if you think my arguments are wrong or I've missed something, but for now, after thinking it through, I'd rather not add it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions