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

Function image_transform

saliency_maps/scripts/utils.py:74–79  ·  view source on GitHub ↗

Transformation for CAM (image)

(t, height=7, width=7)

Source from the content-addressed store, hash-verified

72 return self.model.get_text_features(x)
73
74def image_transform(t, height=7, width=7):
75 """ Transformation for CAM (image) """
76 if t.size(1) == 1: t = t.permute(1,0,2)
77 result = t[:, 1 : , :].reshape(t.size(0), height, width, t.size(2))
78 result = result.transpose(2, 3).transpose(1, 2)
79 return result
80
81def text_transform(t):
82 """ Transformation for CAM (text) """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected