pamruta / TensorFlowJS

Demos created using TensorFlow.JS
76 stars 27 forks source link

could not make it work, not processing the video frame #1

Closed unruledboy closed 4 years ago

unruledboy commented 4 years ago

all of the samples show the webcam feed, then stop processing the video.

take the Green-Screen.html for example, it runs green_screen_effect(), after processing the 1st frame, everything stops, including the webcam feed (it just freezes).

I am using latest version of Chrome (81.0.4044.122 64bit).

Chromium based new Edge is slightly better, at least the video feed does not freeze, but still nothing processed and only the backdrop shows on the right hand side.

pamruta commented 4 years ago

Check Browser settings or any error messages under Developer -> JavaScript Console..

In Safari, I had to uncheck the "Enable Source Maps" option under settings in Java Script Console, to get rid of some errors.. Also, demos for Object-Detection, Video-Tagging, Hand-Tracking and Activity-Recognition require external video files (.mp4) to be passed as inputs..

pamruta commented 4 years ago

Hi again, you can also test it on Code-Pen: https://codepen.io/ I have uploaded few samples at - https://codepen.io/pamruta/

As you mentioned, Chroma-Key is not working in Chrome, only in Safari I can see the output..

unruledboy commented 4 years ago

Hi,

Exact same problem, Chrome video freezes, then the whole browser hangs.

new Edge at least video streaming, but only render half a frame on the right:

image

pamruta commented 4 years ago

I am also able to run it only in Safari, not in Chrome / Firefox.. Let me check - there must be some issue with browser settings under developer options..

unruledboy commented 4 years ago

I don't have a Mac, the iPhone Safari has same issue as chrome, it only render 1 frame, then everything freezes.

And there is no error in the console.

pamruta commented 4 years ago

Hi there, sorry for the delay in responding.. Please check the updated code under Chroma-Key.html and live version at - https://codepen.io/pamruta/pen/gOPbLgo

I have tested it on Chrome, Firefox and Safari. I'll fix the rest of the scripts shortly, to make sure they work on all browsers..

Thanks!

unruledboy commented 4 years ago

it worked now. one suggestion, the shape of head is a quite jigsawed, can have some algo to make it more round/curved

pamruta commented 4 years ago

Body-Pix takes couple of options to fine-tune the segmentation output :

// options for body-pix model const options = { outputStride: 8, // 8, 16, or 32, default is 16 segmentationThreshold: 0.8 // 0 - 1, defaults to 0.5 };

OutputStride and Threshold..

e.g. high threshold may chop off some of the person parts, whereas, low threshold may show bits and pieces from the original background visible.. You can play with these options to set the optimal values..

I'll check with the TensorFlow team when the next version is likely to be out, with improved video segmentation.. I am also unable to use it in production due to output quality..