anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
A Mixture-of-Experts vision encoder from Meta that matches images to text labels with no extra training, here the L/16 model at 384px. Licensed for non-commercial research use.
MoEViE-L16-384 is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
cd moe_vie pip install -r requirements.txt
MoEViE-L16-384 is one checkpoint of MoE-ViE, a family of vision encoders from Meta for image and video understanding. It is trained to link images with text, so it can sort a picture into labels you type without extra training. Each block pairs an always-on expert with a pool of routed ones, so only a small share of the weights runs for each token.
Researchers and engineers who study or build vision-language systems and can use a CUDA GPU.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Research | Computer vision researchers | Evaluate zero-shot image and video understanding | Score a set of images against typed labels |
| Media | Retrieval engineers | Match text queries with images or video clips | Search a photo set by text |
| Software | ML engineers | Use the encoder as a feature extractor in a larger system | Pull image and text features for a downstream model |
Anyone building a commercial product or without a CUDA GPU can skip it, since the license is non-commercial and the kernels need CUDA.
It runs in Python on a machine with a CUDA GPU.
| Use case | Who | What they get back |
|---|---|---|
| Zero-shot classification | Researchers | A probability for each label you provide |
| Text and image matching | Engineers | Text and image features you can compare for retrieval |
| Video clip understanding | Researchers | Results the card reports on Kinetics-400 and MSR-VTT |
Setup means cloning the project's repository and installing its requirements.
cd moe_vie pip install -r requirements.txt
pip install -U huggingface_hub hf download facebook/MoEViE-L16-384
Give the model an image and a list of text labels, and it prints a probability for each label. The card's script does this for one picture.
import torch
from PIL import Image
from open_clip import create_model_and_transforms, get_tokenizer, image_to_device
MEAN, STD = (0.5, 0.5, 0.5), (0.5, 0.5, 0.5)
model, _, preprocess = create_model_and_transforms(
"MoEViE-L16-384",
pretrained=True, # downloads from the Hub
force_preprocess_cfg=dict(
patch_size=16, size_range=(384, 384), center_crop=True, window_size=1
),
image_mean=MEAN, image_std=STD,
)
model = model.cuda().eval()
tokenizer = get_tokenizer("MoEViE-L16-384")
labels = ["a diagram", "a dog", "a cat"]
packed, _ = preprocess.collate_fn([(preprocess(Image.open("cat.png").convert("RGB")), 0)])
packed = image_to_device(packed, "cuda", torch.float32, mean=MEAN, std=STD)
text = tokenizer(labels).cuda()
with torch.no_grad(), torch.autocast("cuda"):
image_features = model.encode_image(packed, normalize=True)
text_features = model.encode_text(text, normalize=True)
probs = (model.logit_scale.exp() * image_features @ text_features.T).softmax(dim=-1)
print("Label probs:", probs)| Tool | What it does |
|---|---|
| create_model_and_transforms | Loads the model and the matching image preprocessing |
| get_tokenizer | Prepares your text labels for the model |
| encode_image | Turns the image into a normalized feature vector |
| encode_text | Turns the labels into feature vectors you compare with the image |
You point the script at a photo called cat.png and give it three labels, a diagram, a dog and a cat. It prints a probability for each label. The card does not show the numbers, but the highest should land on the label that fits the picture.
This model learned to connect pictures with words. You show it a picture and a few phrases, and it tells you which phrase fits best. The first small thing to try is running the card's script on one photo with three labels.
It is a contrastive vision-language encoder built from Mixture-of-Experts blocks. Each block has one shared expert that is always on plus a routed pool, with per-token top-k routing on a sigmoid gate. The L/16 model has width 1024, depth 24 and 4 of 32 experts active, counting the shared one, for 1.7B total and 0.3B activated parameters.
The numbers below come from the card's zero-shot results for the three model sizes.
A Mixture-of-Experts vision encoder from Meta that matches images to text labels with no extra training, here the L/16 model at 384px. Licensed for non-commercial research use.
Made by facebook on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: MoEViE-L16-384 is one checkpoint of MoE-ViE, a family of vision encoders from Meta for image and video understanding. It is trained to link images with text, so it can sort a picture into labels you type without extra training. Each block pairs an always-on expert with a pool of routed ones, so only a small share of the weights runs for each token.
Who it suits: Researchers and engineers who study or build vision-language systems and can use a CUDA GPU.
Industry | Who uses it | How they use it | Example
Research | Computer vision researchers | Evaluate zero-shot image and video understanding | Score a set of images against typed labels
Media | Retrieval engineers | Match text queries with images or video clips | Search a photo set by text
Software | ML engineers | Use the encoder as a feature extractor in a larger system | Pull image and text features for a downstream model
Anyone building a commercial product or without a CUDA GPU can skip it, since the license is non-commercial and the kernels need CUDA.
Where to use it: It runs in Python on a machine with a CUDA GPU.
Use case | Who | What they get back
Zero-shot classification | Researchers | A probability for each label you provide
Text and image matching | Engineers | Text and image features you can compare for retrieval
Video clip understanding | Researchers | Results the card reports on Kinetics-400 and MSR-VTT
How to set it up: Setup means cloning the project's repository and installing its requirements.
cd moe_vie
pip install -r requirements.txt
pip install -U huggingface_hub
hf download facebook/MoEViE-L16-384
How to use it: Give the model an image and a list of text labels, and it prints a probability for each label. The card's script does this for one picture.
import torch
from PIL import Image
from open_clip import create_model_and_transforms, get_tokenizer, image_to_device
MEAN, STD = (0.5, 0.5, 0.5), (0.5, 0.5, 0.5)
model, _, preprocess = create_model_and_transforms(
"MoEViE-L16-384",
pretrained=True, # downloads from the Hub
force_preprocess_cfg=dict(
patch_size=16, size_range=(384, 384), center_crop=True, window_size=1
),
image_mean=MEAN, image_std=STD,
)
model = model.cuda().eval()
tokenizer = get_tokenizer("MoEViE-L16-384")
labels = ["a diagram", "a dog", "a cat"]
packed, _ = preprocess.collate_fn([(preprocess(Image.open("cat.png").convert("RGB")), 0)])
packed = image_to_device(packed, "cuda", torch.float32, mean=MEAN, std=STD)
text = tokenizer(labels).cuda()
with torch.no_grad(), torch.autocast("cuda"):
image_features = model.encode_image(packed, normalize=True)
text_features = model.encode_text(text, normalize=True)
probs = (model.logit_scale.exp() * image_features @ text_features.T).softmax(dim=-1)
print("Label probs:", probs)
Tool | What it does
create_model_and_transforms | Loads the model and the matching image preprocessing
get_tokenizer | Prepares your text labels for the model
encode_image | Turns the image into a normalized feature vector
encode_text | Turns the labels into feature vectors you compare with the image
Example: You point the script at a photo called cat.png and give it three labels, a diagram, a dog and a cat. It prints a probability for each label. The card does not show the numbers, but the highest should land on the label that fits the picture.
For newcomers and experts: This model learned to connect pictures with words. You show it a picture and a few phrases, and it tells you which phrase fits best. The first small thing to try is running the card's script on one photo with three labels.
It is a contrastive vision-language encoder built from Mixture-of-Experts blocks. Each block has one shared expert that is always on plus a routed pool, with per-token top-k routing on a sigmoid gate. The L/16 model has width 1024, depth 24 and 4 of 32 experts active, counting the shared one, for 1.7B total and 0.3B activated parameters.
Start with an image and typed labels
Encode the image with the MoE encoder
Encode the labels as text features
Scale the image to text similarity
Apply softmax across the labels
Good to know: The numbers below come from the card's zero-shot results for the three model sizes.
Title: IN-1k zero-shot top-1 accuracy by size
B/16 at 224px: 79.3%
L/16 at 384px: 83.6%
H/14 at 448px: 85.1%
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download facebook/MoEViE-L16-384
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 6 KB
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
backnotprop · Kit
Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.