VIBE icon indicating copy to clipboard operation
VIBE copied to clipboard

Online Inference

Open Zumbalamambo opened this issue 4 years ago • 22 comments

How do I get the online inference?

Zumbalamambo avatar Mar 11 '20 23:03 Zumbalamambo

This is something we are planning to work on. I will update here.

mkocabas avatar Mar 19 '20 08:03 mkocabas

I have run a couple of instances on colab, works really well. Here is a link to my colab notebook which should work right away. I have done a video of a couple of inferences (VIBE rendering starts @ 23"): https://youtu.be/xyo5gl5GLEI

Hope it helps, good luck!

Tetsujinfr avatar Apr 03 '20 10:04 Tetsujinfr

It's throwing the following error

NameError: name 'YouTubeVideo' is not defined

Zumbalamambo avatar Apr 03 '20 11:04 Zumbalamambo

Let me have a look. I cleaned up the notebook before posting, so possibly I forgot an instruction. Will double check later today and revert.

Tetsujinfr avatar Apr 03 '20 13:04 Tetsujinfr

Should work now, have a look at the updated notbook on my repo. I forgot initially to declare the youtube download module... Let me know any issue. If you want to feed the model with a webcam stream, you will have to play with the VIBE code I am afraid (I did not look at that part yet).

Tetsujinfr avatar Apr 03 '20 15:04 Tetsujinfr

@Tetsujinfr it doesn't look like an online inference code. One needs to run VIBE together with the multi person tracker. We use an online tracker but it is a bit hacky to integrate it with VIBE.

mkocabas avatar Apr 03 '20 18:04 mkocabas

Sorry, did I do something incorrectly? I kind of fast did it but did I miss a piece in the inferencing steps?

Tetsujinfr avatar Apr 04 '20 00:04 Tetsujinfr

Not really. Here what @Zumbalamambo asks for is the implementation of online inference where you have a live feed eg. webcam. To achieve this you need to adapt multi-person-tracker. I didn't see that in your implementation.

mkocabas avatar Apr 04 '20 09:04 mkocabas

Ok got you. I misunderatood that thread, I thought the one asking for the webcam was #46 and this one was just like "how do I run this model online (end to end), but indeed the notebook I quickly put together is a bit hacky and not meant to be a proper piece of code (I am not a coder). Regarding the webcam piece, do you have a suggestion w.r.t performance? Executing the 2d pose estimation and then the VIBE model requires sequential model loading (I assume both models can not load in memory at the same time but do not know for sure), so the end to end inference performance would likely suffer a lot. Am I correct? Do you have an approach on this? Thanks a lot

Tetsujinfr avatar Apr 04 '20 12:04 Tetsujinfr

Looking for a webcam, inference. I can help out maybe? if it's already underway ? Kindly revert back Thanks!

jaggernaut007 avatar May 26 '20 20:05 jaggernaut007

@jaggernaut007 yes!..trying to do webcam inference

Zumbalamambo avatar May 26 '20 21:05 Zumbalamambo

Did anyone try webcam inference? If yes, please share the changes that need to be done or share the inference code. thanks.

ujjawalcse avatar Aug 11 '20 05:08 ujjawalcse

This is something we are planning to work on. I will update here.

Hello @mkocabas ! Firstly, thank you for sharing the work. is there an update about the real-time/video-cam implementation ?

Thanks

ghost avatar Sep 01 '20 05:09 ghost

Hello all. I have some simple additions to the demo code to include the webcam inference ( https://github.com/gayatriprasad/VIBE ). Feel free to give it a try and pass on the feedback. You can run it using the following command : python demo.py --webcam --display --output_folder webcam/

ghost avatar Sep 18 '20 09:09 ghost

Hi @gayatriprasad , Can you share with me the code ? I'll try it. My Gmail :- [email protected]

ujjawalcse avatar Sep 18 '20 12:09 ujjawalcse

Hi @gayatriprasad , Can you share with me the code ? I'll try it. My Gmail :- [email protected]

Added the link to the code in the comment.

ghost avatar Sep 18 '20 13:09 ghost

Hey @gayatriprasad, You added only inference code that is just capturing video from the webcam and store it to local machine and then vibe code is taking it as input video_file and producing results. But it's not real-time.

ujjawalcse avatar Sep 22 '20 11:09 ujjawalcse

Hi there. Any updates on the live inference feature?

alexeybozhchenko avatar Mar 16 '21 11:03 alexeybozhchenko

I implemented a frame-by-frame inference version of VIBE, which is capable for real-time inference. Project at: https://github.com/zc402/RT-VIBE. Try with Google Colab: https://colab.research.google.com/drive/1VKXGTfwIYT-ltbbEjhCpEczGpksb8I7o?usp=sharing

Interface:

import cv2
from vibe.rt.rt_vibe import RtVibe

rt_vibe = RtVibe()
cap = cv2.VideoCapture('sample_video.mp4')
while cap.isOpened():
    ret, frame = cap.read()
    rt_vibe(frame)  # This will open a cv2 window

(I don't have a camera on my machine so I can't test camera code for google colab, it may not work.)

zc402 avatar Nov 29 '21 05:11 zc402

@zc402 I have tested your codes, it's really awsome , thanks a lot.

ykk648 avatar Apr 28 '22 13:04 ykk648

@ykk648 you're welcome

zc402 avatar May 03 '22 04:05 zc402

@ykk648 you're welcome

I found the cam params converge worse, and i use weak perspective in my code, in which kpy_2d = scale(kyp3d[, :2] + txy ). I think the key reason is the focal length of the dataset is different with each image, and it range from 400 mm to 800 mm. So maybe the network cannot regress the scale well? As "It is common to assume a fixed focal length to perform perspective projection. " . I wonder if the performance would be improved if i use perspective projection instead of weak perspective?

lvZic avatar Nov 11 '22 03:11 lvZic