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

Class TextFeatureExtractor

saliency_maps/scripts/utils.py:65–72  ·  view source on GitHub ↗

Text feature wrapper

Source from the content-addressed store, hash-verified

63 return self.model.get_image_features(x)
64
65class TextFeatureExtractor(torch.nn.Module):
66 """ Text feature wrapper """
67 def __init__(self, model):
68 super(TextFeatureExtractor, self).__init__()
69 self.model = model
70
71 def __call__(self, x):
72 return self.model.get_text_features(x)
73
74def image_transform(t, height=7, width=7):
75 """ Transformation for CAM (image) """

Callers 1

get_metricsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected