r/computervision • • 12d ago

Showcase I made a 3D human mesh reconstruction & frame-sync web app for sports analysis

Technical stack info I can share about the 3D pipeline (works on regular handheld videos):

Bounding Box & Target Tracking: MediaPipe JS library running in the browser for lightweight 2D pose tracking, used primarily for accurate automated cropping and keeping the subject centered for downstream processing. 

3D Mesh Recovery: A specialized 3D reconstruction model optimized for video sequences (operating on the cropped sequence), combined with a custom gravity and Inverse Kinematics (IK) pipeline to lock world orientation and adapt ground contact constraints. I use Meta’s MHR for the body model for an efficient body mesh model.

Temporal Alignment: Fast approximate Dynamic Time Warping (DTW) to handle frame synchronization across movements with different tempos/speeds.

Rendering: Three.js for 3D rendering. Activeframe for fast video scrubbing.

You can try it out for free at twinreplay.com with your own clips or check out the built-in interactive demos.

Would love to hear your thoughts or feedback.

207 Upvotes

9 comments sorted by

2

u/du_dt 12d ago

awesome! Camera params assumed to be known? And did you apply any post-processing? I can see some jittering on red around 0:03 (no blame, just curious).
Sorry for pet peeve: blue mesh to blue jacked video would have been much more pleasant

1

u/TwinReplay 12d ago

Thanks! No, no camera parameter input but a rough FoV estimate via geocalib and pinhole camera model is enough for this I think. Yes lots of post-processing to handle occlusions etc and smooth out what you can without removing detail.

Hehe, I’ll have to get fix the color matching next time!

5

u/Nick-OneDrop 11d ago

Curious what features you feed into DTW. Are you aligning on joint angles, or do you use something else to keep it stable across different camera views?

1

u/plus2link 11d ago

Genuinely useful writeup, especially the gravity + IK stage. That's the part most people hand-wave.

Context so you can weigh my questions: I'm the dev behind VXROOM, a browser motion-fitness game, so I'm comparing against a much weaker pipeline. We track 33 joints on-device and score movements straight off 2D landmarks — no body model, no world orientation, no ground contact. That pushes us the opposite way from you: instead of estimating depth and intrinsics, we design the games around movements that read unambiguously in 2D (punches, squats, jumping jacks) and simply don't score anything whose real difference is depth.

Things I'd genuinely like to know: how stable is the geocalib FoV estimate on clips shot at different zoom levels? Do you align on joint angles or on 3D joint positions in the DTW — angles feel safer if the camera ever moves? And is the jitter around 0:03 something you fight in post, or does the IK stage absorb most of it?

Honest limitation on our side: at webcam resolution wrist and finger detail is unreliable, so "did the wrist actually rotate" is out of reach for us — mesh recovery is the only route I see for that. Is the MHR pass anywhere near cheap enough to run live one day, or strictly offline for now?

2

u/TwinReplay 11d ago

I haven't really needed to evalue FoV output from geocalib much since I don't need absolute distance from body to the camera. I think the IK can handle some of the foot skating you can get with a bad FoV estimate too. I suppose long jumps and an a bad FoV estimate can cause under or over estimate jumping lengths unless you somehow model the jumping kinematics and base it on that instead. But if you check the paper at https://github.com/cvg/GeoCalib it is surprisingly accurate, even from just one image.

I can go into detail on the DTW implementation but joint angles is a good start yes.

Not sure what you mean by the jitter exactly but if you mean that the red pose plays faster around that time then that is more or less by design as either video will play faster than the other to make it catch up to stay in sync. You can turn off the the frame-by-frame sync by going into More and toggle Time Warp off to see the difference. If you mean some jitter with the feet (which it did not really notice any in this clip) then I think that is more often caused by IK, rather than remove it, if you have feet snapping on and off locked when in contact and not sliding. You can see the result without lower body IK adaptation by toggling it of under Display in the demo.

I haven't seen much live mesh recovery research but this one claims to be real time https://github.com/yangtiming/Fast-SAM-3D-Body. I think the improved tracking accuracy you see from mesh recovery vs 2D pose detection is mainly from the richer training datasets with many 3d points sampled on the body surface rather than only joint keypoints. And much of the heavy processing is in constructing the mesh, but there is a lot of redundancy and possibility to optimize it if only repeating that for every frame. And if you only need accurate hand pose there should be a way to do that relatively cheaply without constructing the mesh I think but I haven't seen any publications on this. Also, I think for hand tracking only all the big VR/AR headset companie use some form of it but might not be open source, like that for Meta's and Apples headsets.

1

u/UnfairFunny3314 11d ago

I sent you. Dm

1

u/Designer-Lab-4213 8d ago

did you open source this ?

0

u/Cronos23 11d ago

Hi! I'm building a similar solution for my personal use, focusing solely on disc golf. Seeing as you're using ffmpeg that carries the GPLv2 license, is the source code available somewhere? Would be very interested to see how this compares to what I've made so far. Send me a DM if you want to see my vibe-code - I'm keeping the repository private so I don't have to deal with licensing in any sense :)

0

u/TwinReplay 11d ago

Sorry, not open source. But good point about that pesky ffmpeg license, I removed that dependency since it is not needed for the video encoding, WebCodecs is a better and faster option anyway. Only slight advantage I saw was that the output quality was a bit better than that from GPU accelerated WebCodecs output, even at high bitrate.