tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

BodyPix - drawBokehEffect stretched background on Safari Browsers (MacOS - iOS)

Open guillaume250 opened this issue 5 years ago • 11 comments

System information

  • Wrote custom code and tried stock examples.
  • macOS Big Sur 11.1
  • Safari iOS browser
  • TensorFlow.js installed from (npm and script link): 1.2 for script link & tfjs-core 3.1.0 npm version
  • Browser version: Safari Version 14.0.2 (16610.3.7.1.9)
  • Tensorflow.js Converter Version: 3.1.0

Describe the current behavior On Safari browsers when blurring the background of video tracks coming from a navigator.mediaDevices.getUserMedia stream, the blurred background seems stretched.

Assuming this is a Safari only issue, I think an aspect ratio fix on the cpuBlur function should do it. 😉

Describe the expected behavior drawBokehEffect expected behavior

Standalone code to reproduce the issue Opening the codepen below in Safari should immediately reproduce the bug. https://codepen.io/guillaume250/pen/ZEBVPaG

  • Cheers

guillaume250 avatar Mar 12 '21 03:03 guillaume250

Hi @guillaume250. Thanks for the codepen reproduction! drawBokehEffect bases its output dimensions on the video element's width and height properties (although perhaps it shouldn't). If you set the video element's width and height to match the camera's aspect ratio, the output should have the correct aspect ratio. See my fork of your codepen as an example.

Feel free to re-open if this doesn't solve the issue.

mattsoulanille avatar Mar 12 '21 16:03 mattsoulanille

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Mar 12 '21 16:03 google-ml-butler[bot]

Hi @mattsoulanille, thanks for the quick response, and the fork. I just opened your fork in a safari browser and still see the same issue.

Screen Shot 2021-03-15 at 1 36 47 PM

Screen Shot 2021-03-15 at 1 37 31 PM

guillaume250 avatar Mar 15 '21 17:03 guillaume250

I initially thought your report was about the incorrect aspect ratio of the output image, but I've been able to reproduce the issue you're seeing on Safari. I'll take a look. Thanks!

mattsoulanille avatar Mar 16 '21 16:03 mattsoulanille

Any updates on this issue? @mattsoulanille how have you overcome issue?

alexopoulos7 avatar Jan 15 '22 08:01 alexopoulos7

can you please check with latest body segmentation model and let us know if this is resolved ?

rthadur avatar Mar 17 '22 21:03 rthadur

Just checked with [email protected] CDN version. Issue still there

guillaume250 avatar Mar 21 '22 04:03 guillaume250

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.

google-ml-butler[bot] avatar Mar 28 '22 04:03 google-ml-butler[bot]

@guillaume250 we will not be updating body-pix , there is a new body segmentation model here https://blog.tensorflow.org/2022/01/body-segmentation.html , did you get chance to check this out? Thank you

rthadur avatar Mar 28 '22 16:03 rthadur

Closing as stale. Please @mention us if this needs more attention.

google-ml-butler[bot] avatar Apr 04 '22 16:04 google-ml-butler[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Apr 04 '22 16:04 google-ml-butler[bot]