Object Detection In Python Using Global Variables