xmed-lab / CLIPN

ICCV 2023: CLIPN for Zero-Shot OOD Detection: Teaching CLIP to Say No
MIT License
116 stars 10 forks source link

Code issue #10

Open tom99763 opened 4 months ago

tom99763 commented 4 months ago

In train_one_epoch function, your model outputs 4 variables (image_features, text_features, text_features_no, logit_scale). However, in evaluate function, your model outputs only 3 variables without text_features_no. This is quite strange because you training text enocder no but do not use it during evaluation.

SiLangWHL commented 2 months ago

Hi,

Sorry for the late reply. For the zero-shot inference of CLIPN, you should run src/zero_shot_infer.py. We re-define the inference model in /src/classification.py. In short, the text encoder and 'no' text encoder are defined as two classifiers.