Entity
Entity copied to clipboard
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
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.
- In detectron2/projects/CropFormer/demo_cropformer/demo_from_dirs.py img = read_image(path, format="BGR")
- at this time cfg.INPUT.FORMAT = 'RGB'
- 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.
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.