Image generation method and device, model training method and device, equipment and storage medium

By generating and rotating a three-dimensional grid to generate high-quality side face images, the problems of low detection accuracy of side face images and high cost of manual labeling are solved, and the efficiency and accuracy of large-angle image generation and detection are improved.

CN119251432APending Publication Date: 2025-01-03BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411304298.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The prior art has low accuracy and high manual labeling cost and low efficiency in side face image key point detection, making it difficult to provide a large number of large-angle images efficiently and quickly.

Method used

By generating the initial three-dimensional grid, rotating and projecting, the target image is obtained, reducing labor and time costs, improving the efficiency of large-angle image generation, and providing high-quality training samples for the detection model.

Benefits of technology

It realizes high-quality side face image generation and key point detection, reduces manual labeling costs, and improves key point detection accuracy of large-angle images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251432A_ABST
    Figure CN119251432A_ABST
Patent Text Reader

Abstract

The invention provides an image generation method, relates to the technical field of artificial intelligence, in particular to the technical fields of computer vision, deep learning, large models and the like, and can be applied to scenes of AIGC, digital humans, intelligent e-commerce and the like. According to the specific implementation scheme, at least one initial three-dimensional grid is generated according to an initial image; obtaining a first projection image area corresponding to the target area according to a plurality of first initial points of the first initial three-dimensional grid; determining a plurality of first pixel values corresponding to a plurality of first initial points of the first initial three-dimensional grid according to respective pixel values of a plurality of pixels in a target area corresponding to a plurality of projection points of the first projection image area; rotating the at least one initial three-dimensional grid to obtain at least one target three-dimensional grid; and obtaining a target image according to the at least one target three-dimensional grid and the plurality of first pixel values corresponding to the plurality of first initial points. The invention further provides a model training method and device, electronic equipment and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to computer vision, deep learning, large models and other technical fields, and can be applied to scenarios such as artificial intelligence generates content (AIGC), digital humans, and smart e-commerce. More specifically, the present disclosure provides an image generation method, a detection model training method, an image detection method, a device, an electronic device, and a storage medium. Background Art

[0002] With the development of artificial intelligence technology, various processing can be performed on images using artificial intelligence technology. For example, artificial intelligence technology can be used to generate images. Image generation can include generating new images through at least one of a computer algorithm and an artificial intelligence model. The new image can be a fictitious image with a specified artistic style, or it can be modified or enhanced based on the original image. Summary of the invention

[0003] The present disclosure provides an image generation method, apparatus, device and storage medium.

[0004] According to one aspect of the present disclosure, an image generation method is provided, the method comprising: generating at least one initial three-dimensional grid according to an initial image, wherein the at least one initial three-dimensional grid comprises a first initial three-dimensional grid corresponding to a target area in the initial image; obtaining a first projection image area corresponding to the target area according to a plurality of first initial points of the first initial three-dimensional grid; determining a plurality of first pixel values ​​corresponding to a plurality of first initial points of the first initial three-dimensional grid according to respective pixel values ​​of a plurality of pixels in the target area corresponding to a plurality of projection points of the first projection image area; rotating the at least one initial three-dimensional grid to obtain at least one target three-dimensional grid, wherein the at least one target three-dimensional grid comprises a first target three-dimensional grid, a plurality of first target points of the first target three-dimensional grid corresponding to a plurality of first initial points; obtaining a target image according to the plurality of first pixel values ​​corresponding to the at least one target three-dimensional grid and the plurality of first initial points.

[0005] According to another aspect of the present disclosure, a method for training a detection model is provided, the method comprising: inputting a sample image into the detection model to obtain at least one sample key point of the sample image; training the detection model according to the at least one sample key point and the at least one key point label of the sample image, wherein the sample image is generated by the following operations: generating at least one initial three-dimensional grid according to the initial image, wherein the at least one initial three-dimensional grid includes a first initial three-dimensional grid corresponding to a target area in the initial image; obtaining a first projection image area corresponding to the target area according to a plurality of first initial points of the first initial three-dimensional grid; determining a plurality of first pixel values ​​corresponding to the plurality of first initial points of the first initial three-dimensional grid according to respective pixel values ​​of a plurality of pixels in the target area corresponding to the plurality of projection points of the first projection image area; rotating the at least one initial three-dimensional grid to obtain at least one target three-dimensional grid, wherein the at least one target three-dimensional grid includes a first target three-dimensional grid, and a plurality of first target points of the first target three-dimensional grid correspond to the plurality of first initial points; obtaining the sample image according to the plurality of first pixel values ​​corresponding to the at least one target three-dimensional grid and the plurality of first initial points.

[0006] According to one aspect of the present disclosure, an image detection method is provided, the method comprising: inputting an image to be detected into a detection model to obtain at least one key point of the image to be detected, wherein the detection model is trained using the detection model training method provided by the present disclosure.

[0007] According to another aspect of the present disclosure, an image generating device is provided, the device comprising: a generating module, for generating at least one initial three-dimensional grid according to an initial image, wherein the at least one initial three-dimensional grid comprises a first initial three-dimensional grid corresponding to a target area in the initial image; a first obtaining module, for obtaining a first projection image area corresponding to the target area according to a plurality of first initial points of the first initial three-dimensional grid; a first determining module, for determining a plurality of first pixel values ​​corresponding to a plurality of first initial points of the first initial three-dimensional grid according to respective pixel values ​​of a plurality of pixels in the target area corresponding to a plurality of projection points of the first projection image area; a rotating module, for rotating the at least one initial three-dimensional grid to obtain at least one target three-dimensional grid, wherein the at least one target three-dimensional grid comprises a first target three-dimensional grid, a plurality of first target points of the first target three-dimensional grid correspond to a plurality of first initial points; and a second obtaining module, for obtaining a target image according to the at least one target three-dimensional grid and a plurality of first pixel values ​​corresponding to the plurality of first initial points.

[0008] According to another aspect of the present disclosure, a detection model training device is provided, the device comprising: a fourth acquisition module, used to input a sample image into the detection model to obtain at least one sample key point of the sample image; a training module, used to train the detection model according to the at least one sample key point and the at least one key point label of the sample image, wherein the sample image is generated by the following operations: generating at least one initial three-dimensional grid according to the initial image, wherein the at least one initial three-dimensional grid includes a first initial three-dimensional grid corresponding to the target area in the initial image; obtaining a first projection image area corresponding to the target area according to a plurality of first initial points of the first initial three-dimensional grid; determining a plurality of first pixel values ​​corresponding to the plurality of first initial points of the first initial three-dimensional grid according to the respective pixel values ​​of a plurality of pixels in the target area corresponding to the plurality of projection points of the first projection image area; rotating the at least one initial three-dimensional grid to obtain at least one target three-dimensional grid, wherein the at least one target three-dimensional grid includes a first target three-dimensional grid, and a plurality of first target points of the first target three-dimensional grid correspond to the plurality of first initial points; obtaining the sample image according to the at least one target three-dimensional grid and the plurality of first pixel values ​​corresponding to the plurality of first initial points.

