-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
Add Gallery VideoStream example #4047
Conversation
Looking good 😉 Definitely want to merge this one, can you remove the built app.html and app.js? They will get built automatically. We do have to work out how to link the pyodide versions of all the gallery examples from the docs though. |
Yes. I will remove them. But also plan to convert to notebook. But need to solve some of the issues first |
The app is now working really great. Next step is to turn it into a Notebook. |
First version of notebook created. |
Codecov Report
@@ Coverage Diff @@
## main #4047 +/- ##
==========================================
+ Coverage 82.71% 82.72% +0.01%
==========================================
Files 237 237
Lines 34276 34276
==========================================
+ Hits 28350 28354 +4
+ Misses 5926 5922 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I can see that the tests fail because it tries to run the VideoStream notebook with the kernel |
That's because you didn't clear out the metadata in the notebook. Will do that shortly. |
Co-authored-by: Simon Høxbro Hansen <simon.hansen@me.com>
26da9b7
to
861da43
Compare
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
☝️ If you decide that you can't be bothered to install pre-commit yourself you can apply it with a comment like above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing example and great work as always @MarcSkovMadsen, thanks!
Closes #4046
Server
The video shows the performance when running on the server. The key to getting this performance is setting the
VideoStream
format tojpeg
.png
is slow.video-stream-server.mp4
You can get more than 10fps. This includes a round trip from DK to Amsterdam and back. That is pretty amazing. And it means you can use deep learning frameworks like PyTorch that are not available in Webassembly.
Webassembly
The video shows the performance when converted to webassembly. Its fucking fast! (sorry)
video-stream-webassembly2.mp4
Try it
Online
https://awesome-panel.github.io/examples/ (Works in Chrome, not firefox)
Panel Serve
Panel Convert to webassembly
open http://localhost:8000/pyodide/app.html.
Issues identified and solved
.png
format of the stream is slow to work with..jpeg
is much better.Potential future improvements
Someday someone might be willing to invest in
panel-videostream
package that provides the reusable code from this example such that for users they only have to implement aCustomTransform
in 2-10 lines of code.Credits
Yuichiro for inspiration