Question: What is the standard practice when performing inference on a video to maximise performance (FPS, Memory)?
See original GitHub issueTensorFlow.js version
Using this source for the script : https://cdn.jsdelivr.net/npm/@tensorflow/tfjs/dist/tf.min.js
Describe the question
I am trying to perform inference on a video and feed it back to a canvas. Current pipeline is: VideoTag -> Hidden Canvas -> OpencvJS(matrix conversions and resizing) -> TFJS Predict -> Post Processing using OpencvJS -> Display Canvas
Major blockages in the pipeline are DrawImage function
which draws image to the Hidden Canvas and post processing functions. Any suggestions on how we can improve this pipeline by using any TFJS libraries or any other libraries that are commonly used?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Object Detection from 9 FPS to 650 FPS in 6 Steps
This inference is a series of CUDA kernels submitted by the host (CPU) to the device (GPU) — the GPU is doing all...
Read more >How to BOOST FPS and Increase Performance on any PC
This is a simple tutorial on how to improve your FPS on Shatterline. This guide will help you to optimize your game.This video...
Read more >Performance Tuning Guide - PyTorch
Performance Tuning Guide is a set of optimizations and best practices which can accelerate training and inference of deep learning models in PyTorch....
Read more >How To Optimize Settings in Call of Duty: Warzone ... - NVIDIA
Learn why frames per second (FPS) matter when playing COD: Warzone. ... Warzone To Maximize Performance And Gain A Competitive Advantage.
Read more >YoloV5 way too less FPS, how can I fix it? - Stack Overflow
The easier, the better. Try with smaller models such as YOLOv5s or YOLOv5n · What about using your GPU for inference? Add this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @sacredvoid - as Ping mentioned you should be able to achieve faster performance by directly rendering the TFJS output texture for post processing. The key is to initialize a custom WebGL backend with your own WebGL context, like so:
This way, you can access the WebGL context that TFJS uses for computation and chain a rendering shader to the end of the inference pipeline. Within the rendering shader you could perform RGB -> YUV conversion, as described in this post: https://stackoverflow.com/questions/7901519/how-to-use-opengl-fragment-shader-to-convert-rgb-to-yuv420
Hi @sacredvoid. I am trying to develop a very similar application to the one you’re making. Did you get it working by setting up the same context for the canvas and TFjs? Any chance you have some sample code to help out? Would be much appreciated!!