I’m not sure what data you are using, so I can’t say for sure, but it looks like your problem is with how you are loading your bounding boxes in the dataset.  The error shows that the bounding box is [790.0323486328125, 359.0328369140625, 790.0323486328125, 359.0328369140625], so the xmin and xmax are equal and the ymin and ymax are equal, resulting in a 0x0 box.
My hunch would be that the issue lies in how you are getting your dimensions in this part, but I don’t know what your annotations look like, so I can’t say for sure.
xmin = np.min(pos[1])
xmax = np.max(pos[1])
ymin = np.min(pos[0])
ymax = np.max(pos[0])