Transformation for CAM (image)
(t, height=7, width=7)
| 72 | return self.model.get_text_features(x) |
| 73 | |
| 74 | def 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 | |
| 81 | def text_transform(t): |
| 82 | """ Transformation for CAM (text) """ |
nothing calls this directly
no outgoing calls
no test coverage detected