data_juicer.ops.mapper.image_detection_yolo_mapper module

class data_juicer.ops.mapper.image_detection_yolo_mapper.ImageDetectionYoloMapper(imgsz=640, conf=0.05, iou=0.5, model_path='yolo11n.pt', *args, **kwargs)[source]

Bases: Mapper

Perform object detection (with YOLO) on images and return the bounding boxes and class labels.

__init__(imgsz=640, conf=0.05, iou=0.5, model_path='yolo11n.pt', *args, **kwargs)[source]

Initialization method.

Parameters:
  • imgsz – resolution for image resizing

  • conf – confidence score threshold

  • iou – IoU (Intersection over Union) score threshold

  • model_path – the path to the YOLO model.

process_single(sample, rank=None, context=False)[source]

For sample level, sample –> sample

Parameters:

sample – sample to process

Returns:

processed sample