Skip to content

How to binary classification? #84

@Leon1207

Description

@Leon1207

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions