SparseInst icon indicating copy to clipboard operation
SparseInst copied to clipboard

Bug of `demo.py`

Open leftthomas opened this issue 2 years ago • 3 comments

According to your code, the input image is in RGB format: https://github.com/hustvl/SparseInst/blob/fd6fb385b152d232988542aae3072a8fe5d545ae/configs/Base-SparseInst.yaml#L33 and the given mean and std is also in RGB format: https://github.com/hustvl/SparseInst/blob/fd6fb385b152d232988542aae3072a8fe5d545ae/configs/Base-SparseInst.yaml#L4-L5 In demo.py, the image is read as RGB format: https://github.com/hustvl/SparseInst/blob/fd6fb385b152d232988542aae3072a8fe5d545ae/demo.py#L93 and then passed to DefaultPredictor: https://github.com/hustvl/SparseInst/blob/fd6fb385b152d232988542aae3072a8fe5d545ae/sparseinst/d2_predictor.py#L36-L49 In DefaultPredictor, the image is firstly converted into BGR format: https://github.com/facebookresearch/detectron2/blob/96c752ce821a3340e27edd51c28a00665dd32a30/detectron2/engine/defaults.py#L309 and finally be normalized according to the given mean and std: https://github.com/hustvl/SparseInst/blob/fd6fb385b152d232988542aae3072a8fe5d545ae/sparseinst/sparseinst.py#L61 As the given mean and std is in RGB format and the image is in BGR format, so there remains a mismatch.

leftthomas avatar Dec 04 '22 18:12 leftthomas

Hi @leftthomas, I'm so sorry for the late reply. Thank you for reminding me of this problem and I'll check and fix it soon~

wondervictor avatar Jan 03 '23 04:01 wondervictor

@wondervictor it still haven't been fixed now.

leftthomas avatar May 13 '23 05:05 leftthomas

@wondervictor Thank you for the wonderful project. I also encountered the same problem, when will it be fixed?

nai-kon avatar Jan 23 '24 00:01 nai-kon