[0009] According to another aspect of the present disclosure, an image detection device is provided, which includes: a fifth acquisition module, used to input the image to be detected into a detection model to obtain at least one key point of the image to be detected, wherein the detection model is trained using the device provided by the present disclosure.

[0010] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method provided according to the present disclosure.

[0011] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method provided according to the present disclosure.

[0012] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method provided according to the present disclosure is implemented.

[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0015] Figure 1 is a schematic diagram of an exemplary system architecture to which an image generation method and apparatus can be applied according to an embodiment of the present disclosure;

[0016] Figure 2 is a flowchart of an image generating method according to an embodiment of the present disclosure;

[0017] Figure 3A is a schematic diagram of an initial image according to an embodiment of the present disclosure;

[0018] Figure 3B is a schematic diagram of a first projection image area according to an embodiment of the present disclosure;

[0019] Figure 3C is a schematic diagram of an image to be processed according to an embodiment of the present disclosure;

[0020] Figure 4 is a schematic diagram of a target image according to another embodiment of the present disclosure;

[0021] Figure 5 is a flow chart of a method for training a detection model according to an embodiment of the present disclosure;

[0022] Figure 6 is a flow chart of an image detection method according to an embodiment of the present disclosure;

[0023] Figure 7 is a block diagram of an image generating apparatus according to an embodiment of the present disclosure;

[0024] Figure 8 is a block diagram of a training device for a detection model according to an embodiment of the present disclosure;

[0025] Fig. 9 is a schematic diagram of an image detection method according to an embodiment of the present disclosure; and

[0026] Fig.10 It is a block diagram of an electronic device to which at least one of an image generation method, a detection model training method, and an image detection method can be applied according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0028] Artificial intelligence technology can be used to identify key points of objects in an image. In some embodiments, multiple key points of a facial image can be identified using artificial intelligence technology. Taking a facial image as an example, multiple two-dimensional key points of a facial image can be multiple semantically defined marker points on the facial image. Multiple two-dimensional key points of a facial image can include points at the positions of facial features such as facial contours, eyes, eyebrows, mouth, and nose. Accurately determining the two-dimensional key points of a face is a prerequisite for many facial applications. Facial applications can include a variety of special effects such as face stickers, face swapping, and expression-driven gameplay.

[0029] In some embodiments, the facial image may be a frontal image or a side face image. For a frontal image, multiple key points can be accurately detected. However, for images of scenes with large angles such as side face images, it is difficult to detect key points with high accuracy.

[0030] In order to improve the accuracy of key point detection in profile images, a large number of profile images can be taken. Key points on profile images can also be manually annotated as key point labels. Based on a large number of profile images taken and the corresponding key point labels, a deep learning model can be trained to improve the accuracy of key point detection. However, manual annotation is costly, time-consuming, and inefficient. Model training requires tens of thousands of images. Manually annotated profile images also require multiple manual proofreadings. The difference between the manually annotated key points and the actual points is also large, making it difficult to train the model efficiently.

[0031] Therefore, in order to accurately identify the key points of the side face image and provide a large number of wide-angle images efficiently and quickly, the present disclosure provides an image generation method, which will be described below.

[0032] Figure 1 is a schematic diagram of an exemplary system architecture to which the image generation method and apparatus can be applied according to an embodiment of the present disclosure. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0033] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0034] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptops, desktop computers, etc.

[0035] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0036] It should be noted that the image generation method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the image generation device provided in the embodiment of the present disclosure can generally be set in the server 105. The image generation method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the image generation device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.

[0037] Figure 2 is a flowchart of an image generating method according to an embodiment of the present disclosure.

[0038] like Figure 2 As shown, the method 200 may include operations S210 to S250.

[0039] In operation S210, at least one initial three-dimensional mesh is generated according to an initial image.

[0040] In the disclosed embodiment, the initial image may be the frontal face image mentioned above. It is understood that the initial image may be a frontal image of any object or an image of the object tilted at a small angle, such as a frontal image of clothing.

[0041] In the embodiment of the present disclosure, various three-dimensional parameterized models may be used to generate at least one initial three-dimensional mesh.

[0042] In the disclosed embodiment, at least one initial three-dimensional mesh includes a first initial three-dimensional mesh corresponding to a target area in the initial image. For example, the target area may be a face area of ​​a frontal face image. A three-dimensional mesh of the face area of ​​the frontal face image may be determined using a three-dimensional deformable model (3D Morphable Model, 3DMM) as the first initial three-dimensional mesh. For another example, the target area may also be a top area of ​​a clothing image.

[0043] In operation S220, a first projection image region corresponding to the target region is obtained according to a plurality of first initial points of the first initial three-dimensional grid.

[0044] In the embodiment of the present disclosure, the three-dimensional mesh may include a plurality of triangular facets. The vertices of the triangular facets of the first initial three-dimensional mesh may be used as the first initial points.

[0045] In the embodiment of the present disclosure, the contour of the first projection image area may be similar to or identical to the target area. The multiple projection points of the first projection image area may correspond to the multiple first initial points respectively. For example, the first projection image area may be several times or a fraction of the target area.

[0046] In operation S230, a plurality of first pixel values ​​corresponding to a plurality of first initial points of the first initial three-dimensional grid are determined according to respective pixel values ​​of a plurality of pixels in the target area corresponding to the plurality of projection points of the first projection image area.

[0047] In the embodiment of the present disclosure, the pixel values ​​of the plurality of projection points in the first projection image area are determined according to the positions of the plurality of projection points in the first projection image area and the positions of the plurality of pixels in the target area. The projection point may correspond to the first initial point. Thus, the first pixel value corresponding to the first initial point may be determined. For example, a coordinate system may be established according to the first projection image area and the target image area, and the plurality of pixel values ​​corresponding to the plurality of projection points may be determined according to the coordinates of the plurality of projection points in the first projection image area and the coordinates of the plurality of pixels in the target image area.

[0048] In operation S240, at least one initial three-dimensional mesh is rotated to obtain at least one target three-dimensional mesh.

[0049] In the embodiment of the present disclosure, the at least one target three-dimensional grid includes a first target three-dimensional grid. A plurality of first target points of the first target three-dimensional grid correspond to a plurality of first initial points.

[0050] In operation S250, a target image is obtained according to the at least one target three-dimensional grid and a plurality of first pixel values ​​corresponding to the plurality of first initial points.

