explaingit

harpreetsahota204/crop_query

1TypeScriptAudience · dataComplexity · 3/5ActiveSetup · moderate

TLDR

FiftyOne plugin that finds a target object across a large unlabeled image dataset using a few reference crops, CLIP patch embeddings, and cosine similarity, no training or GPU required.

Mindmap

mindmap
  root((crop-query))
    Inputs
      Reference crop images
      FiftyOne dataset
      Zoo model name
    Outputs
      Ranked tagged samples
      Per image score field
      Patch heatmap overlay
    Use Cases
      Industrial defect triage
      Drone infrastructure scan
      Camera trap filtering
      Sponsor logo retrieval
    Tech Stack
      Python
      TypeScript
      FiftyOne
      CLIP
      PyTorch

Things people build with this

USE CASE 1

Triage a folder of drone images for bird nests on power lines using a handful of example crops.

USE CASE 2

Filter camera trap footage for one species before sending anything to manual annotation.

USE CASE 3

Find sponsor or team logos across long broadcast archives without training a detector.

USE CASE 4

Locate a specific defect type across a large unlabeled industrial inspection dataset.

Tech stack

PythonTypeScriptFiftyOneCLIPPyTorch

Getting it running

Difficulty · moderate Time to first run · 30min

Needs FiftyOne installed plus first-time model download from the zoo, which can take a few minutes on a slow connection.

In plain English

Crop Query is a plugin for FiftyOne, an open-source tool used to organize and inspect image datasets. The plugin helps you find a specific object inside a large pile of unlabeled images when you only have a few example cutouts of that object. There is no model training and no fine-tuning involved, and the README says it does not require a GPU. The scenario it targets is common in computer vision work: you have thousands of pictures and a handful of cropped examples of something you care about, such as a bird's nest on a power line, a defect on a manufactured part, a sponsor logo in sports footage, or a specific vehicle in satellite images. Crop Query produces two outputs. The first is a ranked queue of images sorted by how closely they match the reference crops, with a tag applied to the top candidates. The second is a heatmap overlay shown on each image in the FiftyOne viewer that points to the region most likely to contain the object. The matching method is described step by step in the README. A pretrained vision model from the FiftyOne Model Zoo turns each reference crop into a numeric embedding. Each dataset image is cut into a grid of overlapping patches, and each patch is embedded with the same model. Cosine similarity is then computed between every patch and every template, and the highest similarity becomes the image's score. The per-patch similarities form the heatmap, with values below a chosen threshold hidden so only genuine matches stand out. The recommended starting model is clip-vit-base32-torch. The workflow inside FiftyOne is a sequence of small steps. You point the panel at a folder of template images, load a zoo model, then set the grid so that one patch roughly covers how much of an image the target object usually fills. You also pick the score field name, the tag to apply, and a cutoff for the heatmap. You can run the search on the entire dataset or on a current selection. The README lists possible use cases including industrial inspection, infrastructure monitoring on drone footage, camera trap filtering for wildlife, sponsor and team logo detection in broadcast archives, retail shelf checks, aerial and satellite imagery, and manufacturing quality checks.

Copy-paste prompts

Prompt 1
Install the crop_query FiftyOne plugin and load the clip-vit-base32-torch model against my local dataset.
Prompt 2
Configure the grid in crop_query so one patch covers about 1/10th of each image and set the heatmap cutoff to 0.6.
Prompt 3
Swap the CLIP backbone in crop_query for a DINOv2 zoo model and compare the top 100 ranked samples on the same templates.
Prompt 4
Run crop_query on a current FiftyOne selection only, write the score to a field named nest_score, and tag samples above 0.7 with candidate.
Prompt 5
Write a Python loop that calls crop_query programmatically on five different template folders in turn and exports the ranked sample IDs as CSV.
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.