r/computervision • u/Chunkymunkey642069 • 17d ago
Showcase I built tamserve: one GPU tracks objects on many live cameras with a single copy of SAM 2 / EdgeTAM (open source)
My great-grandmother had Alzheimer's, and earlier this year I co-founded Memoria to build an in-home camera that watches an older adult for falls, bad nights and wandering, and alerts the family. That means following every person on every camera, all day. EdgeTAM, from Meta's SAM 2 family, tracked people best, but its code was written for editing one recorded video: a separate copy of the model per camera, and memory that grows about 12 MB every frame. For something families pay for monthly, that didn't work, so I built tamserve.
It does for video tracking what vLLM does for chat: one copy of the model, and every object on every camera goes through it as one batch. On one RTX 4090 with EdgeTAM:
- 64 cameras in 5.7 GB of GPU memory (321 frames/s between them). The original needs a copy of the model per camera, and 32 don't fit in 24 GB.
- Memory that doesn't grow: 0.28 GB for an object at frame 800, against 9.8 GB for the original.
- Faster: 219 vs 177 frames/s at 1 camera and 323 vs 280 at 8, against the original compiled and run as one process per camera.
- Live: six 720p cameras with nine objects, every camera at a full 30 frames/s (the video above).
- Same masks: 0.8685 vs 0.8686 on DAVIS 2017, and bit for bit on one camera with
exact=True.
It also starts new objects on any frame, reconnects dropped cameras, and spreads cameras over several GPUs or machines. It runs EdgeTAM and all four SAM 2.1 sizes; with SAM 2.1 it saves memory but isn't faster, because that model keeps the GPU busy on its own.
pip install tamserve, or try it in Colab on a free T4. Apache-2.0.
- GitHub: https://github.com/aryamandarda/tamserve
- Colab: https://colab.research.google.com/github/aryamandarda/tamserve/blob/main/notebooks/quickstart.ipynb
If you find it useful, a star on GitHub helps other people find it. And if you're running tracking on live video, I'd love to hear what breaks.
Totally open source and free to use!