MCPcopy Create free account
hub / github.com/Adamdad/hash3D / __init__

Method __init__

eval_clip_sim.py:14–17  ·  view source on GitHub ↗
(self, device, model_name='openai/clip-vit-large-patch14')

Source from the content-addressed store, hash-verified

12# laion/CLIP-ViT-bigG-14-laion2B-39B-b160k
13class CLIP:
14 def __init__(self, device, model_name='openai/clip-vit-large-patch14'):
15 self.device = device
16 self.clip_model = CLIPModel.from_pretrained(model_name).to(self.device)
17 self.processor = CLIPProcessor.from_pretrained(model_name)
18
19 def encode_image(self, image):
20 pixel_values = self.processor(images=image, return_tensors="pt").pixel_values.to(self.device)

Callers

nothing calls this directly

Calls 2

toMethod · 0.45
from_pretrainedMethod · 0.45

Tested by

no test coverage detected