MCPcopy Create free account
hub / github.com/Monalissaa/DisenDiff / encode_images

Method encode_images

utils/clip_eval.py:31–33  ·  view source on GitHub ↗
(self, images: torch.Tensor)

Source from the content-addressed store, hash-verified

29
30 @torch.no_grad()
31 def encode_images(self, images: torch.Tensor) -> torch.Tensor:
32 images = self.preprocess(images).to(self.device)
33 return self.model.encode_image(images)
34
35 def get_text_features(self, text: str, norm: bool = True) -> torch.Tensor:
36

Callers 1

get_image_featuresMethod · 0.95

Calls 1

encode_imageMethod · 0.80

Tested by

no test coverage detected