Online Portrait Generation Method and System Based on Node-Type Artificial Intelligence
Through the node-based artificial intelligence online portrait generation method, the problem of low portrait generation quality in the prior art is solved by obtaining background image and portrait posture information and the parameter unification, and high-quality, personalized online portrait generation is achieved.
Patent Information
- Application Number
- CN202411681336.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2044-11-22
AI Technical Summary
The prior art cannot effectively ensure the facial detail accuracy of the image when generating portraits, and it is prone to blurring edges or unnatural problems, and lacks personalized customization capabilities, and a single style and scene, resulting in low quality of the output image.
Through the online portrait generation method based on node-based artificial intelligence, background image information and portrait posture information are obtained, combined processing and parameter unification are performed, edge contour features are extracted, fit degree is determined, and parameter correction is performed when unqualified, including resolution, light direction and chromaticity unification, until qualified online portrait information is generated.
It improves the quality and efficiency of online portrait generation, ensures the fit between portraits and scenes, and realizes the output of personalized customization capabilities and diverse styles.
Smart Images

Figure CN119600140B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular, to an online portrait generation method and system based on node-based artificial intelligence. Background Art
[0002] With the rapid development of artificial intelligence technology, especially the breakthroughs in the fields of deep learning and computer vision, computers can generate high-quality images in an unprecedented way based on AIGC (AI Generated Content), thus significantly improving image generation technology through AIGC. Currently, AIGC has been widely applied to various image generation scenarios, such as virtual character generation, stylized photos, intelligent beautification, etc. Using AIGC technology has gradually replaced some functions of traditional photography, reducing the photography cost and shortening the post-processing process.
[0003] Although great progress has been made in generating portraits using AIGC, it is still unable to achieve the accuracy of real shooting in processing facial details, hair, skin texture, etc. of images, and problems such as blurred or unnatural image edges are likely to occur. Moreover, there are also problems such as insufficient personalized customization ability, single style and scene, and the output image quality cannot be guaranteed. Summary of the Invention
[0004] Therefore, the present invention provides an online portrait generation method and system based on node-based artificial intelligence to overcome the problem of low quality of online portrait generation caused by the inability of portraits to fit the generated scene in the prior art.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] On the one hand, the present invention provides an online image generation method based on node-based artificial intelligence, including:
[0007] Controlling a data training model based on the obtained generation requirement to generate background image information and portrait pose information;
[0008] Performing a merging process on the background image information and the portrait pose information to obtain target image information;
[0009] Obtaining original image information and cropping the facial image information in the original image information, and merging the cropped facial image information into the target image information to obtain merged portrait information;
[0010] Performing a parameter unification process on the merged portrait information to obtain online portrait information, where the parameter unification process includes resolution unification, light direction unification, and chromaticity unification;
[0011] Extract features from the online portrait information to obtain the edge contour features of the preprocessed facial image information, and determine the degree of fit between the preprocessed facial image information and the target image information based on the edge contour features;
[0012] Determine whether the online portrait information is qualified based on the degree of fit, and determine the reason for disqualification based on the degree of fit when it is determined that the online portrait information is unqualified;
[0013] After determining the reason for disqualification, generate a corresponding correction method based on the determined reason;
[0014] Generate a corresponding instruction based on the determined correction method, and re-determine the corresponding parameters in the process of generating the online portrait information according to the corresponding instruction;
[0015] Regenerate the online portrait information based on the determined parameters, and issue a qualified instruction when it is re-determined that the generated online portrait information is qualified, and output the qualified online portrait information.
[0016] Furthermore, the process of uniformly processing the parameters of the merged portrait information includes:
[0017] After obtaining the merged portrait information, determine the resolution scaling ratio of the facial image information to complete the resolution unification process of the facial image information and the target image information;
[0018] Correct the light direction for the facial image information based on the target image information, and perform shadow compensation on the facial image information according to the determined light direction to complete the unification of the light directions of the facial image information and the target image information;
[0019] Obtain the facial feature information of the facial image information, and determine the deformation magnification of each facial feature respectively to complete the fine-tuning of the facial image information, where the deformation magnification is the magnification when the edge contour at the corresponding position of the facial image information is deformed when merged into the target image information;
[0020] Collect a preset number of pixel points from the facial image information respectively, and determine the chromaticity of the target image information based on the collected pixel points to complete the chromaticity unification process of the facial image information and the target image information, and generate online portrait information after the unification process is completed.
[0021] Furthermore, the process of determining whether the generated online portrait information is qualified based on the degree of fit includes:
[0022] Identify and obtain the edge contour features of the facial image information in the online portrait information, where the edge contour features are the edge contours of the facial image information that can be recognized in the online portrait information;
[0023] Calculate the ratio of the length of the edge contour features to the total length of the edge contours of the facial image information, and record the obtained ratio as the degree of fit;
[0024] Compare the degree of fit with a pre-stored first preset degree of fit and a second preset degree of fit, and based on the comparison result, determine whether the generated online portrait information is qualified. And based on the determination result, determine whether the generated online portrait information is qualified based on the number of the obtained edge contour features, or determine the reason for non-conformity based on the difference in the degree of fit. The difference in the degree of fit is the difference between the degree of fit and the second preset degree of fit.
[0025] Further, the process of determining whether the online portrait information is qualified based on the number of the edge contour features includes:
[0026] Count the number of the obtained edge contour features and compare this number with a preset number of features;
[0027] Based on the comparison result, determine the reason for the non-conformity of the online portrait information based on the difference in the degree of fit, or determine the correction method for the corresponding parameters in the fine-tuning process for the facial image information based on the difference in the number of features. The difference in the number of features is the difference between the number of the edge contour features and the preset number of features.
[0028] Further, the process of determining the correction method for the facial image information based on the difference in the number of features includes:
[0029] Re-determine the deformation magnification according to the obtained difference in the number of features;
[0030] Compare the difference in the number of features with a preset difference in the number of features, and based on the comparison result, use a deformation magnification adjustment coefficient to correct the deformation magnification to a corresponding value. The difference in the number of features is proportional to the reduction amplitude of the deformation magnification.
[0031] Further, the process of determining the reason for the non-conformity of the generated online portrait information based on the difference in the degree of fit includes:
[0032] Compare the obtained difference in the degree of fit with a preset difference in the degree of fit;
[0033] And based on the comparison result, determine the reason for the non-conformity of the online portrait information, including that the process of unifying the light direction does not meet the standard, the process of unifying the chromaticity does not meet the standard, and the process of unifying the resolution does not meet the standard;
[0034] Determine the corresponding processing method based on the determined reasons, including:
[0035] When it is determined that the reason is that the process of unifying the light direction does not meet the standard, correct the vertical illumination distance to the corresponding value based on the physical contour and shadow contour in the online portrait information, where the vertical illumination distance is the distance between the facial image information and the light source in the depth of field direction in the target image information;
[0036] When it is determined that the reason is that the process of unifying the chromaticity does not meet the standard, correct the pixel acquisition quantity to the corresponding value based on the chromaticity difference in the online portrait information, where the chromaticity difference is the difference between the chromaticity of the target image information and the chromaticity of the facial image information, and the pixel acquisition quantity is the number of pixels collected from the facial image information when obtaining the online portrait information;
[0037] When it is determined that the reason is that the process of unifying the resolution does not meet the standard, correct the average spacing of pixel acquisition points to the corresponding value based on the resolution difference of the online portrait information, where the resolution difference is the difference between the resolution of the target image information and the resolution of the facial image information, and the average spacing of pixel acquisition points is the average value of the distances between several pixels collected on the facial image information.
[0038] Further, the process of re - determining the vertical illumination distance in the process of unifying the light direction includes:
[0039] Re - obtain the online portrait information, and capture the shadow contour information and physical contour information from the online portrait information;
[0040] Perform pairing processing on the shadow contour information and the physical contour information to generate several light - shadow contour groups, and perform feature point matching for a single light - shadow contour group. Among them, a single feature point at the corresponding position in the physical contour information and a single feature point representing the same position in the shadow contour information within the same light - shadow contour group are recorded as the feature point group belonging to the light - shadow contour group;
[0041] Connect the lines for each feature point group, obtain the angles between each connection line and the horizontal line, and correct the vertical illumination distance according to the variance of each angle;
[0042] Compare the variance with a preset variance, and correct the vertical illumination distance to the corresponding value using a vertical illumination distance adjustment coefficient based on the comparison result, where the variance is proportional to the reduction amplitude of the vertical illumination distance.
[0043] Further, the process of re - determining the pixel acquisition quantity in the process of unifying the chromaticity includes:
[0044] Re-obtain the online portrait information, obtain the chromaticity difference from the online portrait information, and correct the pixel acquisition quantity according to the chromaticity difference;
[0045] Compare the chromaticity difference with a preset chromaticity difference, and based on the comparison result, use a pixel acquisition quantity adjustment coefficient to correct the pixel acquisition quantity to a corresponding value, wherein the chromaticity difference is proportional to the increase amplitude of the pixel acquisition quantity.
[0046] Further, the process of re-determining the average spacing of pixel acquisition points in the resolution unification process includes:
[0047] After completing the correction of the pixel acquisition quantity, correct the average spacing of pixel acquisition points according to the resolution difference between the target image information and the facial image information;
[0048] Compare the resolution difference with a preset resolution difference, and based on the comparison result, use a pixel acquisition point average spacing adjustment coefficient to correct the average spacing of pixel acquisition points to a corresponding value, wherein the resolution difference is proportional to the increase amplitude of the average spacing of pixel acquisition points.
[0049] On the other hand, the present invention also provides an online portrait generation system based on node-type artificial intelligence, including:
[0050] A demand customization module, configured to receive an online portrait generation demand;
[0051] A scene generation module, connected to the demand customization module, and configured to generate background image information and human pose information;
[0052] An overlay module, connected to the scene generation module, and configured to perform a merging process on the background image information and the human pose information to obtain target image information;
[0053] A cropping module, configured to obtain original image information and crop the facial image information in the original image information;
[0054] A merging module, connected to both the cropping module and the overlay module, and configured to merge the cropped facial image information into the target image information to obtain merged portrait information;
[0055] A preprocessing module, connected to the generation module, and configured to perform parameter preprocessing on the facial image information in the merged portrait information to obtain online portrait information;
[0056] An identification module, which is connected to the preprocessing module and is used to determine the degree of fit between the facial image information and the target image information based on the obtained edge contour features, where the edge contour features are the edge contours of the facial image information that can be recognized in the online portrait information;
[0057] An analysis module, which is connected to the identification module and is used to determine whether the generated online portrait information is qualified based on the degree of fit, and, when it is determined that the generated online portrait information is unqualified, to determine the unqualified reason based on the degree of fit. The analysis module is also used to generate corresponding correction methods based on the determined reason;
[0058] An instruction generation module, which is connected to the analysis module and is used to generate corresponding instructions according to the determined correction method, and to re-determine the corresponding parameters in the process of generating the online portrait information according to the corresponding instructions;
[0059] An output module, which is connected to the instruction generation module and is used to output the online portrait information when the analysis module determines that the generated online portrait information is qualified.
[0060] Compared with the prior art, the beneficial effects of an online portrait generation method based on node-based artificial intelligence of the present invention are as follows. The present invention determines the target image information through the obtained generation requirements, and can effectively improve the personalized customization ability in the process of generating the online portrait while ensuring the diversification of the style and scene of the subsequent online portrait information. At the same time, the present invention determines whether the generated online portrait information is qualified according to the degree of fit between the facial image information and the target image information, and corrects the corresponding parameters in the generation process based on the determined reason when it is determined to be unqualified, which can effectively ensure the fit between the portrait and the scene in the subsequent generated online portrait information, thereby effectively improving the generation quality of the online portrait of the present invention.
[0061] Furthermore, the present invention also uniformly processes the facial image information and the target image information in four directions: resolution, fine-tuning of facial features, light angle, and chromaticity, so as to further improve the generation quality of the online portrait of the present invention on the premise of ensuring the degree of fit between the facial image information and the target image information.
[0062] Furthermore, the present invention compares the degree of fit with the pre-stored first preset degree of fit and second preset degree of fit, and can thus quickly determine whether the generated online portrait information is qualified, so as to timely correct the parameters of the combined portrait information. While effectively avoiding the situation of non-fit in the generated online portrait information due to mismatched parameter preprocessing, the generation efficiency of the online portrait information is effectively improved, and the generation quality of the online portrait information is further improved.
[0063] Furthermore, the present invention can also compare the number of edge contour features obtained with the pre-stored preset feature number, re-determine the facial features in the facial image information, thereby making the determination process for the online portrait information more accurate, and determining the correction method for the fine-tuning parameters for the facial image information based on the difference in the number of features, thus further ensuring the generation quality of the online portrait information.
[0064] Furthermore, after determining the correction method for the fine-tuning parameters for the facial image information, each deformation magnification is corrected to the corresponding value through the corresponding deformation magnification adjustment coefficients, improving the correction speed and correction accuracy of the online portrait information.
[0065] Furthermore, based on the determination that the generated online portrait information is unqualified, the present invention compares the obtained fit difference with the pre-stored first preset fit difference and second preset fit difference, and can thus quickly determine the reason for the disqualification of the generated online portrait information, and re-correct the light direction, chromaticity, and resolution uniformity for the corresponding reasons, thereby effectively improving the correction efficiency of the online portrait information.
[0066] Furthermore, the present invention corrects the vertical illumination distance according to the variance of the connection angle, so that the light and shadow of the corrected facial image information in the target image information meet the user's requirements, thereby ensuring the fit between the facial image information and the target image information, and further ensuring the generation quality of the online portrait information.
[0067] Furthermore, the present invention corrects the pixel acquisition quantity according to the chromaticity difference, so that the chromaticity difference between the corrected facial image information and the target image information meets the user's requirements, thereby being able to ensure the fit between the facial image information and the target image information, and further ensuring the generation quality of the online portrait information.
[0068] Furthermore, the present invention corrects the average spacing of the pixel acquisition points according to the resolution difference, so that the resolution when merging the facial image information into the target image information meets the user's requirements, thereby being able to ensure the fit between the facial image information and the target image information, and further ensuring the generation quality of the online portrait information.
[0069] The beneficial effect of an online portrait generation system based on node-based artificial intelligence of the present invention lies in that the system of the present invention is applied to an online portrait generation method based on node-based artificial intelligence as described in any one of the above. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 is a schematic module diagram of an online portrait generation system based on node-based artificial intelligence of the present invention;
[0071] Figure 2 Flow chart of an online portrait generation method based on node-based artificial intelligence according to the present invention;
[0072] Figure 3 Flow chart for determining whether online portrait information is qualified and re-determining according to the present invention;
[0073] Figure 4 Flow chart of the corresponding correction method during re-determination according to the present invention;
[0074] Figure 5 Flow chart for determining the reasons for disqualification according to the present invention. Detailed implementation manners
[0075] In order to make the objectives and advantages of the present invention more clear and understandable, the present invention will be further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0076] The preferred implementation manners of the present invention will be described below with reference to the accompanying drawings. Those skilled in the art should understand that these implementation manners are only used to explain the technical principles of the present invention and do not limit the protection scope of the present invention.
[0077] It should be noted that in the description of the present invention, the terms indicating directions or positional relationships such as "upper", "lower", "left", "right", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings. This is only for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.
[0078] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installation", "connection", and "connection" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0079] Please refer to Figure 1As shown in the figure, it is a schematic diagram of the modules of an online portrait generation system based on node-based artificial intelligence according to an embodiment of the present invention. The system includes the following modules: a requirement customization module, a scene generation module, a superimposition module, a cropping module, a merging module, a preprocessing module, an identification module, an analysis module, an instruction generation module, and an output module. Among them, the requirement customization module is used to receive the online portrait generation requirements; the scene generation module is connected to the requirement customization module and is used to generate background image information and portrait pose information; the superimposition module is connected to the scene generation module and is used to merge the background image information and the portrait pose information to obtain target image information; the cropping module is used to obtain the original image information and crop the facial image information in the original image information; the merging module is connected to both the cropping module and the superimposition module and is used to merge the cropped facial image information into the target image information to obtain merged portrait information; the preprocessing module is connected to the generation module and is used to perform parameter preprocessing on the facial image information in the merged portrait information to obtain online portrait information; the identification module is connected to the preprocessing module and is used to determine the degree of fit between the facial image information and the target image information based on the obtained edge contour features, where the edge contour features are the edge contours of the facial image information that can be recognized in the online portrait information; the analysis module is connected to the identification module and is used to determine whether the generated online portrait information is qualified based on the degree of fit, and, when it is determined that the generated online portrait information is unqualified, determine the unqualified reason based on the degree of fit. The analysis module is also used to generate corresponding correction methods based on the determined reasons; the instruction generation module is connected to the analysis module and is used to generate corresponding instructions according to the determined correction methods, and, according to the corresponding instructions, re-determine the corresponding parameters in the process of generating the online portrait information, re-generate the online portrait information based on the determined parameters, and send a qualified instruction when it is re-determined that the generated online portrait information is qualified; the output module is connected to the instruction generation module and is used to output the online portrait information when the analysis module determines that the generated online portrait information is qualified.
[0080] Please refer to Figure 2 As shown in the figure, it is a flowchart of an online portrait generation method based on node-based artificial intelligence according to an embodiment of the present invention. The online portrait generation method includes the following steps:
[0081] S1: Control the data training model based on the obtained generation requirements to generate background image information and portrait pose information;
[0082] S2: Perform a merging process on the background image information and the portrait pose information to obtain target image information;
[0083] S3: Obtain the original image information and crop the facial image information from the original image information, and merge the cropped facial image information into the target image information to obtain the merged portrait information;
[0084] S4: Perform parameter unification processing on the merged portrait information to obtain the online portrait information, where the parameter unification processing includes resolution unification, light direction unification, and chromaticity unification;
[0085] S5: Extract features from the online portrait information to obtain the edge contour features of the preprocessed facial image information, and determine the degree of fit between the preprocessed facial image information and the target image information based on the edge contour features;
[0086] S6: Determine whether the online portrait information is qualified based on the degree of fit, and determine the unqualified reason based on the degree of fit when it is determined that the online portrait information is unqualified;
[0087] S7: After determining the unqualified reason, generate a corresponding correction method based on the determined reason;
[0088] S8: Generate a corresponding instruction based on the determined correction method, and re-determine the corresponding parameters in the process of generating the online portrait information according to the corresponding instruction;
[0089] S9: Regenerate the online portrait information based on the determined parameters, and issue a qualified instruction when it is re-determined that the generated online portrait information is qualified, and output the qualified online portrait information.
[0090] Specifically, when it is determined that the generated online portrait information is unqualified, analyze and find the unqualified reason, generate a corresponding correction method based on the determined reason, then generate an instruction for the corresponding correction method, and re-adjust the parameter unification processing in the process of generating the online portrait information according to the corresponding instruction, so as to effectively adjust the degree of fit of the facial image information in the target image information, so that the generated online portrait information can meet the customer's needs and ensure the quality of the output online portrait.
[0091] Specifically, in this embodiment, the present invention constructs a complete portrait generation workflow based on ComfyUI. The background image information and portrait pose information are generated through the application of a large model, and the ControlNet control technology is used to adjust the structure and pose of the portrait in image generation to ensure that the output meets the user's personalized customization requirements, such as specific gestures and specific backgrounds. How to merge the background image information and the portrait pose information to obtain the target image information; the original image information is cropped through realistic face swapping technology to obtain the facial image information, and the facial image information is merged into the target image information through style transfer technology to obtain the merged portrait information; then, through the LoRA loader, the facial image information and the target image information in the merged portrait information are processed for parameter unification to obtain the online portrait information, and the clarity and details of the generated online portrait information are improved through image enhancement and restoration technology. The processed online portrait information is judged whether it is qualified. If it is qualified, it is directly output. If it is unqualified, the LoRA loader is used to readjust the parameters to generate a new online portrait and rejudge until the qualified online portrait information is output. The above-mentioned technologies are all existing technologies and will not be elaborated here.
[0092] In other embodiments, parameter preprocessing can also be performed on the merged portrait information through Prefix-Tuning; signal processing can also be performed on the clarity and details of the generated online portrait information through adaptive filtering algorithm technology.
[0093] Further, the process of parameter unification processing for the merged portrait information includes:
[0094] After obtaining the merged portrait information, determine the resolution scaling ratio of the facial image information to complete the resolution unification processing of the facial image information and the target image information;
[0095] Based on the target image information, correct the light direction for the facial image information, and perform shadow compensation on the facial image information according to the determined light direction to complete the light direction unification of the facial image information and the target image information;
[0096] Obtain the facial feature points of the facial image information, and determine the deformation magnification of each facial feature point respectively to complete the fine-tuning of the facial image information. Among them, the deformation magnification is the magnification when the edge contour at the corresponding position of the facial image information is deformed when merged into the target image information;
[0097] Collect a preset number of pixel points from the facial image information respectively, and determine the chromaticity of the target image information based on the collected pixel points to complete the chromaticity unification processing of the facial image information and the target image information, and generate online portrait information after the unification processing is completed.
[0098] Please refer to Figure 3 shown in the figure, which is a flowchart for determining whether the online portrait information is qualified and re-determining in the method described in the embodiment of the present invention. The process of determining whether the online portrait information generated based on the degree of fit is qualified includes:
[0099] Identify and obtain the edge contour features of the facial image information in the online portrait information, where the edge contour features are the edge contours of the facial image information that can be recognized in the online portrait information;
[0100] Calculate the ratio of the length of the edge contour features to the total length of the edge contours of the facial image information, and record the obtained ratio as the degree of fit;
[0101] Compare the degree of fit with the pre-stored first preset degree of fit and the second preset degree of fit, and determine whether the generated online portrait information is qualified based on the comparison result, and determine whether the generated online portrait information is qualified based on the number of the obtained edge contour features according to the determination result, or determine the unqualified reason based on the degree of fit difference, where the degree of fit difference is the difference between the degree of fit and the second preset degree of fit.
[0102] Specifically, in this embodiment, the first preset degree of fit is assigned a value of 3%, and the second preset degree of fit is assigned a value of 5%. When the degree of fit is less than or equal to the first preset degree of fit, it is determined that the generated online portrait information is qualified, and a qualified instruction is issued;
[0103] When the degree of fit is greater than the first preset degree of fit and less than or equal to the second preset degree of fit, it is determined whether the generated online portrait information is qualified based on the number of the obtained edge contour features;
[0104] When the degree of fit is greater than the second preset degree of fit, it is determined that the generated online portrait information is unqualified.
[0105] In other embodiments, the first preset degree of fit and the second preset degree of fit are assigned values according to customer requirements, and are not limited here.
[0106] Further, the process of determining whether the online portrait information is qualified based on the number of edge contour features in the embodiment of the present invention includes:
[0107] Count the number of the obtained edge contour features and compare the number with the preset feature number;
[0108] Based on the comparison result, determine the reason for the unqualified online portrait information according to the fitness difference, or determine the correction method of the corresponding parameters during the fine-tuning process for the facial image information based on the feature quantity difference, where the feature quantity difference is the difference between the quantity of the edge contour features and the preset feature quantity.
[0109] Specifically, in this embodiment, the preset feature quantity is set to 7. When the quantity of the edge contour features is less than or equal to the preset feature quantity, it is determined that the online portrait information is unqualified;
[0110] When the quantity of the edge contour features is greater than the preset feature quantity, it is determined that the fine-tuning for the facial image information does not meet the standard.
[0111] In other embodiments, the preset feature quantity is assigned according to customer requirements and will not be limited here.
[0112] Please refer to Figure 4 as shown, which is the flowchart of the corresponding correction method during the re-determination of the method described in the embodiment of the present invention. The method for determining the correction method of the facial image information based on the feature quantity difference includes:
[0113] Re-determine the deformation magnification according to the obtained feature quantity difference;
[0114] Compare the feature quantity difference with the preset quantity difference, and based on the comparison result, use the deformation magnification adjustment coefficient to correct the deformation magnification to the corresponding value, where the feature quantity difference is proportional to the reduction amplitude of the deformation magnification;
[0115] Specifically, the larger the feature quantity difference, the greater the reduction amplitude of the corresponding deformation magnification. In this embodiment, the preset quantity difference is set to the first preset quantity difference and the second preset quantity difference. The first preset quantity difference is assigned as 2, and the second preset quantity difference is assigned as 4. If the feature quantity difference is less than or equal to the first preset quantity difference, each deformation magnification is corrected to 0.8 times the initial value;
[0116] If the feature quantity difference is greater than the first preset quantity difference and less than or equal to the second preset quantity difference, each deformation magnification is corrected to 0.5 times the initial value;
[0117] If the feature quantity difference is greater than the second preset quantity difference, each deformation magnification is corrected to 0.2 times the initial value;
[0118] Adjust the feature quantity difference between the facial image information and the target image information in the online portrait information by correcting the deformation magnification, so as to solve the problems generated during the fine-tuning process of the facial image information.
[0119] In other embodiments, the first preset quantity difference and the second preset quantity difference can also be adjusted to other values according to the input image information, and specific limitations are not provided herein. Similarly, the adjustment coefficients for each deformation magnification can also be adjusted according to user requirements.
[0120] Please refer to Figure 5 as shown, which is a flowchart of the reasons for the unqualified determination of the method described in the embodiments of the present invention. The process of determining the reasons for the unqualified online portrait information generated based on the fit difference includes:
[0121] Compare the obtained fit difference with the preset fit difference;
[0122] And determine the reasons for the unqualified online portrait information according to the comparison result, including that the process of unifying the light direction does not meet the standard, the process of unifying the chromaticity does not meet the standard, and the process of unifying the resolution does not meet the standard;
[0123] Determine the corresponding processing method based on the determined reasons, including:
[0124] When it is determined that the reason is that the process of unifying the light direction does not meet the standard, correct the vertical illumination distance to the corresponding value based on the physical contour and shadow contour in the online portrait information, where the vertical illumination distance is the distance between the facial image information and the light source in the depth of field direction in the target image information;
[0125] When it is determined that the reason is that the process of unifying the chromaticity does not meet the standard, correct the pixel acquisition quantity to the corresponding value based on the chromaticity difference in the online portrait information, where the chromaticity difference is the difference between the chromaticity of the target image information and the chromaticity of the facial image information, and the pixel acquisition quantity is the quantity of pixels collected from the facial image information when obtaining the online portrait information;
[0126] When it is determined that the reason is that the process of unifying the resolution does not meet the standard, correct the average spacing of pixel acquisition points to the corresponding value based on the resolution difference of the online portrait information, where the resolution difference is the difference between the resolution of the target image information and the resolution of the facial image information, and the average spacing of pixel acquisition points is the average value of the distances between several pixels collected on the facial image information.
[0127] Specifically, in this embodiment, the preset fit difference is set to the first preset fit difference and the second preset fit difference. The first preset fit difference is assigned a value of 2%, and the second preset fit difference is assigned a value of 4%. When the fit difference is less than or equal to the first preset fit difference, it is determined that the reason for the unqualified online portrait information generated is that the process of unifying the light direction for the facial image information does not meet the standard;
[0128] When the difference in fitness is greater than the first preset fitness difference and less than or equal to the second preset fitness difference, it is determined that the reason for the unqualified generated online portrait information is that the chromaticity unification process for the facial image information does not meet the standard;
[0129] When the difference in fitness is greater than the second preset fitness difference, it is determined that the reason for the unqualified online portrait information is that the resolution unification process for the facial image information does not meet the standard.
[0130] In other embodiments, the first preset fitness difference and the second preset fitness difference can also be set to other values according to customer requirements, and specific limitations are not provided here.
[0131] Further, the process of re-determining the vertical illumination distance in the process of unifying the light direction includes:
[0132] Re-obtain the online portrait information, and capture the shadow contour information and the physical contour information from the online portrait information;
[0133] Re-obtain the online portrait information, and capture the shadow contour information and the physical contour information from the online portrait information;
[0134] Perform pairing processing on the shadow contour information and the physical contour information to generate a number of light and shadow contour groups, and perform feature point matching for a single light and shadow contour group. Among them, a single feature point at the corresponding position within the physical contour information in the same light and shadow contour group and a single feature point representing the same position within the shadow contour information are recorded as the feature point group belonging to the light and shadow contour group;
[0135] Connect the lines of each feature point group, obtain the angles between each connection line and the horizontal line, and correct the vertical illumination distance according to the variance of each angle;
[0136] Compare the variance with the preset variance, and based on the comparison result, use the vertical illumination distance adjustment coefficient to correct the vertical illumination distance to the corresponding value, where the variance is proportional to the reduction amplitude of the vertical illumination distance.
[0137] Specifically, the greater the variance, the greater the reduction amplitude of the vertical illumination distance. In this embodiment, the preset variance is set to the first preset variance and the second preset variance. The first preset variance is assigned 30°, and the second preset variance is assigned 60°. If the variance is less than or equal to the first preset variance, each vertical illumination distance is corrected to 0.8 times the initial value;
[0138] If the variance is greater than the first preset variance and less than or equal to the second preset variance, each vertical illumination distance is corrected to 0.5 times the initial value;
[0139] If the variance is greater than the second preset variance, each vertical illumination distance is corrected to 0.2 times the initial value;
[0140] Adjust the process of unifying the light direction of the facial image information in the online portrait information in the target image information by correcting the vertical illumination distance, so that the adjusted online portrait information meets the output conditions.
[0141] In other embodiments, the first preset variance and the second preset variance can also be adjusted to other values according to the input image information, and no specific limitation is provided here. Similarly, the adjustment coefficients for each vertical illumination distance can also be adjusted according to user needs.
[0142] Furthermore, the process of re-determining the number of pixel acquisitions in the chromaticity unification process includes:
[0143] Re-acquire the online portrait information, obtain the chromaticity difference from the online portrait information, and correct the number of pixel acquisitions according to the chromaticity difference;
[0144] Compare the chromaticity difference with the preset chromaticity difference, and based on the comparison result, use the pixel acquisition number adjustment coefficient to correct the number of pixel acquisitions to the corresponding value, where the chromaticity difference is proportional to the increase amplitude of the number of pixel acquisitions.
[0145] Specifically, the greater the chromaticity difference, the greater the increase amplitude of the number of pixel acquisitions. In this embodiment, the preset chromaticity difference is set to the first preset chromaticity difference and the second preset chromaticity difference. The first preset chromaticity difference is assigned a value of 0.4, and the second preset chromaticity difference is assigned a value of 0.6. If the chromaticity difference is less than or equal to the first preset chromaticity difference, each number of pixel acquisitions is corrected to 1 times the initial value;
[0146] If the chromaticity difference is greater than the first preset chromaticity difference and less than or equal to the second preset chromaticity difference, each number of pixel acquisitions is corrected to 2 times the initial value;
[0147] If the chromaticity difference is greater than the second preset chromaticity difference, each number of pixel acquisitions is corrected to 3 times the initial value;
[0148] Adjust the chromaticity unification process between the facial image information in the online portrait information and the target image information by correcting the number of pixel acquisitions, so that the adjusted online portrait information meets the output conditions.
[0149] In other embodiments, the first preset chromaticity difference and the second preset chromaticity difference can also be adjusted to other values according to the input image information, and no specific limitation is provided here. Similarly, the adjustment coefficients for each number of pixel acquisitions can also be adjusted according to user needs.
[0150] Further, the process of re-determining the average spacing of pixel acquisition points in the resolution unification process includes:
[0151] After completing the correction of the number of pixel acquisitions, correct the average spacing of pixel acquisition points according to the resolution difference between the target image information and the facial image information;
[0152] Compare the resolution difference with a preset resolution difference, and based on the comparison result, use a pixel acquisition point average spacing adjustment coefficient to correct the average spacing of pixel acquisition points to a corresponding value, where the resolution difference is proportional to the increase amplitude of the average spacing of pixel acquisition points.
[0153] Specifically, the greater the resolution difference, the greater the increase amplitude of the average spacing of the corresponding pixel acquisition points. In this embodiment, the preset resolution difference is set as the first preset resolution difference and the second preset resolution difference. The first preset resolution difference is assigned a value of 1 million, and the second preset resolution difference is assigned a value of 6 million. If the resolution difference is less than or equal to the first preset resolution difference, then correct the average spacing of each pixel acquisition point to 1 times the initial value;
[0154] If the resolution difference is greater than the first preset resolution difference and less than or equal to the second preset resolution difference, then correct the average spacing of each pixel acquisition point to 2 times the initial value;
[0155] If the resolution difference is greater than the second preset resolution difference, then correct the average spacing of each pixel acquisition point to 3 times the initial value;
[0156] Adjust the resolution unification process between the facial image information and the target image information in the online portrait information by correcting the average spacing of pixel acquisition points, so that the adjusted online portrait information meets the output conditions.
[0157] In other embodiments, the first preset resolution difference and the second preset resolution difference can also be adjusted to other values according to the input image information, and no specific limitation is made here. Similarly, the adjustment coefficient for the average spacing of each pixel acquisition point can also be adjusted according to user needs.
[0158] So far, the technical solution of the present invention has been described in conjunction with the preferred embodiments shown in the drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the protection scope of the present invention.
[0159] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention; for those skilled in the art, the present invention may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An online portrait generation method based on node-based artificial intelligence, characterized in that, Including: Controlling a model to generate background image information and portrait pose information based on the obtained generation requirement control data; Performing a merging process on the background image information and the portrait pose information to obtain target image information; Obtaining original image information and cropping the facial image information in the original image information, and merging the cropped facial image information into the target image information to obtain merged portrait information; Performing parameter unification processing on the merged portrait information to obtain online portrait information, where the parameter unification processing includes resolution unification, light direction unification, and chromaticity unification; Performing feature extraction on the online portrait information to obtain the edge contour features of the preprocessed facial image information, and determining the degree of fit between the preprocessed facial image information and the target image information based on the edge contour features; Determining whether the online portrait information is qualified based on the degree of fit, and determining the reason for non - qualification based on the degree of fit when it is determined that the online portrait information is unqualified; After determining the reason for non - qualification, generating a corresponding correction method based on the determined reason; Generating a corresponding instruction based on the determined correction method, and re - determining the corresponding parameters in the process of generating the online portrait information according to the corresponding instruction; Regenerating the online portrait information based on the determined parameters, and issuing a qualified instruction when it is re - determined that the generated online portrait information is qualified, and outputting the qualified online portrait information.
2. The online portrait generation method based on node-based artificial intelligence according to claim 1, wherein The process of parameter unification processing for the merged portrait information includes: After obtaining the merged portrait information, determining the resolution scaling factor of the facial image information to complete the resolution unification processing of the facial image information and the target image information; Correcting the light direction for the facial image information based on the target image information, and performing shadow compensation on the facial image information according to the determined light direction to complete the light direction unification of the facial image information and the target image information; Obtaining the facial feature characteristics of the facial image information, and respectively determining the deformation magnification of each facial feature to complete the fine - tuning of the facial image information, where the deformation magnification is the magnification when the edge contour at the corresponding position of the facial image information is deformed when merged into the target image information; Respectively collecting a preset number of pixel points from the facial image information, determining the chromaticity of the target image information based on the collected pixel points to complete the chromaticity unification processing of the facial image information and the target image information, and generating online portrait information after the unification processing is completed.
3. The online portrait generation method based on node-based artificial intelligence according to claim 2, characterized in that, The process of determining whether the generated online portrait information is qualified based on the degree of fit includes: Identifying and obtaining the edge contour features of the facial image information in the online portrait information, where the edge contour features are the edge contours of the facial image information that can be recognized in the online portrait information; Calculating the ratio of the length of the edge contour features to the total length of the edge contour of the facial image information, and recording the obtained ratio as the degree of fit; Compare the obtained fitness with the pre-stored first preset fitness and second preset fitness, and determine whether the generated online portrait information is qualified based on the comparison result. Also, determine whether the generated online portrait information is qualified based on the number of the obtained edge contour features according to the determination result, or determine the reason for non-conformity based on the fitness difference, where the fitness difference is the difference between the fitness and the second preset fitness.
4. The online portrait generation method based on node-based artificial intelligence according to claim 3, wherein The process of determining whether the online portrait information is qualified based on the number of the edge contour features includes: Count the number of the obtained edge contour features and compare this number with the preset feature number; Based on the comparison result, determine the reason for the non-conformity of the online portrait information based on the fitness difference, or determine the correction method for the corresponding parameters during the fine-tuning process of the facial image information based on the feature number difference, where the feature number difference is the difference between the number of the edge contour features and the preset feature number.
5. The online portrait generation method based on node-based artificial intelligence according to claim 4, wherein Determining the correction method for the facial image information based on the feature number difference includes: Re-determine the deformation magnification according to the obtained feature number difference; Compare the feature number difference with the preset number difference, and based on the comparison result, use the deformation magnification adjustment coefficient to correct the deformation magnification to the corresponding value, where the feature number difference is proportional to the reduction amplitude of the deformation magnification.
6. The online portrait generation method based on node-based artificial intelligence according to claim 3, characterized in that The process of determining the reason for the non-conformity of the generated online portrait information based on the fitness difference includes: Compare the obtained fitness difference with the preset fitness difference; And determine the reason for the non-conformity of the online portrait information according to the comparison result, including that the light direction unification process does not meet the standard, the chromaticity unification process does not meet the standard, and the resolution unification process does not meet the standard; Determine the corresponding processing method based on the determined reason, including: When it is determined that the reason is that the light direction unification process does not meet the standard, correct the vertical illumination distance to the corresponding value based on the physical contour and shadow contour in the online portrait information, where the vertical illumination distance is the distance between the facial image information and the light source in the depth of field direction in the target image information; When it is determined that the reason is that the chromaticity unification process does not meet the standard, correct the pixel acquisition quantity to the corresponding value based on the chromaticity difference in the online portrait information, where the chromaticity difference is the difference between the chromaticity of the target image information and the chromaticity of the facial image information, and the pixel acquisition quantity is the number of pixels collected from the facial image information when obtaining the online portrait information; When it is determined that the reason is that the resolution unification process does not meet the standard, correct the average pixel acquisition point spacing to the corresponding value based on the resolution difference of the online portrait information, where the resolution difference is the difference between the resolution of the target image information and the resolution of the facial image information, and the average pixel acquisition point spacing is the average distance between several pixels collected on the facial image information.
7. The online portrait generation method based on node-based artificial intelligence according to claim 6, characterized in that The process of re-determining the vertical illumination distance in the light direction unification process includes: Re-obtain the online portrait information, and capture shadow contour information and physical object contour information from the online portrait information; Perform pairing processing on the shadow contour information and the physical object contour information to generate a number of light and shadow contour groups, and perform feature point matching for a single light and shadow contour group. Among them, a single feature point at the corresponding position within the physical object contour information in the same light and shadow contour group and a single feature point representing the same position within the shadow contour information are recorded as the feature point group belonging to the light and shadow contour group; Perform connection processing on each feature point group, obtain the angle between each connection and the horizontal line, and correct the vertical illumination distance according to the variance of each angle; Compare the variance with a preset variance, and based on the comparison result, use a vertical illumination distance adjustment coefficient to correct the vertical illumination distance to a corresponding value, where the variance is proportional to the reduction amplitude of the vertical illumination distance.
8. The online portrait generation method based on node-based artificial intelligence according to claim 6, characterized in that, The process of re-determining the pixel acquisition quantity in the chromaticity unification process includes: Re-obtain the online portrait information, obtain the chromaticity difference from the online portrait information, and correct the pixel acquisition quantity according to the chromaticity difference; Compare the chromaticity difference with a preset chromaticity difference, and based on the comparison result, use a pixel acquisition quantity adjustment coefficient to correct the pixel acquisition quantity to a corresponding value, where the chromaticity difference is proportional to the increase amplitude of the pixel acquisition quantity.
9. The online portrait generation method based on node-based artificial intelligence according to claim 8, characterized in that The process of re-determining the average spacing of pixel acquisition points in the resolution unification process includes: After completing the correction of the pixel acquisition quantity, correct the average spacing of pixel acquisition points according to the resolution difference between the target image information and the facial image information; Compare the resolution difference with a preset resolution difference, and based on the comparison result, use a pixel acquisition point average spacing adjustment coefficient to correct the average spacing of pixel acquisition points to a corresponding value, where the resolution difference is proportional to the increase amplitude of the average spacing of pixel acquisition points.
10. An online portrait generation system based on node-based artificial intelligence, characterized in that, Applied to the online portrait generation method based on node-based artificial intelligence according to any one of claims 1-9, including: A requirement customization module for receiving online portrait generation requirements; A scene generation module connected to the requirement customization module for generating background image information and portrait pose information; An overlay module connected to the scene generation module for performing merging processing on the background image information and the portrait pose information to obtain target image information; A cropping module for obtaining original image information and cropping the facial image information in the original image information; A merging module connected to both the cropping module and the overlay module for merging the cropped facial image information into the target image information to obtain merged portrait information; A preprocessing module connected to the generation module for performing parameter preprocessing on the facial image information in the merged portrait information to obtain online portrait information; An identification module, which is connected to the preprocessing module and is used to determine the degree of fit between the facial image information and the target image information based on the obtained edge contour features, where the edge contour features are the edge contours of the facial image information that can be recognized in the online portrait information; An analysis module, which is connected to the identification module and is used to determine whether the generated online portrait information is qualified based on the degree of fit, and, when it is determined that the generated online portrait information is unqualified, determine the unqualified reason based on the degree of fit. The analysis module is also used to generate corresponding correction methods based on the determined reasons; An instruction generation module, which is connected to the analysis module and is used to generate corresponding instructions according to the determined correction methods, and, re-determine the corresponding parameters in the process of generating the online portrait information according to the corresponding instructions; An output module, which is connected to the instruction generation module and is used to output the online portrait information when the analysis module determines that the generated online portrait information is qualified.
Citation Information
Patent Citations
Face fusion model training method and device and electronic equipment
CN111598818A
Face pose migration method and device based on video driving
CN113808005A