[0051] In the disclosed embodiment, multiple vertices of the first target three-dimensional grid can be used as multiple first target points. The first target point can correspond to the first initial point. The first pixel value corresponding to the first initial point can be used as the pixel value corresponding to the first target point. According to the first target three-dimensional grid, a two-dimensional image can be determined. The pixel values ​​of multiple pixels in the two-dimensional image can be determined by the pixel values ​​corresponding to the multiple first target points. After determining the pixel values ​​of multiple pixels in the two-dimensional image, the target image can be obtained.

[0052] Through the embodiments of the present disclosure, a three-dimensional grid is generated based on the initial image, and the pixel values ​​corresponding to the vertices of the three-dimensional grid are determined. Therefore, after the three-dimensional grid is rotated and projected to obtain the target image, the pixel value of each pixel in the initial image can be converted to the target image. A target image with high similarity to the initial image but a changed object deflection angle can be obtained, which reduces the manpower cost and time cost of obtaining large-angle images. By rotating the grid at multiple different angles, a large number of large-angle images can be quickly obtained. It can be understood that a large-angle image can be an image in which the object in the image is deflected at a larger angle (such as a side face image).

[0053] Through the disclosed embodiments, the pixels in the target image have a corresponding relationship with the pixels in the initial image, and the key points in the target image can also have a corresponding relationship with the key points in the target image. Therefore, if the positions of the key points of the initial image are known and accurate, the generated target image can have accurate key point positions, providing high-quality training samples for the training of the detection model for detecting key points, which helps to improve the model training effect, and further helps to improve the key point detection accuracy of large-angle images.

[0054] It can be understood that the method of the present disclosure is described above, and the method of the present disclosure will be further described below in conjunction with the first initial three-dimensional grid.

[0055] Figure 3A is a schematic diagram of an initial image according to an embodiment of the present disclosure.

[0056] like Figure 3A As shown, the initial image i30 may be an image in which the face is deflected at a small angle.

[0057] In the embodiment of the present disclosure, the initial image i30 may include a plurality of initial key points. Figure 3A As shown, the initial image i30 may include an initial key point kp308. The initial key point kp308 may correspond to the most convex position of the chin. It can be understood that Figure 3A The initial keypoint kp308 dimensions shown are for example only.

[0058] In some embodiments, in some implementations of the above operation S210, at least one initial three-dimensional grid may be generated according to the initial image i30. The target area of ​​the initial image i30 may be a face area. The at least one initial three-dimensional grid may include a first initial three-dimensional grid. The first initial three-dimensional grid may correspond to the face area of ​​the initial image i30.

[0059] In some embodiments, in some implementations of the above operation S220, obtaining a first projection image region corresponding to the target region according to the plurality of first initial points of the first initial three-dimensional grid includes: projecting the plurality of first initial points onto the initial image to obtain the first projection image region. The first projection image region may overlap with the target region, and the plurality of projection points of the first projection image region correspond to the plurality of first initial points. Figure 3B Through the embodiments of the present disclosure, by projecting the mesh onto the original image, a mapping relationship between mesh vertices and pixels can be quickly established, and computing resource overhead can be reduced to improve image generation efficiency.

[0060] Figure 3B is a schematic diagram of a first projection image area according to an embodiment of the present disclosure.

[0061] like Figure 3B As shown, the first initial three-dimensional grid is projected onto the initial image i30 to obtain a first projection image area ir301. The first projection image area ir301 may overlap the face area of ​​the initial image i30. Multiple projection points of the first projection image area ir31 may correspond to multiple first initial points of the first initial three-dimensional grid.

[0062] In some embodiments, in some implementations of the above operation S230, determining multiple first pixel values ​​corresponding to multiple first initial points of the first initial three-dimensional grid according to the respective pixel values ​​of multiple pixels in the target area corresponding to the multiple projection points of the first projection image area includes: determining the respective pixel values ​​of multiple projection points of the first projection image area according to the respective pixel values ​​of multiple pixels in the target area.

[0063] In the embodiment of the present disclosure, the plurality of projection points of the first projection image area include at least one of the first projection point and the second projection point. The first projection point coincides with a pixel of the target area. The second projection point does not coincide with any pixel of the target area. For example, the plurality of projection points of the first projection image area ir301 may include the first projection point and the second projection point.

[0064] In the embodiment of the present disclosure, the pixel value of the pixel in the target area that coincides with the first projection point can be determined as the pixel value of the first projection point. For example, a first projection point coincides with a pixel in the target area. The pixel value of the pixel can be an RGB (red, green, and blue) value. The value of the red channel of the pixel can be 10, which can be used as the value of the red channel of the first projection point. The value of the green channel and the value of the blue channel of the pixel can be used as the value of the green channel and the value of the blue channel of the first projection point, respectively.

[0065] In the embodiment of the present disclosure, interpolation is performed according to the pixel values ​​of multiple pixels adjacent to the second projection point in the target area to obtain the pixel value of the second projection point. Multiple pixels whose distance from the second projection point is less than or equal to the preset distance threshold can be used as multiple pixels adjacent to the second projection point. Interpolation can be performed according to the distance between the second projection point and multiple adjacent pixels. For example, the initial image may include multiple rows of pixels. Each row of pixels includes multiple pixels. If a second projection point falls in the middle of two pixels in the same row, these two pixels can be used as two adjacent pixels of the second projection point. If the values ​​of the red channels of the two pixels are 10 and 11 respectively, the value of the red channel corresponding to the second projection point can be 10.5. Through the embodiment of the present disclosure, interpolation is performed according to the pixel values ​​of multiple adjacent pixels, the pixel corresponding to the first initial point can be determined, and a mapping relationship between a grid fixed point and a pixel value can be established, which is helpful for the subsequent generation of a more realistic image.

[0066] In some embodiments, based on the pixel values ​​of the plurality of projection points of the first projection image area, a plurality of first pixel values ​​corresponding to the plurality of first initial points may be determined. For example, the first initial point corresponds to the first projection point. If the value of the red channel of the first projection point is 10, the value of the red channel of the first pixel value corresponding to the corresponding first initial point may be 10.

[0067] In some embodiments, in some embodiments of the above operation S240, at least one initial three-dimensional mesh may be rotated to obtain at least one target three-dimensional mesh. The at least one target three-dimensional mesh may include a first target three-dimensional mesh. A plurality of first target points of the first target three-dimensional mesh may correspond to a plurality of first initial points. For example, the first initial three-dimensional mesh may be rotated according to a target angle (e.g., 85 degrees). During the rotation, the first initial point is also rotated by the target angle. The rotated first initial point may be used as the first target point.

[0068] In some embodiments, in some implementations of the above operation S250, obtaining the target image according to the multiple first pixel values ​​corresponding to the at least one target three-dimensional grid and the multiple first initial points may include: performing projection according to the first target three-dimensional grid to obtain the image to be processed. For example, multiple pixels in the initial image may be deleted as the area to be projected. The first target three-dimensional grid is projected onto the area to be projected to obtain the image to be processed. Figure 3C Provide explanation.

[0069] Figure 3C is a schematic diagram of an image to be processed according to an embodiment of the present disclosure.

[0070] In the embodiment of the present disclosure, the image to be processed may include a plurality of first pixels to be processed corresponding to a plurality of first target points. Figure 3C As shown, the image to be processed i31 includes a first image region to be processed ir311. The first image region to be processed ir311 may include a plurality of first pixels to be processed.

[0071] In some embodiments, the pixel values ​​of each of the plurality of first pixels to be processed can be determined based on the plurality of first pixel values ​​corresponding to the plurality of first initial points. The target image can be obtained based on the pixel values ​​of each of the plurality of first pixels to be processed. For example, as described above, the first target point can be obtained after the first initial point is rotated by a target angle. The first pixel value corresponding to the first initial point can be used as the first pixel value corresponding to the first target point. The first pixel to be processed corresponds to the first target point. The first pixel value corresponding to the first target point can be used as the pixel value of the corresponding first pixel to be processed. Thus, the target image can be obtained based on the pixel values ​​of each of the plurality of first pixels to be processed.

[0072] Through the disclosed embodiments, an image including an image area corresponding to a target area can be quickly generated. Compared with the object in the target area, the object in the first image area to be processed has a larger deflection angle, but has a higher similarity with the object in the target area. Thus, a large number of high-quality images with large and different object deflection angles can be quickly generated.

[0073] It can be understood that the method of the present disclosure is described above in conjunction with the first initial three-dimensional grid. However, the present disclosure is not limited thereto, and the at least one initial three-dimensional grid may also include a second initial three-dimensional grid, which will be described below.

[0074] In some embodiments, in other implementations of the above operation S210, generating at least one initial three-dimensional grid according to the initial image includes: generating a first initial three-dimensional grid according to the initial image. Generating a second initial three-dimensional grid according to the first initial three-dimensional grid and a preset rule. For example, taking the initial image as the above initial image i30 as an example, a first initial three-dimensional grid can be generated according to the initial image i30. The first initial three-dimensional grid can correspond to the face area of ​​the initial image i30. The preset rule can indicate: randomly generate a grid outside the outline of the first initial three-dimensional grid. Based on the first initial three-dimensional grid and the preset rule, a second initial three-dimensional grid can be generated. It can be understood that one or more annular grids can be generated based on the preset rule. The annular shape can be various annular shapes such as a square ring and a circular ring. Through the embodiment of the present disclosure, the second initial three-dimensional grid is generated based on the preset rule, and the grid generation can be completed quickly, the computing resource overhead is effectively reduced, and the efficiency of image generation is further improved.

[0075] In some embodiments, in some implementations of the above operation S220, the first initial three-dimensional grid is projected onto the initial image to obtain a first projection image area. The first projection image area may overlap with the face area of ​​the initial image. Multiple projection points of the first projection image area may correspond to multiple first initial points of the first initial three-dimensional grid. It can be understood that the above description of the first projection image area ir301 is also applicable to this embodiment.

[0076] In some embodiments, the method may further include: obtaining a second projection image area according to a plurality of second initial points of the second initial three-dimensional grid. For example, when the first initial three-dimensional grid is projected onto the initial image, the second initial three-dimensional grid may also be projected onto the initial image. It is understood that during the projection process, the projection may be performed with the constraint that the first projection image area coincides with the target area.

[0077] In some embodiments, in some implementations of the above operation S230, the pixel values ​​of the respective multiple projection points of the first projection image area are determined according to the pixel values ​​of the respective multiple pixels in the target area. The multiple projection points of the first projection image area include at least one of the first projection point and the second projection point. The first projection point coincides with a pixel of the target area. The second projection point does not coincide with any pixel of the target area. The pixel value of the pixel in the target area that coincides with the first projection point can be determined as the pixel value of the first projection point. According to the pixel values ​​of the multiple pixels adjacent to the second projection point in the target area, interpolation is performed to obtain the pixel value of the second projection point. According to the pixel values ​​of the respective multiple projection points of the first projection image area, multiple first pixel values ​​corresponding to the multiple first initial points can be determined. It can be understood that the above method of determining the pixel value of the first projection point in the first projection image area ir301 and the pixel value of the second projection point is also applicable to this embodiment, and the present disclosure will not be repeated here.

[0078] In some embodiments, the method may further include: determining a plurality of second pixel values ​​corresponding to a plurality of second initial points according to a plurality of pixel values ​​in an area outside the target area in the initial image. Determining a plurality of pixel values ​​of a plurality of projection points of the second projection image area according to the pixel values ​​of a plurality of pixels in the area outside the target area in the initial image. Determining a plurality of second pixel values ​​corresponding to a plurality of second initial points according to the pixel values ​​of a plurality of projection points of the second projection image area.

[0079] In the embodiment of the present disclosure, the plurality of projection points of the second projection image area may include at least one of a third projection point and a fourth projection point. The third projection point coincides with a pixel in an area outside the target area in the initial image. The fourth projection point does not coincide with any pixel in an area outside the target area in the initial image.

[0080] In the embodiment of the present disclosure, the pixel value of the pixel in the area outside the target area that coincides with the third projection point can be determined as the pixel value of the third projection point. For example, a third projection point coincides with a pixel outside the target area in the initial image. The pixel value of the pixel can be an RGB value. The value of the red channel of the pixel can be 20, which can be used as the value of the red channel of the third projection point. The value of the green channel and the value of the blue channel of the pixel can be used as the value of the green channel and the value of the blue channel of the third projection point, respectively.

[0081] In an embodiment of the present disclosure, interpolation is performed based on the pixel values ​​of multiple pixels adjacent to the fourth projection point in the area other than the target area in the initial image to obtain the pixel value of the fourth projection point. Multiple pixels whose distance from the fourth projection point is less than or equal to the preset distance threshold can be used as multiple pixels adjacent to the fourth projection point. Interpolation can be performed based on the distance between the fourth projection point and multiple adjacent pixels. For example, the initial image may include multiple rows of pixels. Each row of pixels includes multiple pixels. If a fourth projection point falls in the middle of two pixels in the same row (the fourth projection point is at the same distance from the two pixels), the two pixels can be used as two adjacent pixels of the fourth projection point. If the values ​​of the red channels of the two pixels are 20 and 22 respectively, the value of the red channel corresponding to the fourth projection point can be 21. It can be understood that the way to determine the value of the blue channel and the value of the green channel is the same or similar to the way to determine the value of the red channel, and the present disclosure will not repeat them here.

[0082] In the embodiment of the present disclosure, the second initial point corresponds to the second projection point. If the value of the red channel of the second projection point is 20, the value of the red channel of the second pixel value corresponding to the second initial point may be 20.

[0083] In some embodiments, in other implementations of the above operation S240, at least one initial three-dimensional mesh may be rotated to obtain at least one target three-dimensional mesh. The at least one target three-dimensional mesh may include a first target three-dimensional mesh and a second target three-dimensional mesh. Multiple first target points of the first target three-dimensional mesh may correspond to multiple first initial points. Multiple second target points of the second target three-dimensional mesh may correspond to multiple second initial points. For example, the first initial three-dimensional mesh and the second initial mesh may be rotated according to a target angle (e.g., 85 degrees). During the rotation, the first initial point and the second initial point are also rotated by the target angle. The rotated first initial point may be used as the first target point. The rotated second initial point may be used as the second target point.

[0084] In some embodiments, in other implementations of the above operation S250, obtaining a target image according to at least one target three-dimensional grid and multiple first pixel values ​​corresponding to multiple first initial points may include: performing projection according to the first target three-dimensional grid and the second target three-dimensional grid to obtain an image to be processed.

[0085] In the disclosed embodiment, a region to be projected of the same or similar size can be generated based on the initial image. For example, the size of the region to be projected can be consistent with the size of the initial image. The relative positional relationship between the initial image and at least one target three-dimensional grid can be the same as the relative positional relationship between the region to be projected and at least one target three-dimensional grid. For another example, as described above, multiple pixels in the initial image can be deleted as the region to be projected. At least one target three-dimensional grid is projected onto the region to be projected to obtain an image to be processed.

[0086] In the embodiment of the present disclosure, the image to be processed may include a plurality of first pixels to be processed corresponding to a plurality of first target points and a plurality of second pixels to be processed corresponding to a plurality of second target points. For example, the image to be processed may include a first image area to be processed and a second image area to be processed. The first image area to be processed may include a plurality of first pixels to be processed. The second image area to be processed may include a plurality of second pixels to be processed. It can be understood that the above description of the first image area to be processed ir311 is also applicable to the present embodiment, and the present disclosure will not repeat it here.

[0087] In some embodiments, the pixel values ​​of the first pixels to be processed can be determined according to the first pixel values ​​corresponding to the first initial points. The pixel values ​​of the second pixels to be processed can be determined according to the second pixel values ​​corresponding to the second initial points. The target image can be obtained according to the pixel values ​​of the first pixels to be processed and the pixel values ​​of the second pixels to be processed. Figure 4 Provide explanation.

[0088] Figure 4 is a schematic diagram of a target image according to another embodiment of the present disclosure.

[0089] In the disclosed embodiment, as described above, the first target point may be obtained after the first initial point is rotated by a target angle. The first pixel value corresponding to the first initial point may be used as the first pixel value corresponding to the first target point. The first pixel to be processed corresponds to the first target point. The first pixel value corresponding to the first target point may be used as the pixel value of the corresponding first pixel to be processed. The second target point may be obtained after the second initial point is rotated by a target angle. The second pixel value corresponding to the second initial point may be used as the second pixel value corresponding to the second target point. The second pixel to be processed corresponds to the second target point. The second pixel value corresponding to the second target point may be used as the pixel value of the corresponding second pixel to be processed.

[0090] Thus, according to the pixel values ​​of each of the plurality of first pixels to be processed and the pixel values ​​of each of the plurality of second pixels to be processed, the target image i42 can be obtained. It can be understood that in the process of projecting according to at least one target three-dimensional grid, since the target three-dimensional grid is obtained by rotating the initial three-dimensional grid, in the process of projecting to the area to be projected, one or more second target points may be projected outside the area to be projected. These points outside the area to be projected can be deleted. In addition, any first target point or any second target point is not projected to one or more sub-areas in the area to be projected. Preset pixels can be generated in these sub-areas. The pixel value of the preset pixel can be a preset value (for example, 0).

[0091] Through the embodiments of the present disclosure, the generated target image has a higher similarity in style to the initial image and is closer to the captured image, which can further improve the quality of the target image.

[0092] In some embodiments, the above method may further include: determining the position of at least one target key point in the target image based on the positions of multiple initial key points. For example, the initial key point may coincide with a pixel, and the pixel may correspond to a first initial point. The first initial point corresponds to a first target point. The pixel in the target image corresponding to the first target point may be used as the target key point. For another example, the initial key point may not coincide with the pixel in the initial image. However, the positional relationship between the initial key point and the adjacent pixels can be determined. Based on the positional relationship and the first target point corresponding to the adjacent pixels, the position of the target key point can be determined.

[0093] like Figure 3A and Figure 4 As shown, according to the position of the initial key point kp308, the position of the target key point kp428 can be determined.

[0094] It can be understood that the above describes the image generation method of the present invention, and the following describes the training method of the detection model of the present invention.

[0095] Figure 5 It is a schematic diagram of a method for training a detection model according to an embodiment of the present disclosure.

[0096] like Figure 5 As shown, method 500 may include operations S510 to S520.

[0097] In operation S510, a sample image is input into a detection model to obtain at least one sample key point of the sample image.

[0098] In the disclosed embodiment, the detection model may be constructed based on a deep learning model such as a convolutional neural network (CNN), a transformer model, etc. The sample key point may correspond to a semantic indication data. For example, the semantic indication data of the sample key point may indicate that the key point is the most convex point of the chin.

[0099] In operation S520, a detection model is trained based on at least one sample key point and at least one key point label of the sample image.

[0100] In the disclosed embodiment, the key point label may include label indication data and a key point position label. For example, the label indication data may also indicate that the key point is the most convex point of the chin. According to the key point position label corresponding to the label indication data and the position of the sample key point corresponding to the semantic indication data consistent with the label indication data, a loss may be determined. The parameters of the detection model are adjusted according to the loss to train the detection model.

[0101] In the embodiment of the present disclosure, the sample image is generated by the following operations: at least one initial three-dimensional grid is generated according to the initial image. The at least one initial three-dimensional grid includes a first initial three-dimensional grid corresponding to the target area in the initial image. According to the multiple first initial points of the first initial three-dimensional grid, a first projection image area corresponding to the target area is obtained. According to the pixel values ​​of the multiple pixels in the target area corresponding to the multiple projection points of the first projection image area, multiple first pixel values ​​corresponding to the multiple first initial points of the first initial three-dimensional grid are determined. At least one initial three-dimensional grid is rotated to obtain at least one target three-dimensional grid. At least one target three-dimensional grid includes a first target three-dimensional grid, and multiple first target points of the first target three-dimensional grid correspond to the multiple first initial points. According to the multiple first pixel values ​​corresponding to the at least one target three-dimensional grid and the multiple first initial points, a sample image is obtained. It can be understood that the method of generating the sample image is the same or similar to the method of generating the target image using the method 200 described above, and the present disclosure will not repeat it here. It can also be understood that the above-mentioned target image i42 can be used as a sample image.

