MCPcopy Create free account
hub / github.com/EmbodiedGPT/EmbodiedGPT_Pytorch / get_image_embedding

Method get_image_embedding

demo/test.py:303–307  ·  view source on GitHub ↗
(self, image_file)

Source from the content-addressed store, hash-verified

301
302 @torch.no_grad()
303 def get_image_embedding(self, image_file):
304 pixel_values = load_image(image_file)
305 pixel_values = pixel_values.unsqueeze(0).to(self.device, dtype=self.dtype)
306 language_model_inputs = self.model.extract_feature(pixel_values)
307 return language_model_inputs
308
309 @torch.no_grad()
310 def get_video_embedding(self, video_file):

Callers 1

test.pyFile · 0.45

Calls 2

load_imageFunction · 0.70
extract_featureMethod · 0.45

Tested by

no test coverage detected