Skip to content

Latest commit

 

History

History

openclip

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

TripletCLIP

Install

We advise you first create a virtual environment with:

conda create -n tripletclip python=3.12
conda activate tripletclip

Then, install the required dependencies from the requirements.txt file:

pip install -r requirements.txt

Training TripletCLIP

To train the model with the configuration from the paper, you can run the following command:

python src/main.py
 --model_name 'ViT-B-32' \
 --lr 0.00005 \
 --data_dir '/path/to/data/tar/files' \
 --epochs 30 \
 --train

Results

The results reported are from the models trained on 1M image-text pairs from high quality TripletCLIP data. The results reported are after training for 10 epochs with a batch size of 1024 in bf16 precision.

Model SugarCrepe MSCOCO Flickr30k Imagenet1k
Add AttAdd ObjReplace Att Replace ObjReplace RelSwap AttSwap Obj i2t R@5t2i R@5i2t R@5t2i R@5acc5
CLIP54.7756.93 62.8161.2256.3353.650.61 5.34.810.89.39.3
NegCLIP64.8857.17 70.5565.9268.13656.75657.142 3.53.79.37.26.52
TripletCLIP67.19664.646 75.12773.18470.5560.0660.408 13.0413.2324.0926.722.82