[0102] In some embodiments, the target area includes multiple initial key points, and the position of at least one sample key point is determined based on the position of at least one of the multiple initial key points. It can be understood that the above method of determining the position of the target key point kp428 based on the position of the initial key point kp308 is also applicable to determining the position of the sample key point based on the position of the initial key point, and the present disclosure will not repeat it here.

[0103] It can be understood that the above describes the model training method of the present invention, and the following describes the detection method performed using the detection model.

[0104] Figure 6 is a schematic flow chart of an image detection method according to an embodiment of the present disclosure.

[0105] like Figure 6 As shown, method 600 may include operation S610.

[0106] In operation S610, the image to be detected is input into a detection model to obtain at least one key point of the image to be detected.

[0107] In the embodiment of the present disclosure, the object in the image to be detected may have a larger deflection angle, or may be a frontal image of the object.

[0108] In the embodiment of the present disclosure, the detection model may be trained using the above method 500 .

[0109] It can be understood that the method of the present disclosure is described above, and the device of the present disclosure will be described below.

[0110] Figure 7 is a block diagram of an image generating apparatus according to an embodiment of the present disclosure.

[0111] like Figure 7 As shown, the apparatus 700 may include a generating module 710 , a first obtaining module 720 , a first determining module 730 , a rotating module 740 and a second obtaining module 750 .

[0112] The generating module 710 is used to generate at least one initial three-dimensional grid according to the initial image.

[0113] In an embodiment of the present disclosure, the at least one initial three-dimensional grid includes a first initial three-dimensional grid corresponding to the target area in the initial image.

[0114] The first obtaining module 720 is configured to obtain a first projection image region corresponding to the target region according to a plurality of first initial points of the first initial three-dimensional grid.

[0115] The first determination module 730 is used to determine a plurality of first pixel values ​​corresponding to a plurality of first initial points of the first initial three-dimensional grid according to respective pixel values ​​of a plurality of pixels in the target area corresponding to a plurality of projection points of the first projection image area.

[0116] The rotation module 740 is used to rotate at least one initial three-dimensional grid to obtain at least one target three-dimensional grid.

[0117] In an embodiment of the present disclosure, the at least one target three-dimensional grid includes a first target three-dimensional grid, and a plurality of first target points of the first target three-dimensional grid correspond to a plurality of first initial points.

[0118] The second obtaining module 750 is used to obtain a target image according to at least one target three-dimensional grid and a plurality of first pixel values ​​corresponding to a plurality of first initial points.

[0119] In some embodiments, the first acquisition module includes: a first acquisition submodule, configured to project the plurality of first initial points onto the initial image to obtain a first projection image region. The first projection image region coincides with the target region, and the plurality of projection points of the first projection image region correspond to the plurality of first initial points.

[0120] In some embodiments, the first determination module includes: a first determination submodule, used to determine the pixel values ​​of the plurality of projection points of the first projection image area according to the pixel values ​​of the plurality of pixels in the target area; and a second determination submodule, used to determine the plurality of first pixel values ​​corresponding to the plurality of first initial points according to the pixel values ​​of the plurality of projection points in the first projection image area.

[0121] In some embodiments, the multiple projection points of the first projection image area include at least one of a first projection point and a second projection point, the first projection point coincides with a pixel of the target area, and the second projection point does not coincide with any pixel of the target area. The first determination submodule includes at least one of the following: a first determination unit, used to determine the pixel value of the pixel in the target area that coincides with the first projection point as the pixel value of the first projection point. A first interpolation unit, used to interpolate according to the pixel values ​​of multiple pixels adjacent to the second projection point in the target area to obtain the pixel value of the second projection point.

[0122] In some embodiments, the first target three-dimensional grid includes a plurality of first target points corresponding to the plurality of first initial points. The second acquisition module includes: a first projection submodule, used to perform projection according to the first target three-dimensional grid to obtain an image to be processed. The image to be processed includes a plurality of first pixels to be processed corresponding to the plurality of first target points. A second determination submodule, used to determine the pixel values ​​of the plurality of first pixels to be processed according to the plurality of first pixel values ​​corresponding to the plurality of first initial points. The second acquisition submodule, used to obtain a target image according to the pixel values ​​of the plurality of first pixels to be processed.

[0123] In some embodiments, the target area includes a plurality of initial key points, and the target image includes at least one target key point corresponding to at least one initial key point. The device further includes: a second determination module, configured to determine the position of at least one target key point in the target image according to the positions of the plurality of initial key points.

[0124] In some embodiments, the at least one initial three-dimensional grid further includes a second initial three-dimensional grid. The generation module includes: a first generation submodule for generating the first initial three-dimensional grid according to the initial image; and a second generation submodule for generating the second initial three-dimensional grid according to the first initial three-dimensional grid and a preset rule.

[0125] In some embodiments, the method further includes: a third obtaining module for obtaining a second projection image area according to a plurality of second initial points of the second initial three-dimensional grid; and a third determining module for determining a plurality of second pixel values ​​corresponding to the plurality of second initial points according to a plurality of pixel values ​​in an area outside the target area in the initial image.

[0126] In some embodiments, the third determination module includes: a third determination submodule, used to determine the pixel values ​​of the plurality of projection points of the second projection image area according to the pixel values ​​of the plurality of pixels in the area outside the target area in the initial image; and a fourth determination submodule, used to determine the plurality of second pixel values ​​corresponding to the plurality of second initial points according to the pixel values ​​of the plurality of projection points of the second projection image area.

[0127] In some embodiments, the multiple projection points of the second projection image area may include at least one of a third projection point and a fourth projection point, the third projection point coincides with a pixel in an area outside the target area in the initial image, and the fourth projection point does not coincide with any pixel in an area outside the target area in the initial image. The third determination submodule includes at least one of the following: a second determination unit, used to determine the pixel value of the pixel in the area outside the target area that coincides with the third projection point as the pixel value of the third projection point. A second interpolation unit, used to interpolate the pixel values ​​of multiple pixels adjacent to the fourth projection point in the area outside the target area in the initial image to obtain the pixel value of the fourth projection point.

