Downloads · 30 days
0
yuvalalaluf/MyVLM
MyVLM is a machine learning model from yuvalalaluf. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as other.
Downloads · 30 days
0
Access
Public
Updated Apr 25, 2024
Repo size
5.8 MB
Likes
1
Public
Click a slice to open those files.
.jpg4.2 MB · 56%
From the Hugging Face model README
Paper: https://arxiv.org/abs/2403.14599
Project Page: https://snap-research.github.io/MyVLM/
Code: https://github.com/snap-research/MyVLM
As part of our MyVLM code release, we have also released pretrained concept heads and concept embeddings for all 29 objects used in the paper.
These can be loaded using the CLIPConceptHead class and our inference scripts for reproducing the paper results.
This repository contains 5 concept heads for each object, representing five different training seeds and sets of images used for training.
As mentioned in the paper, we have two types of concept heads:
For faces, we use the buffalo_l face detection and face recognition model from insightface.
See concept_heads/face_recognition/head.py for usage.
For objects, we train a single linear layer over features extracted from a CLIP ViT-H/14 model (DFN5B-CLIP-ViT-H-14-384).
See concept_heads/clip/head.py for usage.
The concept embeddings are saved as .pt files in the following format:
```
{
10: {
"keys": torch.Tensor(), # the keys used for optimizing the concept embedding
"values": torch.Tensor(), # the concept embedding itself
},
...
20: {
"keys": torch.Tensor(),
"values": torch.Tensor(),
},
...
}
```
where each entry in the dictionary represents a different checkpoint during the optimization process.
We provide the concept embeddings for personalized captioning using both BLIP-2 and LLaVA.
This sample code is made available by Snap Inc. for non-commercial, academic purposes only.
Please see the full license here.