Skip to content

Commit

Permalink
Update multi_modal.py - dump the selected negative labels
Browse files Browse the repository at this point in the history
  • Loading branch information
XueJiang16 committed Mar 3, 2024
1 parent f54475d commit c702799
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mmcls/models/classifiers/multi_modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ def __init__(self,

self.adj_start_idx = int(len(ind_noun) * neg_topk)

## If you want to dump the selected negative labels (with prompt), please uncomment these lines.
# with open("selected_neg_labels.txt", "w") as f:
# for i in ind_noun[0:int(len(ind_noun)*neg_topk)]:
# f.write("{}\n".format(words_noun[i]))
# for j in ind_adj[0:int(len(ind_adj)*neg_topk)]:
# f.write("{}\n".format(words_adj[j]))

def extract_feat(self, img, stage='neck'):
raise NotImplementedError

Expand Down

0 comments on commit c702799

Please sign in to comment.