[0128] In some embodiments, at least one target three-dimensional grid includes a second target three-dimensional grid, and the second target three-dimensional grid includes multiple second target points corresponding to multiple second initial points. The second acquisition module includes: a second projection submodule, which is used to project according to the first target three-dimensional grid and the second target three-dimensional grid to obtain an image to be processed. The image to be processed includes multiple first pixels to be processed corresponding to multiple first target points and multiple second pixels to be processed corresponding to multiple second target points. A fifth determination submodule is used to determine the pixel values ​​of each of the multiple first pixels to be processed according to the multiple first pixel values ​​corresponding to the multiple first initial points. A sixth determination submodule is used to determine the pixel values ​​of each of the multiple second pixels to be processed according to the multiple second pixel values ​​corresponding to the multiple second initial points. A third acquisition submodule is used to obtain a target image according to the pixel values ​​of each of the multiple first pixels to be processed and the pixel values ​​of each of the multiple second pixels to be processed.

[0129] Figure 8 is a schematic diagram of a training device for a detection model according to an embodiment of the present disclosure.

[0130] like Figure 8 As shown, the apparatus 800 may include a fourth obtaining module 810 and a training module 820 .

[0131] The fourth obtaining module 810 is used to input the sample image into the detection model to obtain at least one sample key point of the sample image.

[0132] The training module 820 is used to train the detection model according to at least one sample key point and at least one key point label of the sample image.

[0133] In an embodiment of the present disclosure, a sample image is generated by the following operations: generating at least one initial three-dimensional grid according to an initial image. The at least one initial three-dimensional grid includes a first initial three-dimensional grid corresponding to a target area in the initial image. A first projection image area corresponding to the target area is obtained according to a plurality of first initial points of the first initial three-dimensional grid. A plurality of first pixel values ​​corresponding to a plurality of first initial points of the first initial three-dimensional grid are determined according to the respective pixel values ​​of a plurality of pixels in the target area corresponding to a plurality of projection points of the first projection image area. The at least one initial three-dimensional grid is rotated to obtain at least one target three-dimensional grid. The at least one target three-dimensional grid includes a first target three-dimensional grid, and a plurality of first target points of the first target three-dimensional grid correspond to a plurality of first initial points. A sample image is obtained according to a plurality of first pixel values ​​corresponding to at least one target three-dimensional grid and a plurality of first initial points.

[0134] In some embodiments, the target area includes a plurality of initial key points, and the position of at least one sample key point is determined according to the position of at least one initial key point among the plurality of initial key points.

[0135] Fig. 9 is a block diagram of an image detection device according to an embodiment of the present disclosure.

[0136] like Fig. 9 As shown, the device 900 may include a fifth obtaining module 910 .

[0137] The fifth obtaining module 910 is used to input the image to be detected into the detection model to obtain at least one key point of the image to be detected.

[0138] In the embodiment of the present disclosure, the detection model is trained using the detection model training device provided by the present disclosure. For example, the detection model can be trained using the above-mentioned device 800.

[0139] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0140] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0141] Fig.10 1000 schematic block diagram of an example electronic device 1000 that can be used to implement an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0142] like Fig.10 As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 to a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0143] A number of components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0144] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as image generation methods, training methods for detection models, and / or image detection methods. For example, in some embodiments, the image generation method, the training method for the detection model, and / or the image detection method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the image generation method, the detection model training method and / or the image detection method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the image generation method, the detection model training method and / or the image detection method in any other appropriate manner (e.g., by means of firmware).

[0145] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0146] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0147] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories (EPROM) or flash memories, optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0148] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) display or a liquid crystal display (LCD)) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0149] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a Local Area Network (LAN), a Wide Area Network (WAN), and the Internet.

[0150] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0151] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0152] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for generating an image, comprising: Generate at least one initial three-dimensional grid according to the initial image, wherein the at least one initial three-dimensional grid includes a first initial three-dimensional grid corresponding to the target area in the initial image; Obtaining a first projection image area corresponding to the target area according to a plurality of first initial points of the first initial three-dimensional grid; Determine a plurality of first pixel values ​​corresponding to a plurality of first initial points of the first initial three-dimensional grid according to respective pixel values ​​of a plurality of pixels in the target area corresponding to a plurality of projection points of the first projection image area; Rotating at least one of the initial three-dimensional grids to obtain at least one target three-dimensional grid, wherein the at least one target three-dimensional grid includes a first target three-dimensional grid, and a plurality of first target points of the first target three-dimensional grid correspond to a plurality of the first initial points; A target image is obtained according to at least one of the target three-dimensional grids and a plurality of the first pixel values ​​corresponding to a plurality of the first initial points.

2. The method according to claim 1, wherein: The step of obtaining a first projection image region corresponding to the target region according to the plurality of first initial points of the first initial three-dimensional grid comprises: Projecting the plurality of first initial points onto the initial image to obtain a first projection image region, wherein the first projection image region overlaps with the target region, and the plurality of projection points of the first projection image region correspond to the plurality of first initial points.

3. The method according to claim 1, wherein: Determining a plurality of first pixel values ​​corresponding to a plurality of first initial points of the first initial three-dimensional grid according to respective pixel values ​​of a plurality of pixels in the target area corresponding to a plurality of projection points of the first projection image area comprises: Determine the pixel values ​​of the plurality of projection points in the first projection image area according to the pixel values ​​of the plurality of pixels in the target area; According to the respective pixel values ​​of the plurality of projection points in the first projection image area, a plurality of first pixel values ​​corresponding to the plurality of first initial points are determined.

4. The method according to claim 3, wherein: The plurality of projection points of the first projection image area include at least one of a first projection point and a second projection point, the first projection point coincides with a pixel of the target area, and the second projection point does not coincide with any pixel of the target area, Determining the pixel values ​​of the plurality of projection points in the first projection image area according to the pixel values ​​of the plurality of pixels in the target area comprises at least one of the following: Determine the pixel value of the pixel in the target area that coincides with the first projection point as the pixel value of the first projection point; Interpolation is performed according to pixel values ​​of a plurality of pixels adjacent to the second projection point in the target area to obtain a pixel value of the second projection point.

5. The method according to claim 1, wherein: The first target three-dimensional grid includes a plurality of first target points corresponding to the plurality of first initial points, The obtaining of the target image according to at least one of the target three-dimensional grids and the plurality of the first pixel values ​​corresponding to the plurality of the first initial points comprises: Projecting the first target three-dimensional grid to obtain an image to be processed, wherein the image to be processed includes a plurality of first pixels to be processed corresponding to a plurality of the first target points; Determine pixel values ​​of each of a plurality of first pixels to be processed according to a plurality of first pixel values ​​corresponding to a plurality of first initial points; The target image is obtained according to the pixel values ​​of each of the first pixels to be processed.

6. The method according to claim 1, wherein: The target area includes a plurality of initial key points, the target image includes at least one target key point corresponding to at least one of the initial key points, The method further comprises: The position of at least one target key point in the target image is determined according to the positions of the multiple initial key points.

