FFFF GitHub - Pter61/skillcir · GitHub
[go: up one dir, main page]

Skip to content
Pter61Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

SkillCIR: Intent-Guided Skill Composition for Training-Free Composed Image Retrieval

Official code for SkillCIR (NeurIPS 2026).

Training-free composed image retrieval (CIR) methods use a frozen MLLM to reason about the user's edit, but then compress every inferred constraint into a single retrieval signal. SkillCIR executes the inferred intent instead: each constraint activates a typed retrieval skill that scores gallery candidates along one evidence channel, and the per-skill scores are composed with explicit signs at ranking time.

News

  • 2026-11 — We release a basic version of the SkillCIR code. More components will be added in future updates.

Installation

git clone https://github.com/Pter61/skillcir.git
cd skillcir
pip install -e .            # core (NumPy only)
pip install -e '.[images]'  # optional: OpenCLIP image/text encoding

Python 3.9+ is required.

Quick start

Run the demo (no model download or network access needed):

python examples/run_demo.py --top-k 3 --evaluate
# or, after installation
skillcir demo --top-k 3 --evaluate --output output/demo.json

The demo ranks a small gallery for a "remove the seashells, keep the stingray" query and prints each candidate's total score together with the signed contribution of every active skill.

Usage

from skillcir import Gallery, QueryFeatures, retrieve

gallery = Gallery(ids, gallery_features)              # one row per image
query = QueryFeatures(target=t, reference=r, remove=n)
result = retrieve(gallery, query, active_skills=["RefSkill", "EntityNeg"], top_k=10)
for item in result.rankings:
    print(item.id, item.score, item.contributions)

Pre-computed features — put gallery and query features in a JSON manifest (see examples/features.json and docs/INPUTS.md):

skillcir rank --input examples/features.json --top-k 3 --output output/ranking.json

Images with OpenCLIP:

python examples/make_image_example.py --output output/image_example
skillcir images --input output/image_example/manifest.json \
  --model-name ViT-B-32 --pretrained laion2b_s34b_b79k \
  --device cpu --top-k 3 --output output/image_ranking.json

The skill plan for each query is given in the manifest; examples/planner_prompt.txt is a simple prompt for producing it with an MLLM. --evaluate reports Recall@k and mAP@k from the relevant_ids in the manifest.

Tests

PYTHONPATH=src python -m unittest discover -s tests -v

Citation

@inproceedings{tang2026skillcir,
  title     = {{SkillCIR}: Intent-Guided Skill Composition for Training-Free Composed Image Retrieval},
  author    = {Tang, Yuanmin and Li, Lin and Du, Yang and Gao, Yuan and Mancini, Massimiliano and Song, Jun and Gou, Gaopeng and Xiong, Gang and Qiu, Meikang and {YuCheng} and Zheng, Bo},
  booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
  year      = {2026}
}

License

This project is released under the MIT License.

Acknowledgements

Image and text encoding uses OpenCLIP.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0