from cv_analysis.utils.rectangle import Rectangle def box_to_rectangle(box): x, y, w, h = box return Rectangle(x, y, x + w, y + h)