for detection in results.xnty[0].tolist(): ^^^^^^^^^^^^ AttributeError: 'list' object has no attribute 'xnty'