Thanks, @ptrblck. The masks I created had some noise in them, for lack of a better term, and so In the Dataset class creation, it was hard to get the bounding boxes created. Each mask file is supposed to have four masks/bounding boxes. By changing the index selection to “[-4:]”, the problem is fixed.
mask = Image.open(mask_path)

# Convert from image object to array
mask = np.array(mask)
        
obj_ids = np.unique(mask)

obj_ids = obj_ids[-4:] #Previously, I had [6:] to avoid the noise. This was causing my problem.