Views
No views yet
1from libreyolo import LibreYOLO
2
3# zero-shot classification
4model = LibreYOLO("LibrePEl14-cls.pt")
5model.set_classes(["a forklift", "an empty aisle", "a spill"])
6r = model.predict("warehouse.jpg")[0]
7print(model.names[r.probs.top1], float(r.probs.top1conf))
8
9# embeddings: image, text, and whole video in one space
10embedder = LibreYOLO("LibrePEl14-cls.pt", task="embed")
11embedder.predict("photo.jpg") # (1, 1024) image row
12embedder.embed_text(["a dog"]) # (1, 1024) text row
13embedder.predict("clip.mp4") # (1, 1024) row for the whole clipfrom_pretrained.| Family / size | pe / l14 |
| Tasks | classify (zero-shot), embed |
| Input resolution | 336x336 |
| Embedding dimension | 1024 |
| Text context length | 32 |
| Preprocessing | RGB, bilinear square resize, mean/std = (0.5, 0.5, 0.5) |
| Video pooling | mean of independently encoded frames, L2-normalized once |
| Training | not supported (inference-only; train() raises) |
| Exports | ONNX, TorchScript |
timm/PE-Core-L-14-3368eff41b3f687e50a323662c2dda5eb3588c6dd35facebook/PE-Core-* package checkpoint.weights/convert_pe_weights.py): LibreYOLO
checkpoint metadata is added and tensors are moved to CPU. Learned parameters
are unchanged.open_clip_torch==3.2.0 on float32 CPU is exact
(max_abs_diff == 0.0) for image embeddings, text embeddings, zero-shot logits,
and fixed-frame video embeddings.LICENSE and NOTICE in
this repository. You are responsible for complying with those terms.