SparseInst
SparseInst copied to clipboard
Bug of `demo.py`
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.
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 it still haven't been fixed now.
@wondervictor Thank you for the wonderful project. I also encountered the same problem, when will it be fixed?