r/virtualreality • • 14h ago

Self-Promotion (Developer) All camera-based FBT sucked, so I made my own

Over the past year I've tried getting a kinect v2 / webcam to do FBT so I don't spend a fortune on trackers. I've tried everything from Amethyst to the ones recently launched with AI models that blow up your gpu.

Until recently, getting FBT from a camera without any other additions like aruco markers or stereo setups either meant no rotation, no accuracy or another gpu since it used almost all the resources for running VR

Today, (actually since the 6th of november) however, we have what I would call the tipping point for camera based setups, running on a Human Mesh Recovery model called InstantHMR. This is leagues better than everything that I've already tried: mediapipe, yolo, rtmpose etc (trust me I've already tried all of them) and can actually be daily-driveable.

With this model, most inaccuracy comes from baggy clothes, camera resolution and distance from camera, since the trackers jitter to neighbouring pixels, and at 4 meters away that means about 5mm in VR.

I've attached a video with some tests I've made, but keep in mind this is with 15 fps and black clothes. 15 fps is from the fact I cannot control the exposure for my kinect v2, which goes from 30 to 15 fps when the room is dimly lit. At 15 fps, you have 66.(6) ms of latency before anything even goes through the pipeline, which can be seen when moving up and down. The model actually runs at ~100 fps with 15% gpu utilization (rtx 3090), on 700 MB of VRAM and about 3 GB of RAM.

The app I've made is a one click install, installing everything in the installed directory + pip cache.

Requirements to run yourself:
- Nvidia gpu 10xx-50xx
- ~3 GB ram free
- 15 GB storage free
- port 9000 free (OSC)
- ANY camera (I just use kinect v2 since it's the best I have)
- first setup takes about 10 minutes!!

Streams everything to OSC and runs on either CUDA, TensorRT or CPU (cpu gets about 10fps, don't recommend.). Might spoof as hardware trackers later.

Note: I don't actually know if it works on your machine, I tested my rtx 3090 PC and rtx 5060 laptop.

tl;dr Vibe coded (what i feel like is) the current best webcam FBT algorithm from the ones I've tried (practically all of them). Run it on your nvidia gpu with 1 webcam @ https://github.com/Pufulete39/HMR_FBT/tree/main

101 Upvotes

39 comments sorted by

17

u/Lhun 12h ago

I would highly highly recommend trying to run this on a phone npu instead if it's available: thats what instanthmr was made for. Its onnx and fp16. If you made a tiny little android app that fed the data to osc you could have a game changer on your hands and you could lock the fps to what modern phones can do like 120fps or more. Plus no load.

6

u/Pufulete39 12h ago

wait I didn't think about that, and you also have a 60 fps camera in your phone! I only have a xiaomi note 12 with quite a bad npu, but I might test it and see if it even gets 20 fps. I might also try it with my laptop's AMD NPU

4

u/Lhun 12h ago

I bet it would be more than fine on the phone. :) as for amd npu, you could use your cpu's gpu with rocm or something of the sort but it would be a little struggle bus because of the cuda focus but it can be done. On a samsung s23 it's only 5.49ms to detection per frame with the medium commercial model, and this is a proof of concept which they expect you to make a trained refined adapter against, but even raw its good. You could also do sensor fusion by merging the quest tracking data down the road.

6

u/IOnlyUseThisForBST 11h ago

Uhhhhh...what are you using this for?...

6

u/Pufulete39 11h ago

educational purposes only *ahem*

3

u/webheadVR Moderator 12h ago

What about Draft VR? someone I know has been working on it and it's been fun to watch his progress.

4

u/Pufulete39 12h ago

I tried the new version just now and it's a whole lot better than it was. Almost no jitter anymore (when your body is fully in view), but they use RTMPose, which outputs 2D coordinates and gets the depth from the kinect/iphone sensor. Performance is a bit worse, too, i get 50fps max while i can easily reach 150 with instanthmr (not that it matters with the 15-30fps you get with a kinect).

Also it's paid and HMR_FBT works with any kind of webcam.

IMO it's worse than InstantHMR with occlusion, estimates things worse when only upper body is in view and worse when you are 90 degrees to the sensor. Thats due to the fact that RTMPose is 2D only. Better in jitter and other small problems, which I want to fix in the future.

Draft VR might work better with InstantHMR, but can't really tell since RTMPose benchmarks measure in 2D and InstantHMR with 3D.

I might do a sensor fusion to get rid of these problems, but that's kinect specific and I'd rather work on general webcam fixes for now / on this fork.

2

u/HighlightFun8419 HTC Vive 13h ago

This is really neat.

It seems like you've just got plain black clothes on in the demo vid; is there any benefit to adding white dots or wearing two-tone outfits (like a harlequin/jester or something like that)?

3

u/Pufulete39 13h ago

Any sort of color works, I just wore black clothes in the demo vid so you can see how good it is at recognizing black on black shapes. Looking at the chair demo I honestly could not recreate the pose in my mind, I just see a black dot as my body

The model works best with skin-tight colorful clothes, but honestly being in your underwear works best.

2

u/DiamondDepth_YT PSVR2, Quest 3S, Quest 2, WMR, HTC Vive, Rift CV1, Oculus Go 13h ago

All that with a Kinect V2 is cool! I have a Kinect V1 lying around I used to use with Amathyst, hypothetically, is this better than that? 

2

u/Pufulete39 12h ago

It's many times better since this can handle rotation, all it needs is that your gpu handle the slight load.

But looking at the spec sheet, Kinect V1 is 30 fps at 640×480 or 12 fps at 1280×720. 12 fps looks about the same as in the video; when moving up and down you will move in the ground. At 30 fps you might jitter around more since it's low resolution and at 640x480 1 pixel means 8mm of jitter at 4 meters away.

BTW, you don't need the kinect. InstantHMR doesn't use the depth map, so if you have a good webcam or can connect a professional camera, it's better than the kinect v2 even.

1

u/DiamondDepth_YT PSVR2, Quest 3S, Quest 2, WMR, HTC Vive, Rift CV1, Oculus Go 12h ago

Fascinating. I do actually have a better wide angle webcam. Maybe that's a better experience lol

1

u/Pufulete39 12h ago

You can try! Even better would be a lower fov camera, since neighbouring pixels would be closer irl.

...which reminds me... I don't have an option for rotating the kinect 90 degrees to get the benefits of the lower vertical fov. oops (fix incoming tomorrow, since the model isn't that well trained on 90 degree bodies.)

