ECCV 2026
Zhenqi He, Ziqi Jiang, Yuanpei Liu, Yanghao Wang, Teng Wang, Long Chen
LONG Group, HKUST
FlowCIR learns semantic transport with flow matching for zero-shot composed image retrieval.
conda create --name flowcir python=3.10 -y
conda activate flowcir
pip install torch torchvision numpy pillow tqdm datasets transformers
pip install git+https://github.com/openai/CLIP.gitRun the following data preparation, training, validation, and submission commands from the code directory:
cd codeDownload HQ-Edit and the target CIR datasets (CIRR, CIRCO, and Fashion-IQ). Configure the CIRR and CIRCO locations in config.py, or use environment variables:
export FLOWCIR_HQEDIT_DIR=/path/to/HQ-Edit
export FLOWCIR_CIRR_DIR=/path/to/CIRR
export FLOWCIR_CIRCO_DIR=/path/to/CIRCOBefore extracting test features, copy captions/cap.rc2.test1_posneg.json to <CIRR_DIR>/cirr/captions/ and captions/test_posneg.json to <CIRCO_DIR>/annotations/, replacing the corresponding non-posneg test annotations when necessary.
Use extract_features/extracted_features_clip_posneg.py to extract the positive and negative text features from the posneg annotations.
Extract HQ-Edit training features:
bash myScripts/extract_hqedit_feat.shExtract CIRR or CIRCO retrieval features:
DATASET=cirr bash myScripts/extract_cir_feat.sh
DATASET=circo bash myScripts/extract_cir_feat.shbash myScripts/train.sh
MODEL_DIR=/path/to/checkpoint_directory \
EPOCHS="10 15 20" END_POINTS="0.4 0.5 0.6" \
bash myScripts/val.shCheckpoints and logs are written to the directories configured by FLOWCIR_SAVE_ROOT and FLOWCIR_LOG_DIR. Empirically, training for about 200 epochs is usually sufficient. Select the checkpoint epoch and inference end time according to validation performance; end times between 0.4 and 0.6 generally work well.
Generate the final submission with the epoch and end time selected on the validation set:
MODEL_DIR=/path/to/checkpoint_directory \
DATASET=cirr EPOCH=15 END_POINT=0.5 \
bash myScripts/submit.shUse DATASET=circo to generate a CIRCO submission. Submission files are saved under FLOWCIR_SUBMISSION_DIR.
This repository is developed in part based on Exploring Cross-Modal Flows for Few-Shot Learning (FMA) (ICLR 2026). It also uses OpenAI CLIP and the publicly available HQ-Edit, CIRR, and CIRCO resources. We thank their authors for making these projects available.
If you find this work useful, please cite flowcir.bib:
@inproceedings{he2026flowcir,
title = {FlowCIR: Semantic Transport via Flow Matching for Zero-Shot Composed Image Retrieval},
author = {He, Zhenqi and Jiang, Ziqi and Liu, Yuanpei and Wang, Yanghao and Wang, Teng and Chen, Long},
booktitle = {European Conference on Computer Vision},
year = {2026}
}