xmed-lab / CLIPN

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

Code issue #10

Closed tom99763 closed 1 week ago

tom99763 commented 5 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 4 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.