def calculate_mask_iou(mask1: np.ndarray, mask2: np.ndarray) -> float:
        """
        Calculate the Intersection over Union (IoU) of two binary masks.

        Args:
            mask1 (np.ndarray): The first binary mask as a NumPy array.
            mask2 (np.ndarray): The second binary mask as a NumPy array.

        Returns:
            float: The IoU (Intersection over Union) between the two masks.
        """
        # Calculate the intersection
        intersection = np.logical_and(mask1, mask2)

        # Calculate the union
        union = np.logical_or(mask1, mask2)

        # Calculate IoU
        iou = np.sum(intersection) / np.sum(union)

        return iou

        Calculate the Intersection over Union (IoU) of two binary masks.

        Args:
            mask1 (np.ndarray): The first binary mask as a NumPy array.
            mask2 (np.ndarray): The second binary mask as a NumPy array.

        Returns:
            float: The IoU (Intersection over Union) between the two masks.
        
scripts/easyphoto_utils/tryon_utils.py