maum-ai / faceshifter

Unofficial PyTorch Implementation for FaceShifter (https://arxiv.org/abs/1912.13457)
BSD 3-Clause "New" or "Revised" License
612 stars 115 forks source link

Fixed IndexError & NameError when ```dets <=0 ``` #22

Closed Ewan-Yepic closed 3 years ago

Ewan-Yepic commented 3 years ago

at line 43 if len(dets) <= 0: was missing '=' so if no face landmark was detected, it would not get 'filtered out' in if / elseresulting in IndexError(essentially rendering the whole if/else structure useless) Also, once IndexError is resolved, due to the issue with indentation at line 54, the image with no detsvalue would still be processed in the loop resulting in an error as else ends prematurely.