def python_find_non_zero(self, image: np.array):
        """This is a reimplementation of a findNonZero function equivalent to cv2."""
        non_zero_indices = np.column_stack(np.nonzero(image))
        idxvec = non_zero_indices[:, [1, 0]]
        idxvec = idxvec.reshape(-1, 1, 2)
        return idxvec
This is a reimplementation of a findNonZero function equivalent to cv2.
dpkd/transformers/src/transformers/models/nougat/image_processing_nougat.py