Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why use 'BGR' to input image in demo_crop, set cfg.INPUT.FORMAT = 'RGB', and then flip image to 'RGB' before the image is fed into the network? Doesn't this cause confusion, or is there something special going on #30

Open
Clear-3d opened this issue Oct 9, 2023 · 1 comment

Comments

@Clear-3d
Copy link

Clear-3d commented Oct 9, 2023

First of all, many thanks to the authors for open sourcing such a great project. I was a little confused about the image format conversion.
Why use 'BGR' to input image in demo_crop, set cfg.INPUT.FORMAT = 'RGB', and then flip image to 'RGB' before the image is fed into the network? Doesn't this cause confusion, or is there something special going on.

  1. In detectron2/projects/CropFormer/demo_cropformer/demo_from_dirs.py
    img = read_image(path, format="BGR")
  2. at this time cfg.INPUT.FORMAT = 'RGB'
  3. and in detectron2/projects/CropFormer/demo_cropformer/predictor.py
    if self.input_format == "RGB":
    # whether the model expects BGR inputs or RGB
    original_image = original_image[:, :, ::-1]
    While the end result is correct, the process is confusing.
    If there is any special purpose, I really look forward to your explanation for me. Thank you again for such a good work.
    image

image

@Clear-3d
Copy link
Author

Clear-3d commented Oct 9, 2023

My problem is from https://github.com/qqlu/Entity/blob/main/Entityv2/CropFormer/demo_cropformer/demo_from_dirs.py when I tried to use that demo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant