Giter VIP home page Giter VIP logo

Comments (4)

thohemp avatar thohemp commented on August 30, 2024

Hello,

the predict method converts the image into RGB. So it's okay, to pass a BGR array.
https://github.com/thohemp/6DRepNet/blob/master/sixdrepnet/regressor.py#L67

from 6drepnet.

BryanGuillaume avatar BryanGuillaume commented on August 30, 2024

Hello,

Thanks for your reply. I have already seen that in the code. The problem is the line above (https://github.com/thohemp/6DRepNet/blob/master/sixdrepnet/regressor.py#L66):

img = Image.fromarray(img)

that, I think, by default, converts an array with three channels into an RGB PIL image as it does not now which channel is what color. Thus img is already an RGB PIL image but with its R and B channels inverted. Convertimg it to an RGB PIL image should not invert its channels. Though I might be wrong. If I have some time today, I will add some print function around the code to check if I am correct or not

from 6drepnet.

thohemp avatar thohemp commented on August 30, 2024

You are correct, I just tested it. Swapping channels before using PIL should fix this:

img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

Thanks!

from 6drepnet.

BryanGuillaume avatar BryanGuillaume commented on August 30, 2024

Thanks for checking this and happy that helped fix a bug at the end!

from 6drepnet.

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.