AdamLin:

UnboundLocalError: local variable ‘nms_keep’ referenced before assignment


This error claims that nms_keep is used before its creation/assignmen, so check your code and make sure nms_keep is properly initialized before its usage. This is often caused when variables are initialized inside an if condition, which is then never triggered.