Giter Site home page Giter Site logo

Comments (3)

JUGGHM avatar JUGGHM commented on June 14, 2024

Hello, thank you for your kind words!

But I have a question while using it. In the code, when normalizing the image, is the order of mean = torch.tensor([123.675, 116.28, 103.53]) in RGB or BGR?

I found that the line of code rgb_origin = cv2.imread(an['rgb'])[:, :, ::-1].copy().astype(np.float32) in

rgb_origin = cv2.imread(an['rgb'])[:, :, ::-1].copy()

has already converted the default BGR format, which is read by cv2.imread(), to RGB when reading the image.
Then, in this line of code rgb = cv2.cvtColor(rgb, cv2.COLOR_BGR2RGB) in https://github.com/YvanYin/Metric3D/blob/377e6c6642d0aca7aaa5a19e58fdcf5d0fd3d910/mono/utils/do_test.py#L189C5-L189C47, there is another conversion, which means the image is converted back to the BGR order. However, your comment says "BGR->RGB", so I would like to know whether the mean used for normalization is in RGB order or BGR order?

If I understand correctly, this normalization method is used to match the pre-trained ConvNext. However, it seems there is ambiguity here. Did you normalize the data in the training process in the same way, following the BGR order?

Thanks for pointing out this issue. We will fix it now.

from metric3d.

xbillowy avatar xbillowy commented on June 14, 2024

Thanks for your reply!

from metric3d.

boqian-li avatar boqian-li commented on June 14, 2024

Hi, I wanna know why this line still exits: rgb_origin = cv2.imread(an['rgb'])[:, :, ::-1].copy()
I wanna know we should use RGB order or BGR order for the input of the model??? @JUGGHM

from metric3d.

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.