1

i'm making a face recognition using Tensorflow JS and webcam , i saved my model , and then load it. The problem is my imaget data shape is always changed because of the face position

this is my code :

imgData = context.getImageData(from_left, from_top, potrait_height, potrait_height, 0, 0, potrait_height , potrait_height);
inputTensor = tf.browser.fromPixels(imgData);

my imageData always square because width or height are defined same as "potrait_height"

the problem is my model need 350,350,3 input shape , but my image data is always changed 250.250,3 or 300,300,3 or 400,400,3 depend on face position

how to resize imgData ?

Hjin
  • 320
  • 1
  • 11
  • Have you tryed to search https://stackoverflow.com/a/59213293/523630 ? – AndrewShmig Apr 01 '20 at 08:11
  • is thist the most efficient way ? cant we resize before imgData converted to a Tensor ? – Hjin Apr 01 '20 at 08:25
  • Is drawing from this canvas to another one the correct size before getting the data of the new canvas not a possibility? – enhzflep Apr 01 '20 at 09:45
  • Have you checked the solution provided here?: https://stackoverflow.com/questions/55340888/fast-way-to-resize-imagedata-in-browser – TF_Support Apr 03 '20 at 03:01

0 Answers0