MCPcopy Create free account
hub / github.com/HealthX-Lab/MedCLIP-SAMv2 / ImageFeatureExtractor

Class ImageFeatureExtractor

saliency_maps/scripts/utils.py:56–63  ·  view source on GitHub ↗

Image feature wrapper

Source from the content-addressed store, hash-verified

54 return cos(model_output, self.features)
55
56class ImageFeatureExtractor(torch.nn.Module):
57 """ Image feature wrapper """
58 def __init__(self, model):
59 super(ImageFeatureExtractor, self).__init__()
60 self.model = model
61
62 def __call__(self, x):
63 return self.model.get_image_features(x)
64
65class TextFeatureExtractor(torch.nn.Module):
66 """ Text feature wrapper """

Callers 1

get_metricsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected