Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to binary classification? #84

Open
Leon1207 opened this issue Jul 21, 2024 · 0 comments
Open

How to binary classification? #84

Leon1207 opened this issue Jul 21, 2024 · 0 comments

Comments

@Leon1207
Copy link

If I want to locate ‘obj_name’ in a Scannet scene, can the following code work?

text = [clip.tokenize(f'a {obj_name} in a scene').cuda(), clip.tokenize(f'a other in a scene').cuda()]
text_features = clip_pretrained.encode_text(text)
predictions = model(sinput)
predictions = predictions[inds_reverse, :]
pred = predictions.half() @ text_features.t()
logits_pred = torch.max(pred, 1)[1].cpu()  # if it's 0 then is the point to be located
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant