Model training method and device, computer equipment, storage medium and program product
By identifying and marking the stretchable and non-stretchable areas of the image, a stretched image marking model is trained, which solves the deformation and distortion problems during image stretching and achieves higher image clarity.
Patent Information
- Application Number
- CN202411974819.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-03-25
AI Technical Summary
During the image stretching process, the prior art is difficult to effectively reduce the deformation and distortion of the image, resulting in low image clarity after stretching.
By acquiring the training image, identifying its borders, determining the target border segments, and obtaining reference mark information based on these border segments, marking the stretchable and non-stretchable areas of the image. Then, this information is used to train the model, adjust the model parameters until the training end condition is met, and a stretched image marker model is obtained. The model is able to accurately identify stretchable and non-stretched areas of the image, thereby reducing deformation and distortion during the stretching process.
By identifying and marking stretchable and non-stretchable areas of the image, the model training method can significantly reduce the degree of image deformation and distortion after stretching and improve the sharpness of the image.
Smart Images

Figure CN119693229A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a model training method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of computer technology, a system can usually run on multiple terminals. Since the resolutions of the display devices of the terminals are different, in order to make the elements in the system, such as pictures, adapt to the display devices of various terminals, these elements usually need to be processed, such as stretching the pictures. However, currently, when stretching the image to adapt to various display devices, the elements in the image are often deformed. Summary of the invention
[0003] Based on this, it is necessary to provide a model training method, device, computer equipment, computer-readable storage medium and computer program product that can reduce the degree of deformation and distortion of stretched images in response to the above-mentioned technical problems.
[0004] In a first aspect, the present application provides a model training method, comprising:
[0005] Get training images;
[0006] Identify the bounding box of the training image and determine the target bounding box segment from the bounding box;
[0007] Obtaining reference marking information of the training image based on the target frame segment, where the reference marking information is used to mark a stretchable area and a non-stretchable area of the training image;
[0008] Obtain a target training set based on the training images and the corresponding reference marking information;
[0009] Each training image in the target training set is input into the preset model to obtain the predicted labeling information corresponding to each training image, and the parameters of the preset model are adjusted based on the predicted labeling information and the reference labeling information until the training end condition is met to obtain the stretched image labeling model.
[0010] In a second aspect, the present application also provides a model training device, comprising:
[0011] An acquisition module, used for acquiring training images;
[0012] A determination module, used to identify the border of the training image and determine the target border segment from the border;
[0013] A marking module, used for obtaining reference marking information of a training image based on a target frame segment, wherein the reference marking information is used for marking a stretchable area and a non-stretchable area of the training image;
[0014] A processing module, used for obtaining a target training set based on the training image and the corresponding reference marking information;
[0015] The training module is used to input each training image in the target training set into the preset model, obtain the predicted labeling information corresponding to each training image, adjust the parameters of the preset model based on the predicted labeling information and the reference labeling information, until the training end condition is met, and obtain the stretched image labeling model.
[0016] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the training method of the stretched image labeling model when executing the computer program.
[0017] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the training method of the stretched image labeling model are implemented.
[0018] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps in the training method of the stretched image labeling model.
[0019] The above-mentioned model training method, device, computer equipment, computer-readable storage medium and computer program product obtain a training image, identify the border of the training image, determine the target border segment from the border, and then obtain the reference marking information of the training image based on the target border segment, and obtain the target training set based on the training image and the corresponding reference marking information. Since the reference marking information is used to mark the stretchable area and the non-stretchable area of the training image, each training image in the target training set is input into a preset model to obtain the predicted marking information corresponding to each training image, and the parameters of the preset model are adjusted based on the predicted marking information and the reference marking information until the training end condition is met. The obtained stretched image marking model can accurately identify the stretchable area and the non-stretchable area of the image input into the model, so that when the image is subsequently stretched, the stretchable area is stretched and the non-stretchable area is not stretched. In this way, when the image is stretched, the distortion and deformation of the stretched image can be reduced, thereby improving the clarity of the stretched image. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 A schematic diagram of a flow chart of a model training method in one embodiment;
[0022] Figure 2 is a schematic diagram of a training image in one embodiment;
[0023] Figure 3 A schematic diagram of a flow chart of a step of obtaining reference mark information in one embodiment;
[0024] Figure 4 is a schematic diagram of a training image in another embodiment;
[0025] Figure 5 is a schematic diagram of a training image in yet another embodiment;
[0026] Figure 6 A schematic diagram of a flow chart of a step of expanding a training set in one embodiment;
[0027] Figure 7 A schematic diagram of a flow chart of a model training method in another embodiment;
[0028] Figure 8 is a structural block diagram of a model training device in one embodiment;
[0029] Fig. 9 is an internal structure diagram of a computer device in one embodiment;
[0030] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0032] The training method of the stretched image labeling model provided in the embodiment of the present application can be applied to a terminal or a server. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, and tablet computers. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0033] In an exemplary embodiment, Figure 1As shown, a model training method is provided, and the method is applied to a server as an example for explanation. It can be understood that the method can also be applied to a server. It can also be applied to a system including a terminal and a server, and implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps 102 to 110. Among them:
[0034] Step 102: Obtain a training image.
[0035] The training image is used to be input into a preset model to train the preset model and obtain a stretched image labeling model. After the training image is input into the preset model, the preset model can capture the local features of the training image and learn the correlation between the local features of the training image and the labeling information, thereby training the stretched image labeling model. The labeling information is used to mark the stretchable area and the non-stretchable area of the training image.
[0036] For example, the training image can be an image used as a background image. Such images usually have the characteristics of lines around, scattered embellishments around, and a blank area in the middle (refer to Figure 2 ).
[0037] Optionally, the training image can be a bitmap image. The server can obtain a large number of training images from the Internet through network crawling, so as to facilitate the subsequent full training of the preset model.
[0038] Step 104 , identifying the border of the training image, and determining the target border segment from the border.
[0039] Among them, reference Figure 2 , the server can process the training image to identify the border of the training image. The target border segment is a border segment in which the shape difference between the border after stretching and before stretching is within a preset range. For example, it can be a border segment with a simple shape in the border, such as a border composed of line segments and a border composed of rectangles. For border segments with complex shapes in the border, such as a border composed of corner patterns, they do not belong to the target border segment.
[0040] Exemplarily, for an image, four frames and two directions are included. Each direction corresponds to two frames. When the image is stretched, since the frame of the image may be multi-style, if each area of the image can be stretched, the frame of the stretched image may be deformed. For example, the circle at the frame is deformed into an ellipse. Therefore, in order to prevent the stretched image from being deformed, the stretchable area and the non-stretchable area of the image can be determined based on the attributes of the image (such as the frame attributes). When the image is stretched, the stretchable area is stretched and the non-stretchable area is not stretched, so that the deformation of the image during the stretching process can be greatly reduced. In this embodiment, in order to determine the stretchable area and the non-stretchable area of the image, the target frame segment can be determined based on the attributes of the image. Optionally, the step of determining the target frame segment from the frame includes: from the target frame segment, obtaining the first frame segment and the second frame segment of the position matching in the first direction. And from the target frame segment, obtaining the third frame segment and the fourth frame segment of the position matching in the second direction. Wherein, the first frame segment and the second frame segment are not on the same horizontal line. The first direction and the second direction are horizontal or vertical, respectively. If the first direction is the horizontal direction, the second direction is the vertical direction. If the first direction is the vertical direction, the second direction is the horizontal direction.
[0041] Step 106: Obtain reference label information of the training image based on the target bounding box segment.
[0042] Among them, the reference marker information is used to mark the stretchable area and the non-stretchable area of the training image. Exemplarily, the reference marker information can be a reference marker image that is the same size as the training image. In the reference marker image, the pixel value of the stretchable area is a first preset value, and the pixel value of the non-stretchable area is a second preset value. The first preset value can be, for example, 1 or 0. The second preset value can be, for example, 0 or 1. The first preset value is different from the second preset value. Therefore, after determining the stretchable area and the non-stretchable area of the training image, the reference marker information corresponding to the training image can be determined.
[0043] For an image, the stretchable area can be divided into horizontal stretching and vertical stretching. Based on horizontal stretching, vertical stretching, or a combination of horizontal stretching and vertical stretching, any stretching of the image can be achieved. Therefore, when determining the stretchable area of the training image, the first direction stretching area and the second direction stretching area of the training image can be determined respectively. That is, the horizontal stretching area and the vertical stretching area of the training image are determined respectively.
[0044] In this embodiment, the stretchable area and the non-stretchable area of the training image can be determined based on the target frame segment. As mentioned above, based on the frame, the first frame segment and the second frame segment that match the first direction position, and the third frame segment and the fourth frame segment that match the second direction position can be obtained. Exemplarily, the corresponding first direction rectangular area can be determined based on the first frame segment and the second frame segment as the boundary. And the corresponding second direction rectangular area is determined based on the third frame segment and the fourth frame segment as the boundary. The first direction rectangular area is used to stretch the training image in the first direction. The second direction rectangular area is used to stretch the training image in the second direction.
[0045] Optionally, when the starting point and the end point of the first frame segment and the second frame segment are not on the same horizontal line or the same vertical line, the intersection frame segment corresponding to the first frame segment and the second frame segment can be obtained respectively, and the starting point and the end point of the intersection frame segment corresponding to the first frame segment and the intersection frame segment corresponding to the second frame segment are on the same horizontal line or the same vertical line. Then, the intersection frame segment corresponding to the first frame segment and the intersection frame segment corresponding to the second frame segment can be used as the boundary to determine the corresponding first direction rectangular area.
[0046] Optionally, the number of combinations of the first frame segment and the second frame segment that match each other in position may be more than one (see Figure 2 ).
[0047] Step 108: obtaining a target training set based on the training images and the corresponding reference label information.
[0048] Step 110, input each training image in the target training set into the preset model, obtain the predicted labeling information corresponding to each training image, adjust the parameters of the preset model based on the predicted labeling information and the reference labeling information, until the training end condition is met, and obtain the stretched image labeling model.
[0049] The training end condition may be that the difference between the predicted label information predicted by the preset model after adjusting the parameters for the training image and the reference label information corresponding to the training image is within a preset range. The preset range is approximately zero. The predicted label information also marks the stretchable area and the non-stretchable area of the training image.
[0050] Optionally, in the process of obtaining the target training set, the training images can be mutated using data augmentation technology to increase the diversity of the training set, thereby improving the robustness of the stretched image labeling model. For example, the training image can be adjusted (e.g., cropped, rotated, adding interference information, etc.) to obtain an adjusted image. Then, based on the adjusted image and the labeling information of the original training image, the labeling information corresponding to the adjusted image is obtained, and the target training set is obtained based on the training image and the corresponding labeling information, the adjusted image and the corresponding labeling information.
[0051] Optionally, in the process of adjusting the parameters of the preset model based on the predicted tag information and the reference tag information, the difference between the predicted tag information and the reference tag information can be obtained using a cross entropy loss function. The preset model can be a convolutional neural network model. Optionally, an Adam optimizer can be selected to train the preset model.
[0052] In the training method of the above-mentioned stretched image labeling model, a training image is obtained, the border of the training image is identified, the target border segment is determined from the border, and then the reference labeling information of the training image is obtained based on the target border segment. The target training set is obtained based on the training image and the corresponding reference labeling information. Since the reference labeling information is used to mark the stretchable area and the non-stretchable area of the training image, each training image in the target training set is input into the preset model to obtain the predicted labeling information corresponding to each training image. The parameters of the preset model are adjusted based on the predicted labeling information and the reference labeling information until the training end condition is met. The obtained stretched image labeling model can accurately identify the stretchable area and the non-stretchable area of the image input into the model, so that when the image is stretched later, the stretchable area is stretched and the non-stretchable area is not stretched. In this way, when the image is stretched, the distortion and deformation of the stretched image can be reduced, thereby improving the clarity of the stretched image.
[0053] In an exemplary embodiment, Figure 3 As shown, after obtaining the target frame segment of the training image, since the stretchable region involves two frames of the image, it is necessary to determine the stretchable frame segment with matching position from the target frame segment, so as to obtain the stretchable region based on the stretchable frame segment with matching position. Therefore, the step of obtaining the reference mark information of the target bitmap image based on the target frame segment includes steps 302 to 306. Among them:
[0054] Step 302 : acquiring a first frame segment and a second frame segment that match positions in a first direction from the target frame segment, and determining a corresponding first direction rectangular area with the first frame segment and the second frame segment as boundaries to obtain a first direction stretchable area.
[0055] Step 304 , obtaining a third frame segment and a fourth frame segment that match the target frame segment in the second direction, using the third frame segment and the fourth frame segment as boundaries, determining a corresponding second direction rectangular area, and obtaining a second direction stretchable area.
[0056] The first direction stretchable region is composed of a first direction rectangular region, and the second direction stretchable region is composed of a second direction rectangular region. The first direction and the second direction are perpendicular to each other.
[0057] The target bounding box segment is a part of the bounding box of the training image. There may be a target bounding box segment on all four bounding boxes of the image. There are more than one target bounding box segment. However, not all target bounding box segments can be used as the bounding box of the stretchable region. For example, for a target bounding box segment, if there is no target bounding box segment matching its position, then the target bounding box segment will not be used as the bounding box of the stretchable region (refer to Figure 4 ).
[0058] Since the training image can be stretched both horizontally and vertically, the stretchable area is divided into a first direction stretching area and a second direction stretching area. Two frame segments that match in position in the first direction may mean that the starting point of one of the two frame segments can be projected onto the other frame segment. The projection direction is perpendicular to the first direction.
[0059] Optionally, the starting point of the first frame segment is projected onto the second frame segment to obtain a first projection point. The terminal of the second frame segment is projected onto the first frame segment to obtain a second projection point. The first projection point and the terminal of the second frame segment are used as the first boundary, and the second projection point and the terminal of the first frame segment are used as the second boundary, and the corresponding first direction rectangular area is determined based on the first boundary and the second boundary. If the first projection point is not on the second frame segment when the starting point of the first frame segment is projected onto the second frame segment, the terminal of the first frame segment is projected onto the second frame segment to obtain the first projection point. The starting point of the second frame segment is projected onto the first frame segment to obtain the second projection point.
[0060] Optionally, when the starting point of the first frame segment can be projected onto the second frame segment, if the first projection point is the starting point of the second frame segment and the second projection point is the end point of the first frame segment, the first frame segment and the second frame segment can be used as boundaries to determine the corresponding first-direction rectangular area. The first frame segment and the second frame segment can be interchangeable.
[0061] Optionally, the starting point of the third frame segment is projected to the fourth frame segment to obtain a third projection point. The terminal of the fourth frame segment is projected to the third frame segment to obtain a fourth projection point. The third projection point and the end point of the fourth frame segment are used as the third boundary, and the fourth projection point and the end point of the third frame segment are used as the fourth boundary, and the corresponding second direction rectangular area is determined based on the third boundary and the fourth boundary. If the third projection point is not on the fourth frame segment when the starting point of the third frame segment is projected to the fourth frame segment, the end point of the third frame segment is projected to the fourth frame segment to obtain the third projection point. The starting point of the fourth frame segment is projected to the third frame segment to obtain the fourth projection point.
[0062] Optionally, when the starting point of the third frame segment can be projected onto the fourth frame segment, if the projection point of the starting point of the third frame segment on the fourth frame segment is the starting point of the fourth frame segment and the projection point of the end point of the third frame segment on the fourth frame segment is the end point of the fourth frame segment, the third frame segment and the fourth frame segment can be used as boundaries to determine the corresponding second direction rectangular area. The positions of the third boundary box and the fourth boundary box can be interchanged.
[0063] Step 306: Obtain reference mark information based on the first-direction stretchable region and the second-direction stretchable region.
[0064] Since the first-direction stretching area is used to stretch the image in the first direction and the second-direction stretching area is used to stretch the image in the second direction, the pixels in the first-direction stretchable area and the second-direction stretchable area are both stretchable pixels.
[0065] Optionally, the reference tag information may be a tag image, in which the tag value corresponding to each pixel in the training image is stored. For example, when a pixel in the training image is within the first direction stretchable region or the second direction stretchable region, the tag value corresponding to the pixel in the tag image may be a first preset value (e.g., 1). When a pixel in the training image is not within the first direction stretchable region or the second direction stretchable region, the tag value corresponding to the pixel in the tag image may be a second preset value (e.g., 0).
[0066] Optionally, the reference tag information may also be a two-dimensional array. The tag value corresponding to each pixel in the training image is stored in the two-dimensional array. For example, for the pixel in the second row and fourth column in the training, if the pixel is in the stretchable area in the first direction or the stretchable area in the second direction, then the value corresponding to the second row and fourth column in the two-dimensional array is the first preset value.
[0067] It is understandable that, for an image, there may not be a first-direction stretchable region or a second-direction stretchable region. The region other than the first-direction stretchable region in the image is determined as the first-direction non-stretchable region. The other regions other than the second-direction stretchable region in the image are determined as the second-direction non-stretchable region.
[0068] In this embodiment, a first frame segment and a second frame segment that match the position in the first direction are obtained from the target frame segment, and the first frame segment and the second frame segment are used as boundaries to determine the corresponding rectangular area in the first direction, thereby obtaining a stretchable area in the first direction; a third frame segment and a fourth frame segment that match the position in the second direction are obtained from the target frame segment, and the third frame segment and the fourth frame segment are used as boundaries to determine the corresponding rectangular area in the second direction, thereby obtaining a stretchable area in the second direction; marking information is obtained based on the stretchable area in the first direction and the stretchable area in the second direction, thereby determining the stretchable area of the image in the first direction and the second direction based on the frame attributes of the image, so that when the image is stretched, the elements in the frame of the image will not be deformed, thereby achieving the effect of the image after stretching is consistent with that of the image before stretching.
[0069] In some embodiments, for example, for a rectangular area in the first direction, since the line segment connecting the starting points of the first frame segment and the second frame segment is not necessarily perpendicular to the first direction, it is necessary to use a portion of the frame segment of the first frame segment and a portion of the frame segment of the second frame segment as boundaries to obtain the corresponding rectangular area in the first direction. Figure 5 , project the starting point of the first frame segment to the second frame segment to obtain a first projection point; project the end point of the second frame segment to the first frame segment to obtain a second projection point; take the first projection point and the end point of the second frame segment as the first boundary, take the second projection point and the end point of the first frame segment as the second boundary, and determine the corresponding first direction rectangular area based on the first boundary and the second boundary.
[0070] In this embodiment, the first frame segment and the second frame segment that match in position are processed to obtain the intersection portion corresponding to the first frame segment and the second frame segment, and then the corresponding first-direction rectangular area is obtained by the intersection portion. This can improve the accuracy of the stretchable area and reduce the deformation of part of the frame when the image is stretched.
[0071] Similarly, in some embodiments, to obtain a second-direction rectangular area, the starting point of the third frame segment can be projected to the fourth frame segment to obtain a third projection point; the terminal end of the fourth frame segment can be projected to the third frame segment to obtain a fourth projection point; the third projection point and the end point of the fourth frame segment are taken as the third boundary, and the fourth projection point and the end point of the third frame segment are taken as the fourth boundary, and the corresponding second-direction rectangular area is determined based on the third boundary and the fourth boundary.
[0072] For the description of the processing steps for the third frame segment and the fourth frame segment in this embodiment, reference can be made to the above description of the processing steps for the first frame segment and the second frame segment, which will not be repeated here.
[0073] In some embodiments, Figure 6As shown, the training images can be adjusted to expand the training set, thereby improving the robustness of the model finally obtained by training. Therefore, the step of obtaining the target training set based on the training images and the corresponding reference marking information can include adjusting the training images to obtain the adjusted images; obtaining the adjusted marking information based on the adjusted images and the reference marking information of the training images; and determining the training images and the corresponding marking information, the adjusted images and the corresponding adjusted marking information as the target training set.
[0074] The training image may be adjusted by at least one of flipping, cropping, blocking, and color jittering. Since the image is adjusted, the adjusted image is different from the original training image, so the corresponding reference mark information also needs to be adjusted accordingly. After obtaining the adjusted image and the adjustment mark information corresponding to the adjusted image, the adjusted image and the adjustment mark information corresponding to the adjusted image can be added to the target training set.
[0075] Optionally, if the training image is flipped (eg, flipped left-right or up-down) to obtain an adjusted image, the adjusted mark information corresponding to the adjusted image may be obtained by performing the same flipping on the mark information.
[0076] Optionally, if the training image is cropped to obtain an adjusted image, the adjustment mark information corresponding to the adjusted image may be obtained by cropping the mark information in the same manner. For example, the training image is cropped to 80% of the original size to obtain the adjusted image. The adjustment mark information after removing the cropped area is obtained by the cropping ratio coefficient.
[0077] Optionally, when color dithering is performed on the training image, that is, the color information of the training image is changed to obtain an adjusted image. Since color dithering of the training image should not affect the stretchable and non-stretchable areas of the training image, the adjustment mark information corresponding to the adjusted image is consistent with the mark information.
[0078] Optionally, when an occlusion operation is performed on the training image, for example, a rectangular image is randomly covered on the training image to obtain an adjusted image. The area of the rectangular image may be within 10% to 20% of the area of the training image. When the rectangular image is in the stretchable area of the training image, the adjustment mark information is consistent with the mark information. When part or all of the rectangular image is in the non-stretchable area of the training image, the adjustment mark information is inconsistent with the mark information. In the adjustment mark information, the mark value corresponding to the rectangular image corresponds to the non-stretchable area.
[0079] In this embodiment, by adjusting the training images, data enhancement can be performed on the training images, thereby expanding the breadth and accuracy of the target training set, and further improving the robustness and generalization ability of the trained model.
[0080] In some embodiments, since the structure of the model is fixed, the model may have certain requirements for the input image. If the images input to the model are inconsistent (for example, the size is inconsistent), the training effect and training speed of the model may be affected. Therefore, in order to improve the processing accuracy of the model for the image and reduce the prediction deviation of the model caused by the inconsistent size of the input image, the image can be preprocessed.
[0081] For example, the training images may be size-standardized and pixel-value-standardized. When the training images are size-standardized, the sizes of the training images may be unified. This allows the convolution kernel and pooling operations of the model to work effectively, and also reduces the amount of computation of the model due to the large image size. Unifying the size can control the cost, and after the size is unified, the model can better learn similar features.
[0082] When standardizing the pixel values of the training image, the pixel values can be standardized to a range of 0 to 1 by obtaining the mean of all pixels in the image, and then subtracting the mean from each pixel and dividing it by the standard deviation. This can reduce the occurrence of large gradient changes caused by excessive pixel values during gradient descent, which affects the convergence of the model. Standardizing the pixels can also enable the model to focus more on learning important features in the image, rather than simply brightness changes caused by pixel differences.
[0083] In some embodiments, after obtaining the stretchable image marking model, the stretchable area and non-stretchable area of the image can be identified using the stretchable image marking model, and then the stretched image can be obtained based on the stretching operation information. The stretching operation information can be input by the user or can be the stretching operation information pre-stored in the terminal. Exemplarily, the image to be stretched is input into the stretchable image marking model to obtain the marking information of the image to be stretched; based on the marking information of the image to be stretched, the stretchable area and non-stretchable area of the image to be stretched are determined. The stretchable area includes a stretchable area in the first direction and a stretchable area in the second direction. The non-stretchable area includes a non-stretchable area in the first direction and a non-stretchable area in the second direction.
[0084] When it is necessary to obtain a stretched image of the image in the first direction, the first direction stretchable area can be processed based on the first stretching operation information to obtain the corresponding first direction stretching area, and the first direction stretching area and the first direction non-stretchable area can be spliced to obtain the first direction stretched image.
[0085] When it is necessary to obtain a stretched image of the image in the second direction, the second direction stretchable area can be processed based on the second stretching operation information to obtain the corresponding second direction stretching area, and the second direction stretching area and the second direction non-stretchable area can be spliced to obtain the second direction stretched image.
[0086] It can be understood that the image can be stretched in the first direction, the image can be stretched in the second direction, or the image can be stretched in both the first direction and the second direction.
[0087] The first stretching operation information corresponds to the first direction. If the first direction is horizontal, the first stretching operation information may be to extend or shorten the length of the image. The second stretching operation information corresponds to the second direction. If the second direction is vertical, the second stretching operation information may be to extend or shorten the width of the image.
[0088] In the above embodiment, the stretched image is obtained by the output result based on the model, so that the user can stretch the stretchable area and cannot stretch the non-stretchable area, thereby reducing the deformation of the pattern in the image during stretching, so that the image after stretching is consistent with the image before stretching and has high clarity.
[0089] In some embodiments, to obtain a stretched image corresponding to the stretchable region, a target element (eg, Figure 5 The point, line, and corner of the frame in the image are stretched, and then the stretched image is obtained based on the target element after the stretching process, rather than directly stretching the stretchable area. Exemplarily, the element information of the target element is obtained; the element information is updated based on the first stretching operation information to obtain the updated element information of the target element; and the first direction stretching area is obtained based on the updated element information of the target element.
[0090] Since there may be multiple elements in the image, and some elements exist in the stretchable area, and some elements exist in the non-stretchable area. Therefore, in order to determine the target element, after obtaining the element information of each element in the image, the target element in the stretchable area can be determined based on the marking information of the image to be stretched. Optionally, the element information includes position information, and the target element in the stretchable area is determined based on the marking information of the image to be stretched, including: if the position information of the element is within the stretchable area corresponding to the marking information of the image to be stretched, then the element is determined to be the target element. If the position information of the element is not within the stretchable area corresponding to the marking information of the image to be stretched, then the element is not the target element. Therefore, the element information update processing is not performed on such elements.
[0091] The element information may refer to the position information and size information of the target element. To obtain the stretched image, the element information of the target element may be updated based on the first stretching operation information to obtain updated element information, and then the first direction stretching area may be obtained based on the updated element information.
[0092] When updating the element information of the target element based on the first stretching operation information, the update processing for regular elements and irregular elements is different. If the target element is a standard element, the target element can be scaled proportionally based on the first stretching operation information. If the target element is not a standard element (such as a complex pattern: corner flower), the target element can be stretched corresponding to the first stretching operation information by combining intelligent grid deformation with fixed boundaries to reduce the occurrence of image distortion.
[0093] In this embodiment, each element in the image has its own corresponding layer, so obtaining the first direction stretching area based on the updated element information of the target element includes: obtaining the updated target element based on the updated element information, merging the layers where each updated target element is located, and obtaining the first direction stretching area. Finally, the first direction stretching area and the first direction non-stretching area are spliced to obtain the first direction stretched image.
[0094] It can be understood that the processing performed on the stretchable region in the second direction can refer to the processing performed on the stretchable region in the first direction, and will not be repeated here.
[0095] In addition, in some embodiments, since the image is stretched, the position information of the non-target elements in the non-stretchable area may also be changed and updated. The non-stretchable area may be updated based on the updated element information of the non-target elements.
[0096] In this embodiment, by determining whether the target element is within the stretchable area and updating the information of the element in the image to obtain the stretched image, rather than directly stretching the image, the clarity of the stretched image can be ensured and distortion can be reduced.
[0097] In an exemplary embodiment, in order to reduce image distortion when stretching an image, a model may be constructed to identify stretchable and non-stretchable regions of the image.
[0098] like Figure 7 As shown, in order to obtain the model, training images can be obtained first. When obtaining training images, a large number of bitmap images that can be used as background images can be crawled through means such as the designer's provision and network crawling.
[0099] After obtaining the training image, the border of the training image can be identified, and the target border segment can be determined from the border, wherein the area corresponding to the target border segment in the training image may be stretched.
[0100] Then, the reference marking information of the training image can be obtained based on the target frame segment, and the reference marking information is used to mark the stretchable area and non-stretchable area of the training image. The marking information can be, for example, two-dimensional data with only 0 and 1 of the same size as the training image, 0 indicates non-stretchable, and 1 indicates stretchable. Optionally, the starting point of the first frame segment can be projected to the second frame segment to obtain a first projection point; the terminal end of the second frame segment can be projected to the first frame segment to obtain a second projection point; the first projection point and the end point of the second frame segment are used as the first boundary, and the second projection point and the end point of the first frame segment are used as the second boundary, and the corresponding first-direction rectangular area is determined based on the first boundary and the second boundary to obtain the first-direction stretchable area.
[0101] Then project the starting point of the third frame segment to the fourth frame segment to obtain a third projection point; project the terminal end of the fourth frame segment to the third frame segment to obtain a fourth projection point; take the third projection point and the end point of the fourth frame segment as the third boundary, take the fourth projection point and the end point of the third frame segment as the fourth boundary, and determine the corresponding second-direction rectangular area based on the third boundary and the fourth boundary to obtain the second-direction rectangular area.
[0102] Afterwards, the target training set can be obtained based on the training image and the corresponding label information. Before obtaining the target training set, the training image can be preprocessed, mainly including size standardization and pixel value standardization. Optionally, in order to provide more training data samples, the training image can be deformed by image data enhancement technology. Image data enhancement is to perform occlusion, color jitter, random cropping, rotation and other processing on the image to simulate the situation of the image in various extreme scenes, so that image recognition is more efficient, and more training data samples can be provided to improve the generalization ability and robustness of the model. For example, for flipping, the bitmap image can be flipped left and right to output a new bitmap image. The label information of the bitmap is synchronously updated according to the flipping information to generate new label data (0 and 1). This data and the new bitmap image form a new training data set. For cropping, the bitmap image can be cropped to 80%-100% of the size of the original image, and a new bitmap image is output. The new bitmap label data set with the cropped area removed is obtained through the cropping ratio coefficient. For occlusion, you can set a rectangle with a size range of 10%-20% of the image area, set the background color of the rectangle to black, and then randomly place the rectangle on the bitmap image to output a new bitmap image. If there is a 0 (non-stretchable mark) at the position of the bitmap image to which the rectangle belongs, set the bitmap mark of this area to 0, and set the horizontal and vertical marks of the original rectangular area marked as 1 to 0. (The rectangle and the non-stretchable area are equivalent to connecting to another new non-stretchable area, and the horizontal and vertical marks of this new area are non-stretchable at this time). If there is no 0 (non-stretchable mark) at the position of the bitmap image to which the rectangle belongs, the label data set of the original bitmap remains unchanged. For color jittering, the brightness, contrast, and saturation of the bitmap image can be adjusted within the range of [0.8, 1.2], and the hue can be adjusted within the range of [-0.1, 0.1], and a new bitmap image can be output. At this time, since the position of the stretchable and non-stretchable areas has not changed, the label information remains unchanged. Through the above-mentioned image data processing methods, a new bitmap image and the corresponding bitmap label data will be obtained, which will provide more training data samples for subsequent models.
[0103] Finally, each training image in the target training set can be input into the preset model to obtain the predicted label information corresponding to each training image. The parameters of the preset model can be adjusted based on the predicted label information and the reference label information until the training end condition is met to obtain the stretched image label model. The preset model can be built based on the convolutional neural network model. When processing the input image, the convolutional neural network model can capture the local features of the image; reduce the size of the feature map, retaining only important features; and restore the image resolution. The output of the model is a label map of the same size as the input image, in which each pixel is classified into different modes (stretchable and non-stretchable). When training the model, the previous training data can be used to train the convolutional neural network model, mainly using the cross entropy loss function and selecting the Adam optimizer. During the training process, the model will learn how to automatically classify different parts of the image based on the local features of the image.
[0104] After obtaining the stretch image labeling model, the image can be stretched using the labeling information predicted by the stretch image labeling model. Exemplarily, the image to be stretched can be input into the stretch image labeling model to obtain the labeling information of the image to be stretched; based on the labeling information of the image to be stretched, the stretchable area and the non-stretchable area of the image to be stretched are determined, the stretchable area includes a first direction stretchable area and a second direction stretchable area, and the non-stretchable area includes a first direction non-stretchable area and a second direction non-stretchable area; the first direction stretchable area is stretched along the first direction to obtain a first direction stretching area, the first direction stretching area and the first direction non-stretchable area are spliced to obtain a first direction stretching image; or the second direction stretchable area is stretched along the second direction to obtain a second direction stretching area, the second direction stretching area and the second direction non-stretchable area are spliced to obtain a second direction stretching image; or the first direction stretchable area in the stretchable area is stretched along the first direction to obtain a first direction stretching area, the first direction stretching area and the first direction non-stretchable area are spliced to obtain a first direction stretching image. The second-direction stretchable area in the first-direction stretching picture is stretched along the second direction to obtain the second-direction stretching area, and the second-direction stretching area and the second-direction non-stretchable area in the first-direction stretching picture are spliced to obtain the second-direction stretching picture.
[0105] When stretching an image, the target element can be stretched based on the element information of the target element in the image. If the element cannot be stretched, the size of the element remains unchanged. Since the image needs to be stretched, the horizontal and vertical coordinates may change. If the element can be stretched, it is necessary to determine whether the element is a standard element (rectangle, circle, etc.). If the element is a standard element, it is enlarged in the horizontal and vertical directions in proportion to the enlarged size. If the element is not a standard graphic, the element is stretched by combining intelligent grid deformation with fixed boundaries to avoid image distortion. Finally, these elements are merged into layers to obtain a non-distorted bitmap image after stretching. If the final stretched bitmap image does not meet the stretching requirements, then this bitmap image will be used as a training data set and put into the second step of the image recognition model for subsequent training to improve the image recognition model.
[0106] In the above embodiment, through the above steps, it is not necessary to manually mark the stretchable area of each bitmap image, and it can be automatically identified according to the model. Since the stretched image is obtained by synthesizing the layer elements, the clarity of the stretched image can be guaranteed. If it is necessary to stretch the irregular image elements, the stretching can be done without deformation to the greatest extent, without affecting the final stretched display effect.
[0107] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0108] Based on the same inventive concept, the embodiment of the present application also provides a model training device for implementing the model training method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the training device for one or more stretched image labeling models provided below can refer to the limitations of the training method for the stretched image labeling model above, and will not be repeated here.
[0109] In an exemplary embodiment, Figure 8As shown, a model training device is provided, including: an acquisition module 801, a determination module 802, a marking module 803, a processing module 804 and a training module 805, wherein:
[0110] The acquisition module 801 is used to acquire a training image.
[0111] The determination module 802 is used to identify the border of the training image and determine the target border segment from the border.
[0112] The marking module 803 is used to obtain reference marking information of the training image based on the target frame segment, and the reference marking information is used to mark the stretchable area and the non-stretchable area of the training image.
[0113] The processing module 804 is used to obtain a target training set based on the training images and the corresponding reference marking information.
[0114] The training module 805 is used to input each training image in the target training set into the preset model, obtain the predicted labeling information corresponding to each training image, adjust the parameters of the preset model based on the predicted labeling information and the reference labeling information, until the training end condition is met, and obtain the stretched image labeling model.
[0115] In some embodiments, the marking module 803 is also used to: obtain a first frame segment and a second frame segment that match the position in the first direction from the target frame segment, use the first frame segment and the second frame segment as boundaries, determine the corresponding first direction rectangular area, and obtain the first direction stretchable area; obtain a third frame segment and a fourth frame segment that match the position in the second direction from the target frame segment, use the third frame segment and the fourth frame segment as boundaries, determine the corresponding second direction rectangular area, and obtain the second direction stretchable area; the first direction and the second direction are directions perpendicular to each other; and obtain reference marking information based on the first direction stretchable area and the second direction stretchable area.
[0116] In some embodiments, the marking module 803 is further used to: project the starting point of the first frame segment to the second frame segment to obtain a first projection point; project the terminal of the second frame segment to the first frame segment to obtain a second projection point; use the first projection point and the terminal of the second frame segment as the first boundary, use the second projection point and the terminal of the first frame segment as the second boundary, and determine the corresponding first-direction rectangular area based on the first boundary and the second boundary. Or project the starting point of the third frame segment to the fourth frame segment to obtain a third projection point; project the terminal of the fourth frame segment to the third frame segment to obtain a fourth projection point; use the third projection point and the terminal of the fourth frame segment as the third boundary, use the fourth projection point and the terminal of the third frame segment as the fourth boundary, and determine the corresponding second-direction rectangular area based on the third boundary and the fourth boundary.
[0117] In some embodiments, the processing module 804 is also used to: adjust the training image to obtain an adjusted image; obtain adjustment mark information based on the reference mark information of the adjusted image and the training image; determine the training image and the corresponding reference mark information, the adjusted image and the corresponding adjustment mark information as the target training set.
[0118] In some embodiments, the embodiments of the present application also include an application module, which is used to input the image to be stretched into the stretching image marking model, predict the marking information of the image to be stretched; determine the stretchable area and the non-stretchable area of the image to be stretched based on the marking information of the image to be stretched, the stretchable area includes a stretchable area in the first direction and a stretchable area in the second direction, and the non-stretchable area includes a non-stretchable area in the first direction and a non-stretchable area in the second direction; stretch the stretchable area in the first direction along the first direction to obtain the stretchable area in the first direction, splice the stretchable area in the first direction and the non-stretchable area in the first direction to obtain the stretchable image in the first direction; or stretch the stretchable area in the second direction The stretchable area is stretched along the second direction to obtain the second direction stretch area, and the second direction stretch area and the second direction non-stretch area are spliced to obtain a second direction stretch image; or the first direction stretchable area in the stretchable area is stretched along the first direction to obtain the first direction stretch area, and the first direction stretch area and the first direction non-stretch area are spliced to obtain a first direction stretch image; the second direction stretchable area in the first direction stretch image is stretched along the second direction to obtain the second direction stretch area, and the second direction stretch area and the second direction non-stretch area in the first direction stretch image are spliced to obtain the second direction stretch image.
[0119] Each module in the above-mentioned model training device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0120] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store training images and corresponding marking information. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a model training method is implemented.
[0121] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, a model training method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0122] Those skilled in the art will understand that Fig. 9 or Fig.10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0123] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0124] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0125] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0126] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0127] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0128] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0129] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A model training method, characterized in that: The method comprises: Get training images; Identifying a border of the training image and determining a target border segment from the border; Obtaining reference marking information of the training image based on the target frame segment, wherein the reference marking information is used to mark a stretchable area and a non-stretchable area of the training image; Obtaining a target training set based on the training images and corresponding reference marking information; Input each training image in the target training set into a preset model to obtain prediction labeling information corresponding to each training image, adjust the parameters of the preset model based on the prediction labeling information and the reference labeling information until the training end condition is met, and obtain a stretched image labeling model.
2. The method according to claim 1, characterized in that The obtaining the reference marking information of the training image based on the target frame segment includes: From the target frame segment, obtain a first frame segment and a second frame segment that match positions in the first direction, use the first frame segment and the second frame segment as boundaries, determine a corresponding first-direction rectangular area, and obtain a first-direction stretchable area; From the target frame segment, a third frame segment and a fourth frame segment with matching positions are obtained in the second direction, and the third frame segment and the fourth frame segment are used as boundaries to determine a corresponding rectangular area in the second direction, so as to obtain a stretchable area in the second direction; the first direction and the second direction are perpendicular to each other; The reference mark information is obtained based on the first-direction stretchable area and the second-direction stretchable area.
3. The method according to claim 2, characterized in that The step of acquiring the first frame segment and the second frame segment that match positions in the first direction, and determining the corresponding first direction rectangular area using the first frame segment and the second frame segment as boundaries, includes: Projecting the starting point of the first frame segment onto the second frame segment to obtain a first projection point; Projecting the terminal end of the second frame segment onto the first frame segment to obtain a second projection point; The first projection point and the end point of the second frame segment are taken as the first boundary, the second projection point and the end point of the first frame segment are taken as the second boundary, and the corresponding first-direction rectangular area is determined based on the first boundary and the second boundary; The step of acquiring the third frame segment and the fourth frame segment whose positions match each other in the second direction, and determining the corresponding rectangular area in the second direction by taking the third frame segment and the fourth frame segment as boundaries, includes: Projecting the starting point of the third frame segment onto the fourth frame segment to obtain a third projection point; Projecting the terminal end of the fourth frame segment onto the third frame segment to obtain a fourth projection point; The third projection point and the end point of the fourth frame segment are taken as the third boundary, the fourth projection point and the end point of the third frame segment are taken as the fourth boundary, and the corresponding second direction rectangular area is determined based on the third boundary and the fourth boundary.
4. The method according to claim 1, characterized in that: The obtaining of a target training set based on the training image and the corresponding reference marker information comprises: Adjusting the training image to obtain an adjusted image; Obtaining adjustment mark information based on the adjustment image and the reference mark information of the training image; The training image and the corresponding reference mark information, the adjustment image and the corresponding adjustment mark information are determined as the target training set.
5. The method according to claim 1, characterized in that After obtaining the stretched image marking model, the method includes: Inputting the image to be stretched into the stretched image marking model to obtain marking information of the image to be stretched; Determine a stretchable area and a non-stretchable area of the image to be stretched based on the marking information of the image to be stretched, wherein the stretchable area includes a stretchable area in a first direction and a stretchable area in a second direction, and the non-stretchable area includes a non-stretchable area in the first direction and a non-stretchable area in the second direction; Processing the first-direction stretchable area based on the first stretching operation information to obtain a corresponding first-direction stretching area, and splicing the first-direction stretching area with the first-direction non-stretching area to obtain a first-direction stretching picture; and / or The second-direction stretchable area is processed based on the second stretching operation information to obtain a corresponding second-direction stretching area, and the second-direction stretching area and the second-direction non-stretchable area are spliced to obtain a second-direction stretching image.
6. The method according to claim 5, characterized in that There is a target element in the first-direction stretchable area, and the processing of the first-direction stretchable area based on the first stretching operation information to obtain a corresponding first-direction stretchable area includes: Obtaining element information of the target element; updating the element information based on the first stretching operation information to obtain updated element information of the target element; The first-direction stretching area is obtained based on the updated element information of the target element.
7. A model training device, characterized in that: The device comprises: An acquisition module, used for acquiring training images; A determination module, configured to identify a border of the training image and determine a target border segment from the border; a marking module, configured to obtain reference marking information of the training image based on the target frame segment, wherein the reference marking information is used to mark a stretchable area and a non-stretchable area of the training image; A processing module, configured to obtain a target training set based on the training image and corresponding reference marking information; The training module is used to input each training image in the target training set into a preset model to obtain the predicted labeling information corresponding to each training image, and adjust the parameters of the preset model based on the predicted labeling information and the reference labeling information until the training end condition is met to obtain a stretched image labeling model.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.