I have fixed the bug and deleted the parts that are no longer used in pix_defect.py. I am adding @ytakubo .