image_pair_similarity_filter

Filter image pairs by CLIP similarity scores from JSON/JSONL inputs.

541|171|Updated May 3, 2018
One-click install
npx skills add https://github.com/cas-bigdatalab/piflow --skill image-pair-similarity-filter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: image_pair_similarity_filter
Source: https://github.com/cas-bigdatalab/piflow/tree/main/workspace/skills/image_pair_similarity_filter
Command: npx skills add https://github.com/cas-bigdatalab/piflow --skill image-pair-similarity-filter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires data_juicer, and includes scripts (resource) components.

What problem does it solve?

This Skill provides the capability to filter image pairs based on their similarity score, simplifying the management and categorization of visual content.

Core Features & Use Cases

  • Image Pair Similarity Scoring: Uses the CLIP model to compute similarity scores between pairs of images.
  • Customizable Filtering: Filters out image pairs outside the specified similarity range based on user-defined minimum and maximum scores.
  • Versatile Filtering Strategy: Offers two strategies to determine if an image pair should be kept: 'any' or 'all'.
  • Use Case: This skill is useful in applications like image content moderation, organizing similar images in a database, or analyzing the relationship between image pairs.

Quick Start

Filter image pairs from 'input.jsonl' with a similarity range between 0.6 and 0.8, using 'any' filtering strategy and output to 'output.jsonl'.

Frequently Asked Questions about image_pair_similarity_filter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I filter image pairs by similarity score in a JSONL dataset?

To filter image pairs by similarity score, you can use a CLIP model to compute scores and apply a minimum and maximum range threshold to your JSONL dataset. This process outputs a new file containing only the image pairs that match your specified similarity criteria.

What is the best way to compute image similarity for content moderation?

Computing image similarity for content moderation is best handled by using a CLIP model to evaluate pairs and filter them based on a defined score range. This approach allows you to systematically manage visual content by keeping or discarding pairs through 'any' or 'all' filtering strategies.

Do I need the data_juicer library to calculate image pair similarity?

Yes, you need the data_juicer library along with a CLIP model to calculate image pair similarity. These dependencies are required to process the JSON/JSONL input files and execute the filtering logic to accurately score and manage your visual content.

How does the 'any' or 'all' filtering strategy work for image pairs?

The 'any' or 'all' filtering strategy determines whether an image pair is kept based on the computed CLIP similarity scores. The 'any' strategy keeps pairs if any score falls within the range, while the 'all' strategy requires all evaluated scores to meet the minimum and maximum threshold criteria.

Can I set a custom similarity range to organize similar images in a database?

Yes, you can set a custom similarity range with specific minimum and maximum scores to organize similar images in a database. By defining these thresholds, the filtering process will isolate and output only the image pairs that fall within your target similarity window.