Input: a few consecutive frames (oldest→newest). Output: JSON, e.g.
{"posture":"horizontal-on-floor","status":"down","confidence":0.9,"person_down":true,"n_people":1}
where status ∈ {down, distress, normal} (3-class down3 scheme).
1from transformers import AutoModelForImageTextToText, AutoProcessor
2import torch
3proc = AutoProcessor.from_pretrained("Luigi/edge-fall-vlm-2.2b", do_image_splitting=False,
4 size={"longest_edge": 384})
5model = AutoModelForImageTextToText.from_pretrained("Luigi/edge-fall-vlm-2.2b",
6 dtype=torch.bfloat16).to("cuda").eval()
7prompt = ("You are a safety monitor. These are consecutive video frames (oldest first), "
8 "possibly with more than one person. Report whether ANYONE has fallen, fainted, "
9 "is lying immobile, or is in distress; else normal. Answer with JSON only.")
10frames = [...] # list of PIL images, ~6 frames spanning ~3.5s
11msgs = [{"role":"user","content":[{"type":"image"} for _ in frames]+[{"type":"text","text":prompt}]}]
12text = proc.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
13batch = proc(text=[text], images=[frames], return_tensors="pt").to("cuda")
14print(proc.batch_decode(model.generate(**batch, max_new_tokens=64, do_sample=False)[:, batch["input_ids"].shape[1]:], skip_special_tokens=True)[0])
1llama-mtmd-cli -m model-Q6_K.gguf --mmproj mmproj-f16.gguf \
2 --image f0.png --image f1.png ... -t 4 -n 64 --temp 0 -p "<prompt above>"
Apache-2.0 (inherits SmolVLM2). Evaluation datasets (URFD, OmniFall/OOPS) are not
redistributed; see their sources for terms.