Skip to content
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

How to process one image at a time with the ChaiDNN v2? #147

Open
mazhongzhong opened this issue Feb 20, 2019 · 6 comments
Open

How to process one image at a time with the ChaiDNN v2? #147

mazhongzhong opened this issue Feb 20, 2019 · 6 comments

Comments

@mazhongzhong
Copy link

mazhongzhong commented Feb 20, 2019

It seems the ChaiDNN v2 has to have two images as input. But if you want to deal with videos, the standard procedure is: grab a video frame, processing it, grab next frame, processing this new frame, and so on. But when I trying to process a video with the ChaiDNN v2, I'm running into a problem. With the current using paradigm, the video process procedure becomes: grab video frame 1, do nothing, grab video frame 2, processing 1 and 2, grab video frame 3, do nothing, grab video frame 4, processing 3 and 4...
So, does anyone know how to input one (and only one) image into the ChaiDNN v2 at a time? Or, can anyone provides a example to demonstrate how to process video streams/image sequences with ChaiDNN v2?

@mazhongzhong mazhongzhong changed the title How to process one image at a time with the ChaiDNN Very? How to process one image at a time with the ChaiDNN v2? Feb 20, 2019
@VishalX
Copy link
Collaborator

VishalX commented Feb 20, 2019

@mazhongzhong
CHaiDNN-v2 design uses a batch of 2.
You can run the design with one frame (Leave the other empty/un-initialized). But, In this way, you'll only utilize half of the compute capabilities of the design.

@mazhongzhong
Copy link
Author

@VishalX
We've tried leave the other empty/un-initialized, that'll end up with the wrong result of that single frame. So, for the time being, we have to duplicate one frame, then feed the two frames (the original one and the duplicated one) to the ChaiDNN at the same time, and throw away half of the results in the end. And the most frustrated fact is, throwing away half of the results is very time consuming. In our case, it takes about 170ms to complete the inference of our neural network model, and takes more than 500ms to unpack the two results (so the two results are continuous in the memory, respectively).

Thanks anyway.

And anyone know better ways to process videos with ChaiDNN v2?

@cuongdv1
Copy link

I can process video as below flow

Open video file
LOOP
{
grab frame 1
grab frame 2
normaliztion (frame1, frame2, outbuff)
xiReadInput(outbuff, input)
xiExe(input, output)
unpack(output)
}

@mazhongzhong
Copy link
Author

@cuongdv1
I have mentioned this flow. Unfortunately, it doesn't work for a lot of applications. For example, tracking objects in an video.

@hpollittsmith
Copy link

Would you be able to share your code for reading in frames and running inference? I would like to do something similar.

@srinivasans74
Copy link

Hey i installed Chaidnn Hardware and i installed the software through make files. Where can i find the perfomance report of the compilation that i have done in the make file?.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants