data_juicer.ops.mapper.image_segment_mapper module

class data_juicer.ops.mapper.image_segment_mapper.ImageSegmentMapper(imgsz=1024, conf=0.05, iou=0.5, model_path='FastSAM-x.pt', *args, **kwargs)[源代码]

基类:Mapper

Perform segment-anything on images and return the bounding boxes.

__init__(imgsz=1024, conf=0.05, iou=0.5, model_path='FastSAM-x.pt', *args, **kwargs)[源代码]

Initialization method.

参数:
  • imgsz -- resolution for image resizing

  • conf -- confidence score threshold

  • iou -- IoU (Intersection over Union) score threshold

  • model_path -- the path to the FastSAM model. Model name should be one of ['FastSAM-x.pt', 'FastSAM-s.pt'].

process_single(sample, rank=None, context=False)[源代码]

For sample level, sample --> sample

参数:

sample -- sample to process

返回:

processed sample