Cutout model training method, image cutout processing method, device and medium
By training the multi-subject dataset for the image cutout model and generating a priori images in combination with the image segmentation model, the problem of accurate cutout of multi-subject targets in the prior art is solved, and higher cutout accuracy and user-friendliness are achieved.
Patent Information
- Application Number
- CN202410476312.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2044-04-19
AI Technical Summary
Existing image cutting methods cannot accurately cut multiple subject targets, and users need to have professional image editing skills and spend a lot of time marking.
By inputting the sample image into the portrait and object cutout model, the corresponding cutout mask is generated, and the tags containing both portrait and object are obtained through operation are obtained, and the target cutout model is trained. At the same time, the image segmentation model is used to segment the marking information, generate a priori image of the background area, and input the cutout model to obtain more accurate cutout results.
It realizes more accurate cutout results for portraits and objects in multi-subject scenes, reducing user operation difficulty and time consumption, and improving the accuracy and user experience of cutouts.
Smart Images

Figure CN118379321B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing, and in particular to a cutout model training method, an image cutout processing method, a device and a medium. Background Art
[0002] Traditional cutout models are often based on a single type of target subject, such as a cutout model for a portrait or a cutout model for a car. In modern, more complex shooting scenes, this type of single type of cutout model can no longer meet user needs.
[0003] In order to solve the problem that traditional cutout models can only cut out a single type of target subject, in existing image cutout technologies, a common method is to require users to mark the foreground and background of the image themselves. This method requires users to have professional image editing skills and takes a lot of time and effort to accurately mark the required areas. Summary of the invention
[0004] The technical problem to be solved by the present disclosure is to overcome the defect that the existing image cutout method cannot accurately cut out multi-subject targets, and to provide a cutout model training method, an image cutout processing method, a device and a medium.
[0005] The present invention solves the above technical problems through the following technical solutions:
[0006] The present disclosure provides a training method for a cutout model, the training method comprising:
[0007] Input the sample image into the portrait cutout model and the object cutout model respectively to obtain a corresponding first image and a second image, wherein the first image is a cutout mask containing the portrait, and the second image is a cutout mask containing the object;
[0008] Performing an AND operation on the first image and the second image to obtain a label corresponding to the sample image, wherein the label is a cutout mask containing both a portrait and an object;
[0009] The target cutout model is trained using the sample image and the label corresponding to the sample image.
[0010] Optionally, the target cutout model includes a feature extraction layer for extracting features representing portraits and objects, and the training method further includes the following steps: maintaining parameters of the feature extraction layer unchanged during the training process.
[0011] The present disclosure also provides an image cutout processing method, the processing method comprising:
[0012] Acquire an original image and marking information, where the marking information is used to indicate a target subject in the original image;
[0013] Inputting the original image and the marking information into an image segmentation model to segment the target subject in the original image to obtain a segmentation result;
[0014] The original image and a priori image corresponding to the background area in the original image are input into a cutout model to obtain a cutout result corresponding to the target subject; wherein the priori image is obtained according to the segmentation result.
[0015] Optionally, the processing method further includes: performing vector encoding processing on the label before inputting the label information into the image segmentation model.
[0016] Optionally, the cutout model used in the image cutout processing method is trained by any of the cutout model training methods described above.
[0017] The present disclosure also provides a training device for a cutout model, the training device comprising:
[0018] A cutout mask generation module, which inputs the sample image into the portrait cutout model and the object cutout model respectively to obtain a corresponding first image and a second image, wherein the first image is a cutout mask containing the portrait, and the second image is a cutout mask containing the object;
[0019] a label generation module, configured to perform an AND operation on the first image and the second image to obtain a label corresponding to the sample image, wherein the label is a cutout mask containing both a portrait and an object;
[0020] The training module trains the target cutout model using the sample image and the label corresponding to the sample image.
[0021] The present disclosure also provides an image cutout processing device, the processing device comprising:
[0022] An acquisition module, which acquires an original image and marking information, wherein the marking information is used to indicate a target subject in the original image;
[0023] An image segmentation module, inputting the original image and the marking information into an image segmentation model to segment the target subject in the original image to obtain a segmentation result;
[0024] The cutout module inputs the original image and the prior image corresponding to the background area in the original image into the cutout model to obtain a cutout result corresponding to the target subject; wherein the prior image is obtained according to the segmentation result.
[0025] The present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and configured to run on the processor. When the processor executes the computer program, the training method of the above-mentioned matte extraction model or the image matte extraction processing method is implemented.
[0026] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the training method of the above-mentioned matte extraction model or the image matte extraction processing method is implemented.
[0027] The present disclosure also provides a computer program product, including a computer program. When the computer program is executed by a processor, the training method of the above-mentioned matte extraction model or the image matte extraction processing method is implemented.
[0028] On the basis of conforming to the common knowledge in the art, the above optional conditions can be combined arbitrarily to obtain various preferred examples of the present disclosure.
[0029] The positive and progressive effects of the present disclosure are as follows: By constructing a large number of multi-subject datasets that simultaneously contain human figures and objects with the sample images and the labels corresponding to the sample images to train the matte extraction model, the matte extraction model can obtain more accurate matte extraction results in the scenario of multi-subject matte extraction of human figures and objects.
[0030] The target subject corresponding to the marking information is segmented through an image segmentation model to obtain a segmentation result. A prior image corresponding to the background area in the original image is generated according to the segmentation result. The original image and the generated prior image are input into the matte extraction model to obtain the matte extraction result corresponding to the target subject. Since the prior image can play a role in prompting the target to be matte-extracted during the matte extraction process, more accurate matte extraction results can be obtained, providing a better user experience while improving the accuracy of matte extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic flowchart of the matte extraction model training method provided in Embodiment 1 of the present disclosure;
[0032] Figure 2 It is a schematic diagram of label generation in the matte extraction model training method provided in Embodiment 1 of the present disclosure;
[0033] Figure 3 It is a structural block diagram of the matte extraction model training device provided in Embodiment 1 of the present disclosure;
[0034] Figure 4 It is a schematic flowchart of the image matte extraction processing method provided in Embodiment 2 of the present disclosure;
[0035] Figure 5 It is a schematic diagram of segmentation mask generation in the image matte extraction processing method provided in Embodiment 2 of the present disclosure;
[0036] Figure 6 A schematic diagram of generating a cutout result in the image cutout processing method provided in Embodiment 2 of the present disclosure;
[0037] Figure 7 A structural block diagram of an image cutout processing device provided in Embodiment 2 of the present disclosure;
[0038] Figure 8 This is a structural block diagram of an electronic device provided in Example 3 of the present disclosure. DETAILED DESCRIPTION
[0039] The present disclosure is further described below by way of examples, but the present disclosure is not limited to the scope of the examples.
[0040] Example 1
[0041] Figure 1 A flowchart of a method for training a cutout model provided by an exemplary embodiment of the present disclosure. Figure 1 , the training method of the cutout model includes:
[0042] S11. Input the sample image into a portrait cutout model and an object cutout model respectively to obtain a first image and a second image, wherein the first image is a cutout mask containing a portrait, and the second image is a cutout mask containing an object.
[0043] Among them, the portrait cutout model refers to a cutout model that focuses more on portrait-related details and is used to cut out portraits in sample images. The object cutout model refers to a cutout model that focuses more on a variety of different types of objects and is used to cut out objects in sample images.
[0044] S12. Perform an AND operation on the first image and the second image to obtain a label corresponding to the sample image, where the label is a cutout mask that includes both a portrait and an object.
[0045] like Figure 2 As shown, for the sample image P s , respectively use the portrait cutout model and the object cutout model to perform cutout processing to obtain a first image and a second image, where the first image is a cutout mask P containing only the portrait pb , the second image is the cutout mask P containing only the object mb , in the cutout mask P pb The portrait area is filled with white, and the other areas are filled with black. mb In the image, the object area is filled with white, and other areas are filled with black. pb and a cutout mask P containing only the object mbPerform a binary AND operation to obtain a cutout mask P that contains both the portrait and the object. fb , in the cutout mask P fb The portrait and object areas are filled with white, and the other areas are filled with black. fb Used as sample image P s .
[0046] S13, using sample images and labels corresponding to the sample images to train the target cutout model. s And the sample image corresponding label P fb The image pair P data , P data Used as the data set required for the cutout model training, the data set P data Input into the cutout model for training.
[0047] In an optional embodiment, the cutout model includes a feature extraction layer, a computing layer and an output layer. The feature extraction layer is used to extract features that characterize people and objects in the image, the computing layer is used to encode and decode the feature data, and the output layer is used to output the cutout result.
[0048] In this implementation, the above step S13 specifically includes: maintaining the parameters of the above feature extraction layer without any change during the training process, and continuously adjusting and updating the parameters of other layers during the training process.
[0049] In this implementation, by fixing the parameters of the feature extraction layer, the training speed of the cutout model can be accelerated and computing resources can be saved.
[0050] In an optional embodiment, step S13 specifically includes: during the image cutout model training process, when the output image cutout result and the input label P fb When the Euclidean distance between them is less than a set threshold, the training is terminated to obtain a trained and updated cutout model. The set threshold can be set according to actual conditions.
[0051] In this embodiment, a large number of multi-subject data sets containing both portraits and objects are constructed through sample images and labels corresponding to the sample images to train the cutout model, so that the cutout model can obtain more accurate cutout results in scenarios of multi-subject cutouts such as portraits and objects.
[0052] Figure 3 A schematic diagram of a module of a training device for a cutout model provided by an exemplary embodiment of the present disclosure, the device comprising a cutout mask generation module 11, a label generation module 12 and a training model 13:
[0053] The cutout mask generation module 11 inputs the sample image into the portrait cutout model and the object cutout model respectively to obtain a first image and a second image, wherein the first image is a cutout mask containing a portrait, and the second image is a cutout mask containing an object, wherein the portrait cutout model refers to a cutout model that focuses more on portrait-related details and is used to cut out the portrait in the sample image, and the object cutout model refers to a cutout model that focuses more on a variety of different types of objects and is used to cut out the objects in the sample image. For the sample image P s , respectively use the portrait cutout model and the object cutout model to perform cutout processing to obtain a first image and a second image, where the first image is a cutout mask P containing only the portrait pb , the second image is the cutout mask P containing only the object mb , in the cutout mask P pb The portrait area is filled with white, and the other areas are filled with black. mb In the image, the object area is filled with white and other areas are filled with black.
[0054] The label generation module 12 performs an AND operation on the first image and the second image to obtain a label corresponding to the sample image, wherein the label is a cutout mask containing both a portrait and an object.
[0055] The training module 13 uses the sample images and the labels corresponding to the sample images to train the target cutout model, and generates a batch of samples containing the sample images P s And the sample image corresponding label P fb The image composed of P data , P data Used as the data set required for the cutout model training, the data set P data Input into the cutout model for training.
[0056] In an optional embodiment, the label generation module 12 generates a cutout mask P containing only a human portrait. pb and a cutout mask P containing only the object mb Perform a binary AND operation to obtain a cutout mask P that contains both the portrait and the object. fb , in the cutout mask P fb The portrait and object areas are filled with white, and the other areas are filled with black. fb Used as sample image P s .
[0057] In an optional embodiment, the cutout model in the training module 13 includes a feature extraction layer, a computing layer and an output layer. The feature extraction layer is used to extract features that represent people and objects in the image, the computing layer is used to encode and decode the feature data, and the output layer is used to output the cutout result.
[0058] In another embodiment, the parameters of the feature extraction layer of the training module 13 do not change during the model training process, and the parameters of other layers are continuously adjusted and updated during the training process.
[0059] By fixing the parameters of the feature extraction layer, the training speed of the cutout model is accelerated and computing resources are saved.
[0060] In another optional embodiment, the training module 13 is specifically used for, during the matting model training process, when the output matting result and the input sample image P s The corresponding cutout mask P fb When the Euclidean distance between them is less than the set threshold, the training process is terminated to obtain the trained and updated cutout model.
[0061] The disclosed embodiment trains the cutout model by constructing a large number of multi-subject data sets containing portraits and objects, and fixes the parameters of the feature extraction layer during the training process, thereby improving the training speed of the model and saving computing resources, so that the cutout model can obtain more accurate cutout results in the multi-subject cutout scenario.
[0062] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only illustrative, wherein the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution.
[0063] Example 2
[0064] Figure 4 The present invention provides a flowchart of an image cutout processing method according to an exemplary embodiment of the present invention.
[0065] Reference Figure 4 , the image cutout processing method comprises:
[0066] S21. Obtain the original image and the marking information, where the marking information is used to indicate the target subject in the original image. The marking information supports any form, which can be text input or coordinate value input. For example, for the marking information of text input, Sign∈(1,t), where t represents the length of the text. Since the marking information may contain multiple subjects that need to be segmented, it is more accurately expressed as Sign∈(1,(t1,t2,…)), where t1,t2 represent the text description of each subject.
[0067] S22: Input the original image and the marking information into the image segmentation model to segment the target subject in the original image and obtain a segmentation result.
[0068] S23, inputting the original image and the prior image corresponding to the background area in the original image into the cutout model to obtain the cutout result corresponding to the target subject; the target subject area corresponding to the marking information in the segmentation result is filled with white, and the other areas are filled with black, and the segmentation mask P is generated. M , the generated segmentation mask P M As a priori image, it is used to give the cutout model hints about the target subject position and the relationship between the target subject that needs to be preserved.
[0069] In an optional implementation, step S22 specifically includes: performing vector encoding processing on the label information before inputting the label information into the image segmentation model.
[0070] like Figure 5 As shown in FIG. 1 , in a specific example, if the tag information is text, then for the tag information Sign of the text input, it is first necessary to vectorize it so that the image segmentation model can understand the text input. The traditional bag-of-words model can be used to vectorize the tag information Sign to obtain S, S∈(1,(t1,t2,…)). The length of the vectorized code obtained by the bag-of-words model is the same as the length of the original Sign. The original image P and the tag information S after vector encoding are input into the image segmentation model to obtain the segmentation result. The target subject area P in the segmentation result is f Filled with white, background mask P b Filled with black, the segmentation mask P is obtained M , where the target subject P f Refers to the area corresponding to the mark information Sign, the background mask P b Refers to other areas.
[0071] like Figure 6 As shown, the original image P and the prior image corresponding to the background area in the original image are input into the cutout model to obtain the cutout result corresponding to the target subject. The prior image is Figure 5 The segmentation mask generated in is used to prompt the cutout model about the target subject position and the relationship between the target subject that needs to be retained, so that a more accurate cutout result can be obtained.
[0072] In an optional implementation, the cutout model used in the image cutout processing method is the cutout model obtained by the training method in Example 1.
[0073] The target subject corresponding to the marking information is segmented by an image segmentation model to obtain a segmentation result, and a prior image corresponding to the background area in the original image is generated according to the segmentation result. The original image and the generated prior image are input into the cutout model to obtain the cutout result corresponding to the target subject. Since the prior image can serve as a prompt for the target to be cutout during the cutout process, a more accurate cutout result can be obtained, which improves the accuracy of cutouts and provides users with a better user experience.
[0074] Figure 7 This is a module schematic diagram of an image cutout processing device provided by an exemplary embodiment of the present disclosure, the device comprises an acquisition module 21, an image segmentation module 22 and a cutout module 23;
[0075] The acquisition module 21 is used to acquire the original image and the marking information, wherein the marking information is used to indicate the target subject in the original image, wherein the marking information supports any form, and may be text input or coordinate value input. For example, for the marking information of the text input, Sign∈(1,t), where t represents the length of the text, since the marking information may contain multiple subjects that need to be segmented, a more accurate expression is Sign∈(1,(t1,t2,…)), where t1,t2 represent the text description of each subject.
[0076] The image segmentation module 22 inputs the original image and the marking information into an image segmentation model to segment the target subject in the original image to obtain a segmentation result.
[0077] The cutout module 23 inputs the original image and the prior image corresponding to the background area in the original image into the cutout model to obtain a cutout result corresponding to the target subject; wherein the prior image is obtained according to the segmentation result, the target subject area corresponding to the marking information in the segmentation result is filled with white, and other areas are filled with black, and a segmentation mask is generated. The generated segmentation mask is used as a prior image to prompt the cutout model of the target subject position and the relationship between the target subject that need to be retained.
[0078] In an optional implementation, the image segmentation module 22 performs vector encoding on the tag information before inputting it into the image segmentation model. In a specific example, if the tag information is text, then the tag information Sign of the text input needs to be vector encoded first so that the image segmentation model can understand the text input. The traditional bag-of-words model can be used to vector encode the tag information Sign to obtain S, S∈(1,(t1,t2,…)). The length of the vectorized code obtained by the bag-of-words model is the same as the length of the original Sign. The original image P and the tag information S after vector encoding are input into the image segmentation model to obtain the segmentation result. The target subject area P in the segmentation result f Filled with white, background mask P b Filled with black, the segmentation mask P is obtained M , where the target subject P f Refers to the area corresponding to the mark information Sign, the background mask P b Refers to other areas.
[0079] The original image P and the prior image corresponding to the background area in the original image are input into the cutout model to obtain the cutout result corresponding to the target subject. The prior image is the segmentation mask P generated above. M , which is used to prompt the cutout model about the target subject position and the relationship between the target subject that needs to be retained, so that a more accurate cutout result can be obtained.
[0080] In an optional implementation, the cutout model used in the cutout module 23 is the cutout model obtained by the training method in Example 1.
[0081] The target subject corresponding to the marking information is segmented by an image segmentation model to obtain a segmentation result, and a prior image corresponding to the background area in the original image is generated based on the segmentation result. The original image and the generated prior image are input into the cutout model to obtain the cutout result corresponding to the target subject. Since the prior image can prompt the cutout model with the target subject position and the relationship between the target subject that need to be retained, a more accurate cutout result can be obtained, which improves the accuracy of cutouts and provides users with a better user experience.
[0082] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only illustrative, wherein the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution.
[0083] Example 3
[0084] Figure 8 A structural schematic diagram of an electronic device provided for implementation 3 of the present disclosure, the electronic device includes a memory, a processor, and a computer program stored in the memory and used to run on the processor, and the processor implements the training method of the cutout model of Example 1 or the image cutout processing method of Example 2 when executing the computer program. Figure 8 The electronic device 90 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0085] like Figure 8 As shown, the electronic device 90 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 90 may include, but are not limited to: at least one processor 91, at least one memory 92, and a bus 93 connecting different system components (including the memory 92 and the processor 91).
[0086] The bus 93 includes a data bus, an address bus, and a control bus.
[0087] The memory 92 may include a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a read-only memory (ROM) 923 .
[0088] The memory 92 may also include a program tool 925 (or utility) having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0089] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the cutout model training method of embodiment 1 of the present disclosure or the image cutout processing method of embodiment 2.
[0090] The electronic device 90 may also communicate with one or more external devices 94 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 95. Furthermore, the electronic device 90 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 96. Figure 8 As shown, the network adapter 96 communicates with other modules of the electronic device 90 via the bus 93. It should be understood that although Figure 8 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.
[0091] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0092] Example 4
[0093] The embodiments of the present disclosure also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the cutout model training method of the above-mentioned embodiment 1 or the image cutout processing method of embodiment 2.
[0094] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.
[0095] Example 5
[0096] The embodiments of the present disclosure also provide a computer program product, including a computer program, which, when executed by a processor, implements the cutout model training method of the above-mentioned embodiment 1 or the image cutout processing method of embodiment 2.
[0097] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.
[0098] Although the specific embodiments of the present disclosure are described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. An image cutout processing method, characterized in that: The processing method comprises: Acquire an original image and marking information, where the marking information is used to indicate a target subject in the original image; Inputting the original image and the marking information into an image segmentation model to segment the target subject in the original image to obtain a segmentation result; The original image and a priori image corresponding to the background area in the original image are input into a cutout model to obtain a cutout result corresponding to the target subject; wherein the priori image is obtained according to the segmentation result, specifically, the priori image is a segmentation mask generated by filling the target subject area corresponding to the marking information in the segmentation result with white and other areas with black; the cutout model is trained based on the sample image, the portrait cutout model and the object cutout model; The method for generating the cutout model comprises: Input the sample image into the portrait cutout model and the object cutout model respectively to obtain a corresponding first image and a second image, wherein the first image is a cutout mask containing the portrait, and the second image is a cutout mask containing the object; Performing an AND operation on the first image and the second image to obtain a label corresponding to the sample image, wherein the label is a cutout mask containing both a portrait and an object; The target cutout model is trained using the sample images and labels corresponding to the sample images.
2. The processing method according to claim 1, characterized in that: The target cutout model includes a feature extraction layer for extracting features representing portraits and objects. The method for generating the cutout model also includes the following steps: maintaining the parameters of the feature extraction layer unchanged during the training process.
3. The processing method according to claim 1, characterized in that: The processing method further includes: performing vector encoding processing on the tag information before inputting the tag information into the image segmentation model.
4. A device for processing image cutout, characterized in that: The processing device comprises: An acquisition module, used to acquire an original image and marking information, wherein the marking information is used to indicate a target subject in the original image; An image segmentation module, used for inputting the original image and the marking information into an image segmentation model to segment the target subject in the original image and obtain a segmentation result; A cutout module is used to input the original image and a priori image corresponding to the background area in the original image into a cutout model to obtain a cutout result corresponding to the target subject; wherein the priori image is obtained according to the segmentation result, specifically, the priori image is a segmentation mask generated by filling the target subject area corresponding to the marking information in the segmentation result with white and other areas with black; the cutout model is trained based on the sample image, the portrait cutout model and the object cutout model; The training device of the cutout model comprises: A cutout mask generation module, used to input the sample image into the portrait cutout model and the object cutout model respectively, to obtain a first image and a second image, wherein the first image is a cutout mask containing the portrait, and the second image is a cutout mask containing the object; A label generation module, used for performing an AND operation on the first image and the second image to obtain a label corresponding to the sample image, wherein the label is a cutout mask containing both a portrait and an object; The training module is used to train the target cutout model using the sample images and the labels corresponding to the sample images.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, characterized in that: When the processor executes the computer program, the image cutout processing method according to any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image cutout processing method according to any one of claims 1 to 3 is implemented.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image cutout processing method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Medical image segmentation method and device, storage medium and electronic equipment
CN116862931A