7. The method according to claim 1, wherein: At least one of the initial three-dimensional grids further comprises a second initial three-dimensional grid; Generating at least one initial three-dimensional grid according to the initial image comprises: generating the first initial three-dimensional grid according to the initial image; The second initial three-dimensional grid is generated according to the first initial three-dimensional grid and a preset rule.

8. The method according to claim 6, further comprising: Obtaining a second projection image region according to a plurality of second initial points of the second initial three-dimensional grid; According to a plurality of pixel values ​​in an area outside the target area in the initial image, a plurality of second pixel values ​​corresponding to a plurality of the second initial points are determined.

9. The method according to claim 8, wherein: The determining, according to a plurality of pixel values ​​in an area outside the target area in the initial image, a plurality of second pixel values ​​corresponding to a plurality of second initial points comprises: Determining respective pixel values ​​of a plurality of projection points in the second projection image area according to respective pixel values ​​of a plurality of pixels in an area outside the target area in the initial image; According to the respective pixel values ​​of the plurality of projection points in the second projection image area, a plurality of second pixel values ​​corresponding to the plurality of second initial points are determined.

10. The method according to claim 9, wherein: The plurality of projection points of the second projection image area may include at least one of a third projection point and a fourth projection point, the third projection point coincides with a pixel in an area outside the target area in the initial image, and the fourth projection point does not coincide with any pixel in an area outside the target area in the initial image, Determining the pixel values ​​of the plurality of projection points in the second projection image area according to the pixel values ​​of the plurality of pixels in the area outside the target area in the initial image comprises at least one of the following: Determine the pixel value of the pixel in the area outside the target area that coincides with the third projection point as the pixel value of the third projection point; Interpolation is performed based on pixel values ​​of a plurality of pixels adjacent to the fourth projection point in an area other than the target area in the initial image to obtain a pixel value of the fourth projection point.

11. The method according to claim 8, wherein: At least one of the target three-dimensional grids includes a second target three-dimensional grid, the second target three-dimensional grid includes a plurality of second target points corresponding to a plurality of the second initial points, The obtaining of the target image according to at least one of the target three-dimensional grids and the plurality of the first pixel values ​​corresponding to the plurality of the first initial points comprises: Projecting the first target three-dimensional grid and the second target three-dimensional grid to obtain an image to be processed, wherein the image to be processed includes a plurality of first pixels to be processed corresponding to a plurality of the first target points and a plurality of second pixels to be processed corresponding to a plurality of the second target points; and Determine pixel values ​​of each of a plurality of first pixels to be processed according to a plurality of first pixel values ​​corresponding to a plurality of first initial points; Determine the pixel value of each of the plurality of second pixels to be processed according to the plurality of second pixel values ​​corresponding to the plurality of second initial points; The target image is obtained according to the pixel values ​​of each of the plurality of first pixels to be processed and the pixel values ​​of each of the plurality of second pixels to be processed.

12. A method for training a detection model, comprising: Inputting the sample image into the detection model to obtain at least one sample key point of the sample image; training the detection model according to at least one of the sample key points and at least one key point label of the sample image, The sample image is generated by the following operations: Generate at least one initial three-dimensional grid according to the initial image, wherein the at least one initial three-dimensional grid includes a first initial three-dimensional grid corresponding to the target area in the initial image; Obtaining a first projection image area corresponding to the target area according to a plurality of first initial points of the first initial three-dimensional grid; Determine a plurality of first pixel values ​​corresponding to a plurality of first initial points of the first initial three-dimensional grid according to respective pixel values ​​of a plurality of pixels in the target area corresponding to a plurality of projection points of the first projection image area; Rotating at least one of the initial three-dimensional grids to obtain at least one target three-dimensional grid, wherein the at least one target three-dimensional grid includes a first target three-dimensional grid, and a plurality of first target points of the first target three-dimensional grid correspond to a plurality of the first initial points; The sample image is obtained according to at least one of the target three-dimensional grids and a plurality of the first pixel values ​​corresponding to a plurality of the first initial points.

13. The method according to claim 10, wherein: The target area includes a plurality of initial key points, and the position of at least one of the sample key points is determined according to the position of at least one of the plurality of initial key points.

14. An image detection method, comprising: Input the image to be detected into the detection model to obtain at least one key point of the image to be detected, Wherein, the detection model is trained using the method described in any one of claims 12 to 13.

15. An image generating device, comprising: A generating module, configured to generate at least one initial three-dimensional grid according to an initial image, wherein the at least one initial three-dimensional grid comprises a first initial three-dimensional grid corresponding to a target area in the initial image; A first acquisition module, configured to obtain a first projection image region corresponding to the target region according to a plurality of first initial points of the first initial three-dimensional grid; A first determination module, configured to determine a plurality of first pixel values ​​corresponding to a plurality of first initial points of the first initial three-dimensional grid according to respective pixel values ​​of a plurality of pixels in the target area corresponding to a plurality of projection points of the first projection image area; A rotation module, configured to rotate at least one of the initial three-dimensional grids to obtain at least one target three-dimensional grid, wherein the at least one target three-dimensional grid includes a first target three-dimensional grid, and a plurality of first target points of the first target three-dimensional grid correspond to a plurality of the first initial points; The second acquisition module is used to obtain a target image according to at least one of the target three-dimensional grids and multiple first pixel values ​​corresponding to multiple first initial points.

16. A training device for a detection model, comprising: A fourth acquisition module, used for inputting the sample image into the detection model to obtain at least one sample key point of the sample image; a training module, configured to train the detection model according to at least one of the sample key points and at least one key point label of the sample image, The sample image is generated by the following operations: Generate at least one initial three-dimensional grid according to the initial image, wherein the at least one initial three-dimensional grid includes a first initial three-dimensional grid corresponding to the target area in the initial image; Obtaining a first projection image area corresponding to the target area according to a plurality of first initial points of the first initial three-dimensional grid; Determine a plurality of first pixel values ​​corresponding to a plurality of first initial points of the first initial three-dimensional grid according to respective pixel values ​​of a plurality of pixels in the target area corresponding to a plurality of projection points of the first projection image area; Rotating at least one of the initial three-dimensional grids to obtain at least one target three-dimensional grid, wherein the at least one target three-dimensional grid includes a first target three-dimensional grid, and a plurality of first target points of the first target three-dimensional grid correspond to a plurality of the first initial points; The sample image is obtained according to at least one of the target three-dimensional grids and a plurality of the first pixel values ​​corresponding to a plurality of the first initial points.

17. An image detection device, comprising: A fifth acquisition module is used to input the image to be detected into the detection model to obtain at least one key point of the image to be detected. Wherein, the detection model is trained using the device as described in claim 16.

18. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 14.

19. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 14.

20. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 14.