Skip to content

Result of tf.image.resizeBilinear in Java is different from tf.image.resize In python #333

Description

@mimilewis

tf version in python:2.5.0
tf version in java :2.4.1
Result of tf.image.resizeBilinear in Java is different from tf.image.resize In python
tf.image.cropAndResize can get the same result

Activity

  1. Craigacp commented on Jun 7, 2021

    @Craigacp
    Collaborator

    Are you specifying halfPixelCenters = true when you run that op in Java? It's set to true by Python's resize.

  2. mimilewis commented on Jun 7, 2021

    @mimilewis
    Author

    Are you specifying halfPixelCenters = true when you run that op in Java? It's set to true by Python's resize.

    After using it, the result is closer.
    python:[ 212.21364,222.1122,211.72565 ]
    java: [212.25,222.25,211.81567]

  3. Craigacp commented on Jun 7, 2021

    @Craigacp
    Collaborator

    Are you running it on the same hardware (i.e. CPU or GPU) for both languages? Also can you check the behaviour of tf python 2.4.1?

  4. karllessard commented on Jun 10, 2021

    @karllessard
    Collaborator

    Just to let you know that I've just merge this PR to upgrade the current 0.4.0 snapshots to TensorFlow 2.5.

    It should be ready to be tested out in about 8 hours from now and it could be interesting to see if that fixes the slight delta you are observing in the pixel values between Java and Python scaling (I have doubts but we never know).

  5. karllessard commented on Jun 11, 2021

    @karllessard
    Collaborator

    Ok, we had some trouble building the new snapshots with TF2.5 but it is ready now to be used for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions