The license for the model and the weights are entirely attributed to the original authors of the OpenAI CLIP and MaskCLIP
pip install git+http://github.com/leejaeyong7/DenseCLIP
from dense_clip import DenseCLIP
from PIL import Image
device = torch.device('cuda')
model = DenseCLIP('ViT-L/14@336px').to(device)
model.eval()
image = Image.open(image_file)
image.resize((336, 336))
with torch.no_grad():
feature = model(image) # HxWxC feature for image size of HxW