larswaechter / quickdraw-cnn

A convolutional neural network using Tensorflow and Google's Quick, Draw! dataset to recognize hand drawn images.
https://larswaechter.dev/blog/recognizing-hand-drawn-doodles/
MIT License
11 stars 1 forks source link

I use resizeBilinear function,but now it seems to guess everything as the great wall of china. #2

Closed Qingyoum closed 9 months ago

Qingyoum commented 1 year ago
  const tensor = tf.tidy(
    () =>
      tf.image
        .resizeBilinear(
          tf.browser.fromPixels(document.querySelector("#defaultCanvas0")),
          [28, 28],
          true
        )
        .slice([0, 0, 0], [28, 28, 1])
        .toFloat()
        .div(255)
        .reshape([1, 28, 28, 1])
    //   tf.browser.fromPixels(img, 1).toFloat().expandDims(0)
  );
larswaechter commented 1 year ago

I've also used the resizeBilinear() function before, but I noticed a huge quality loss and strange color effects on the images after applying it. See the screenshot below. That's why I used the Python backend for resizing. Here, I don't have those effects.

I have no idea where those color effects come from. You might want to check out what your images look like after applying resizeBilinear(). Let me know what you found out :)

screenshot