-
-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IW3 - Any possibility of a realtime mode? #319
Comments
If you specify However, those who want realtime actually expect to be able to choose the video they want to play from the VR headset. |
@nagadomi Thank you for the response! What I’m suggesting isn’t about watching a file while it’s being converted. It’s rather about applying the depth estimation and 3D conversion in real-time to anything displayed on a PC screen, including games, web videos, or live streams. Essentially, the idea would be to process frames dynamically as they appear, rather than converting a pre-existing video file. The reason I brought up Virtual Desktop is that it already allows you to stream your PC screen to VR with SBS support. If IW3 had a real-time mode, it could theoretically take the live video feed from a PC screen and apply its depth-based conversion before sending it to VR, effectively turning anything you see into 3D. |
Maybe it is technically possible.
However, the results other than full screen playback maybe not good. |
If it's a toy level (HTML5 Video player with MJPEG stream, maybe laggy), |
I implemented this. |
If anyone gets interested, please give it a try. switch to the dev branch first. then see |
I tested it, and I’m genuinely impressed that you were able to implement this in just one day, it works pretty good! I had a couple of questions and suggestions regarding performance optimizations:
Let me know what you think! I’d be happy to test any further improvements. |
Little follow-up to my last message: I wanted to propose an additional optimization that could help improve performance in real-time mode. Instead of processing depth estimation for every frame, an adaptive motion-based depth frame skipping mechanism could be implemented. The idea is to dynamically adjust depth processing frequency based on motion intensity:
Combining motion-based depth frame skipping + depth frame skipping with with interpolation + proper batch size implementation for real-time mode (may already exist, but my testing didn’t yield noticeable improvements) could lead to significantly better performance and higher FPS. |
I will consider improving the FPS, but when using Any_V2_S, it seems that the performance of depth estimation model is not a bottleneck. On my machine(RTX3070Ti), the performance of Any_V2_S(resolution=392) itself can achieve about 120 FPS even with batch-size=1. Increasing the batch size will be helpful for improvement because it can improve everything including device memory transfer, image resizing and warping, etc. |
Wait, what? I'm barely getting 17 FPS in normal mode and around 7–9 FPS in desktop mode. My specs: Any idea what could be causing this? |
I made some minor improvements to iw3.desktop. 14FPS->24FPS. JPEG encoding was slow, I changed that. 120 FPS is the performance of the depth estimation model itself, not the video conversion. nunif/iw3/depth_anything_model.py Lines 235 to 252 in b3a5208
I changed B = 4 -> B = 1 , Any_L -> Any_V2_S ,then
Video conversion speed depends on the resolution of the input video, but can achieve 30 FPS(*1) for HD and 100 FPS for SD on my machine. If you think your env is too slow, check the following.
other settings are default values |
After implementing these changes, my performance has improved to around 15-17 FPS on average, already a good improvement. Do you have any additional ideas for further optimizing performance? Also, I believe the following features would greatly enhance usability, particularly when the user is not directly in front of the PC:
|
Hi, first of all, nice work! I can get over 800fps in the benchmark if I set batch size = 8, but only about 27fps streaming, my specs: it seems that changing the preset, model or CRF etc, makes little to no effect |
I parallelized screenshot and 3D conversion. on my machine improved 24FPS -> 48FPS.
iw3.desktop uses JPEG sequential images(MJPEG) not video codec, so those options are ignored. EDIT: |
That last update really helped, I'm getting ~60fps. It is still very stuttery, but much better than before. |
this is dream come true for me! I only have 14 streaming frames though on 4070ti. this is the same if i stream localy on my pc and also while watching on my browser app in mibox. Any way i can increase that stream speed. i'm currently using command : python -m iw3.desktop --depth-model Any_V2_S --divergence 2.75 --convergence 0.7 Thank you so much for doing this. if i can get it to 20-25 frames that would be amazing! |
I really think adding a real-time mode could be a solid addition. I don’t know all the technical details on how it would work under the hood, but the benefits are definitely there. Here are a few ways it could be useful:
To give some context on how this would even be used, there’s a program called Virtual Desktop that lets you remote into your PC using VR. It has an SBS mode, which means you can already watch anything on your PC in 3D if the output is SBS. If real-time support were possible, this could make that everything you see on your pc into 3D.
I actually think it would be pretty practical. I only have 12GB of VRAM and still manage to get around 26 FPS with IW3, and that’s with just a slight adjustment to the default config.
Not sure how realistic this is, but I’d love to hear your thoughts on it!
The text was updated successfully, but these errors were encountered: