Hairstyle Transformation via Grid Deformation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for transforming hairstyles, such as affine transformation and large-scale modification of the CycleGAN training data set, often result in distorted outputs and are labor-intensive, unstable, and inefficient, especially when dealing with complex hairstyles.
Innovation Solution
The method determines a face bounding box based on face key points, constructs grids within this box, and deforms only the edge lines of the hairstyle using a target hairstyle function to obtain a deformed grid curve, avoiding the need to transform the entire face image and thus preventing distortion.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If affine transformation is used to deform the hairstyle, then the hairstyle can be transformed, but the output becomes distorted
Solution Approach 1:
The method segments the face image into multiple grid regions, with each grid independently deformed according to the hairstyle transformation requirements. This localized segmentation allows precise control over hairstyle deformation while preserving the integrity of the underlying face features, resolving the contradiction between ease of transformation and output accuracy.
2Ease of operation
If the entire face image is transformed to change hairstyle, then the hairstyle can be deformed, but the face image becomes distorted
Solution Approach 1:
The method extracts and isolates the hairstyle region from the rest of the face image by constructing grids that cover only the hair area. By applying deformation operations exclusively to these grid regions containing the hairstyle, the face image remains unaffected and undistorted, while achieving the desired hairstyle transformation.
3Adaptability or versatility
If large-scale modification of CycleGAN training data set is performed, then hairstyle transformation can be achieved, but labor cost and time increase significantly
Solution Approach 1:
Instead of modifying large amounts of training data, the method creates a virtual deformation model by constructing grids over the hairstyle region and applying mathematical transformation functions directly to these grids. This copying approach generates transformation results without requiring extensive data preparation, significantly reducing labor cost and time while maintaining versatility in hairstyle transformation.
4Manufacturing precision
If manual modification of training data is performed to obtain accurate hairstyle deformation, then deformation accuracy improves, but productivity decreases
Solution Approach 1:
The method replaces manual mechanical modification of training data with an automated mathematical system. By using grid construction and transformation functions (such as thin-plate spline or radial basis function interpolation), the system automatically achieves accurate hairstyle deformation without manual intervention, thereby maintaining high precision while significantly improving processing efficiency and productivity.
Data Source
Figure 1
Figure 2~3
Figure 4~5
AI summary
The present disclosure discloses a method, apparatus, device, and storage medium for transforming a hairstyle and a computer program product, and relates to the fields of image processing technology, augmented reality technology, and deep learning technology. A specific implementation includes: determining a face bounding box according to information on face key points of acquired face image; constructing grids according to the face bounding box; deforming, by using an acquired target hairstyle function, edge lines of at least a part of the constructed grids, which comprises the hairstyle, to obtain a deformed grid curve; determining a deformed hairstyle in the face image according to the deformed grid curve. The present disclosure employs a target hairstyle function to deform the edge lines of at least part of the grids, which comprises the hairstyle, and does not need to deform the face image as a whole and an output is accurate, and thus the deformed hairstyle in the face image is not distorted.