Python Implementation of Non-maximum suppression