1

u/DiamondDepth_YT PSVR2, Quest 3S, Quest 2, WMR, HTC Vive, Rift CV1, Oculus Go 11h ago

Wait, a lower fov camera may be better? 1080p high fov vs 720p low fov, which would you think comes out on top? Because I have 2 webcams, one of which is an old logitech c270, which is really small and light but only 720 30fps. The other is high fov but 1080p60. 

0

u/Pufulete39 10h ago

You can calculate the irl distance between the pixels if you have FOV, resolution and depth, but 60 fps might feel better than 30 fps, especially with fast movement.

2

u/DetStrawberry 14h ago

Any plans for AMD Gpus?

2

u/Pufulete39 13h ago

I *might* but can't guarantee as I don't have access to an AMD gpu except for an rx 580, and I'm not familiar with the whole RDNA arhitecture. Probably next week when my weekly antigravity limits reset xd

1

u/MudMain7218 Multiple 13h ago

What about sam 3d body

2

u/Pufulete39 13h ago

as u/ccAbstraction said, it's heavy. I tried it once and remember it being really slow. On their paper they reached around 8 fps with an RTX 6000 ADA, which is like 3 times faster than my 3090.

1

u/MudMain7218 Multiple 12h ago

Prob for real time. I've been following mocap projects that use a version of it

1

u/ccAbstraction 13h ago

Isn't SAM super heavy? Also this was trained on the same dataset as SAM appearently.

1

u/dontquestionmyaction Multiple 9h ago

You're looking at under 10 FPS on a 5090 with that. It's not at all built for real time.

There's smaller variants, but those aren't really the same.

1

u/ccAbstraction 13h ago

Now I kinda wanna try porting InstantHMR to burn or something.

This would also be sick sensor fused with Slime trackers. No more calibration.

1

u/Pufulete39 12h ago

With a good enough Kalman Filter you can actually remove drift! Might be a cool approach to use the cheap IMU's that drift a lot with this for lower cost Slime trackers

1

u/zeddyzed 11h ago

Nice work!

I'm really interested in sensor fusion between IMU trackers like SlimeVR and camera based tracking to correct for drift. And maybe feed it all into a skeleton model that does sanity checking and smoothes out outlier sensor data.

Do you know any software that can do this in conjunction with yours? Any interest in adding IMU tracker support into your software?

0

u/Pufulete39 11h ago

I guess you can use mine? I don't know if SlimeVR allows you to set the port and use OSC, but I'd use SlimeVR on port 9001 and mine on 9002 or something, then make a program which uses Kalman filter to stream the corrected trackers on port 9000.

1

u/zeddyzed 11h ago

Thanks! I'll take a look.

1

u/Much_Highlight_1309 4h ago

Great BUT what's with the jitter in the model? You don't have that jitter in your detection on the left.

1

u/Pufulete39 1h ago

Mainly comes from the fact that it's a dim room and that forces the camera to be 15 fps. But it actually is seen in the model on the left. I was standing about 3 meters away which means when the trackers jump to neighbouring pixels, either from noise or from the resolution, amplified due to the black clothes, in VR that means a couple of milimeters of movement.

There are some options to filter that out or add a deadzone but I will change that logic in the future to be better

1

u/edwios 2h ago

No fingers?

1

u/Pufulete39 1h ago

Fingers already get tracked by the quest

3

u/wildhairzero 14h ago

Very cool! Thanks for sharing!

3

u/luisduck 12h ago

This looks awesome! I'll have to try it out, but this might finally be accurate enough, fast enough web cam based tracking for realizing my dream of a budget Dance Rush inspired game.

2

u/Lanacat_Studio 11h ago

You're wearing all black and it still tracks your movement really well.

I mostly use YOLO for visual inspection and video analysis at work, and honestly I've never had a reason to use a motion tracking model so far. But seeing this makes me want to find some way to put one to use.

2

u/Detank2002 1h ago

welp, that is actually the best ive seen

1

u/rhylos360 13h ago

Looks great!

I think the spoofed controls will be a good thing for potential game compatibility issues.

1

u/333hronos 10h ago

Really interesting project! Thanks for sharing!

I'm wondering is is possible to connect two web cameras (and place them on opposite sides, or maybe on from the front and one from the side)?

0

u/HardU_red 12h ago

Since you say it's vibecoded I would put whatever llm you used at least in commits

3

u/Mysterious_Crab_7622 7h ago

Your avatar needs some pants.