Giter Club home page Giter Club logo

Comments (4)

mpatacchiola avatar mpatacchiola commented on June 2, 2024

Hi @santo4ul

  1. Correct, this is using the OpenCV convention.
  2. Yes, you have to subtract 127 to center the values, image must be of size 64x64 pixels.
  3. Not sure what you mean by this, the images once loaded in tensorflow become tf.float32 tensors.

from deepgaze.

santo4ul avatar santo4ul commented on June 2, 2024

Hi @mpatacchiola

On 3. above, Originally the R, G and B channels are 8 bit signed values. We do mean subtraction and just pass it as is to the network. So the channels are still 8bit signed values.

On the Tensorflow side, at the input layer (Reshape), the 8bit signed values we pass is used as tf.float32.

For example,

Original Input: Signed 8 bit

B = 128
G = 129
R = 130

After mean subtraction:

B = 1
G = 2
R = 3

At Tensorflow input layer:
B = 1.0
G = 2.0
R = 3.0

What I mean is, there is no other pre-processing involved other than the mean subtraction of 127. Am I right?

from deepgaze.

mpatacchiola avatar mpatacchiola commented on June 2, 2024

Yes that is correct. You just have to normalize by subtracting 127.
The other thing you should do is to resize the image if it is larger that 64x64 pixels.
This is done using an inter area interpolation, in OpenCV you can do:

image_resized = cv2.resize(image, (64, 64), interpolation = cv2.INTER_AREA)

from deepgaze.

santo4ul avatar santo4ul commented on June 2, 2024

Thanks a lot @mpatacchiola for your prompt reply!

Yes, I'm resizing the input accordingly.

from deepgaze.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.