data_juicer.ops.mapper.image_tagging_mapper module¶
- class data_juicer.ops.mapper.image_tagging_mapper.ImageTaggingMapper(tag_field_name: str = 'image_tags', *args, **kwargs)[source]¶
Bases:
Mapper
Generates image tags for each image in the sample.
This operator processes images to generate descriptive tags. It uses a Hugging Face model to analyze the images and produce relevant tags. The tags are stored in the specified field, defaulting to ‘image_tags’. If the tags are already present in the sample, the operator will not recompute them. For samples without images, an empty tag array is assigned. The generated tags are sorted by frequency and stored as a list of strings.