Recipes
Labs: body points you can cite
You are measuring posture in a trial and need a table of body points per frame, plus enough detail that someone else can get the same table. Leans on pose Live
import csv
from vitalsbio import VitalsBio
client = VitalsBio()
r = client.pose("trial-07-pen-3.mp4", species="cattle", step_s=0.1, max_seconds=60)
names = r["keypoint_names"]
with open("trial-07-pen-3.pose.csv", "w", newline="") as out:
w = csv.writer(out)
w.writerow(["track_id", "t_s", "frame_index", "keypoint", "x", "y", "score"])
for a in r["animals"]:
for f in a["frames"]:
for name, (x, y, score) in zip(names, f["keypoints"]):
w.writerow([a["track_id"], f["t_s"], f["frame_index"], name, x, y, score])
# write this next to the data: it is your methods paragraph
print({"request_id": r.request_id, "api_version": r["api_version"], "schema_version": r["schema_version"],
"model": r["model"], "capability": r["capability"], "video": r["video"]})
Making it reproducible
- Record
api_version,schema_version,model.versionandcapability.statuswith every file. The client sends a datedVitals-Versionheader on each call and the API echoes the version that answered. - The accuracy you can cite is on what is live and the model card, with the test set and the locked plan it was scored against. Cite those numbers and nothing else; they are for the species and datasets named there.
- Filter by
score. Points under 0.3 are the model saying it can't see that joint. - If video must not leave the building, run the on-device package. It writes the same JSON.
- The state readings and the health score are unvalidated. They are not suitable as a study outcome.