Product image production method, device, storage medium and equipment
By identifying the main body of the product and combining it with a transparent background, and selecting the appropriate background and synthesis method according to the type of product, the problem of inappropriate style of product images in the existing technology is solved, the aesthetics and user appeal of the product images are improved, and the The merchant’s traffic conversion rate.
Patent Information
- Application Number
- CN202411081890.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-08-07
AI Technical Summary
The existing product image production methods cannot adapt to the product styles of different industries, resulting in insufficient image aesthetics and user appeal, which in turn affects the traffic conversion rate of merchants.
By obtaining the product image for pre-processing, the product body is identified and synthesized with a transparent background. The appropriate background and synthesis method are selected according to the product type, and the image is synthesized to ensure that the final product image has a consistent style and improves the aesthetics and image quality.
It realizes the production of product pictures with consistent style, improves the aesthetics and image quality of product pictures, increases user attraction, and improves the traffic conversion rate of merchants.
Smart Images

Figure CN118608649B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, storage medium and equipment for producing a product image. Background Art
[0002] With the continuous development of computer technology, the online market has gradually encroached on the offline market. More and more merchants have opened online services and displayed the products of their stores to users through online platforms to attract users. The images displayed on the online platform are product images. Most of the existing product images are in the e-commerce style and cannot adapt to the product styles of other industries. Summary of the invention
[0003] The present application provides a method, device, storage medium and equipment for producing a product image. The method can provide merchants with product images of a consistent style, improve the aesthetics of the product images, and further attract users to improve the merchant's traffic conversion rate. The technical solution of the method is as follows:
[0004] A first aspect of an embodiment of the present application provides a method for producing a product image, comprising:
[0005] Acquire a first product image, and preprocess the first product image to obtain a preprocessed second product image, where the second product image is an image including a product body and a transparent background;
[0006] Based on the target commodity type of the commodity subject, determine the target background type corresponding to the target commodity type;
[0007] Filtering a target background whose background type is a target background type from multiple preset backgrounds;
[0008] Based on the mapping relationship between the background type and the image synthesis method, determine the target synthesis method corresponding to the target background type;
[0009] The second product image and the target background are synthesized according to the target synthesis method to obtain a prepared product image.
[0010] A second aspect of an embodiment of the present application provides a device for producing a product image, including:
[0011] A processing unit, configured to obtain a first product image, preprocess the first product image, and obtain a preprocessed second product image, where the second product image is an image including a product body and a transparent background;
[0012] A first determining unit, configured to determine a target background type corresponding to the target commodity type based on the target commodity type of the commodity subject;
[0013] A background screening unit, used for screening out a target background whose background type is a target background type from a plurality of preset backgrounds;
[0014] A second determining unit, configured to determine a target synthesis mode corresponding to a target background type based on a mapping relationship between background types and image synthesis modes;
[0015] The synthesis unit is used to synthesize the second product image and the target background according to the target synthesis method to obtain the prepared product image.
[0016] A third aspect of the embodiments of the present application provides a computer device, including a processor, a memory, and an input and output interface;
[0017] The processor is connected to the memory and the input and output interface respectively, wherein the input and output interface is used for page interaction, the memory is used for storing program codes, and the processor is used for calling the program codes to execute the above method steps.
[0018] A fourth aspect of an embodiment of the present application provides a computer storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the above-mentioned method steps are executed.
[0019] In the embodiment of the present application, by obtaining a first product image, the first product image is preprocessed to obtain a second product image including a product body and a transparent background, and according to the target product type of the product body, the corresponding target background type is determined, and the target background corresponding to the target background type is selected from the preset backgrounds. According to the mapping relationship between the background type and the image synthesis method, the target synthesis method corresponding to the target background type is determined, and the second product image and the target background are synthesized according to the target synthesis method to obtain a prepared product image. By selecting the corresponding background type according to the product type, the style of the final product image is guaranteed to be consistent, which improves the aesthetics and image quality of the product image. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art 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 drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 This is a system architecture diagram of a commodity image production system provided in an embodiment of the present application;
[0022] Figure 2 It is a flowchart of a method for producing a product image provided in an embodiment of the present application;
[0023] Figure 3 It is a flowchart of a method for producing a product image provided in an embodiment of the present application;
[0024] Figure 4 It is a flowchart of a method for producing a product image provided in an embodiment of the present application;
[0025] Figure 5 It is a flowchart of a method for producing a product image provided in an embodiment of the present application;
[0026] Figure 6 It is a flowchart of a method for producing a product image provided in an embodiment of the present application;
[0027] Figure 7 It is a flowchart of a method for generating a preset background provided in an embodiment of the present application;
[0028] Figure 8 It is a structural schematic diagram of a commodity image making device provided in an embodiment of the present application;
[0029] Fig. 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] In the description of the embodiments of the present application, unless otherwise specified, " / " means or. For example, A / B can mean A or B. The "and / or" in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" refers to two or more than two.
[0032] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0033] See also Figure 1 , Figure 1 1 is a system architecture diagram of a commodity image production system provided in an embodiment of the present application. Figure 1As shown, the system may include at least one computer device 1000, at least one electronic device 2000, at least one database 3000, and a network 4000. The computer device 1000 held by the user can be connected to the electronic device 2000 through the network 4000. The electronic device 2000 is any device with computing hardware that can support and execute software products corresponding to the production of commodity images. The computer device 1000 has one or more multi-touch screens for sensing and obtaining the input of the user through the touch or sliding operation performed at multiple points of one or more touch-sensitive display screens. In addition, when the system includes multiple computer devices 1000, multiple electronic devices 2000, and multiple networks 4000, different computer devices 1000 can be connected to different electronic devices 2000 through different networks 4000. The network 4000 can be a wireless network or a wired network, such as a wireless network such as a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. In addition, different computer devices 1000 can also use their own Bluetooth network or hotspot network to connect to other terminals or electronic devices 2000, etc. In addition, the system may include multiple databases 3000, multiple databases 3000 are coupled to different electronic devices 2000, and preset backgrounds can be stored in the databases 3000.
[0034] It should be noted that Figure 1 The system architecture diagram of the product image production system shown is only an example. The product image production system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0035] The commodity image production method and commodity image production device provided in the embodiment of the present application can be applied to the scene where the staff of the commodity image production application produces commodity images for merchants on the online platform. The commodity image production application is an application software that provides a background template for the commodity image and synthesizes the commodity image and the background. The online platform is an application platform where merchants provide online services to customers. The commodity image production application is connected to the online platform and can obtain the merchant store and the first commodity image from the online platform. Taking the takeaway platform as an example, when the merchant submits an application to enter the takeaway platform, the staff of the commodity image production application receives the application submitted by the merchant, obtains the first commodity image from the commodity library of the merchant store through the commodity image production application, and produces the first commodity image into a commodity image with the same style. The commodity image production device may include but is not limited to electronic devices with image editing functions such as mobile phones, personal computers, and laptops.
[0036] based on Figure 1 The system architecture diagram shown below will be combined with Figure 2-Figure 7 , the product image production method provided in the embodiment of the present application is introduced in detail.
[0037] See also Figure 2 , which is a flow chart of a method for producing a product image according to an embodiment of the present application. Figure 2 As shown, the method in the embodiment of the present application may include the following steps S101-S105.
[0038] S101, obtaining a first product image, preprocessing the first product image, and obtaining a preprocessed second product image, where the second product image is an image including a product body and a transparent background;
[0039] Specifically, an online store opening application submitted by a merchant is received, a store is selected, and a first product image is obtained from the product library of the merchant's store. The first product image is an image uploaded by the merchant containing the product body. The first product image is preprocessed to obtain a preprocessed second product image. The second product image is an image containing the product body and a transparent background. The preprocessing includes extension processing and cutout processing. The product body of the first product image is identified. If the product body is incomplete, the product body is extended to obtain a third product image. The third product image is an image containing the complete product body.
[0040] S102, based on the target commodity type of the commodity subject, determining the target background type corresponding to the target commodity type;
[0041] Specifically, based on the target commodity type of the commodity body, the target background type corresponding to the target commodity type is determined. The target commodity types include but are not limited to beverages, Chinese dishes, Western dishes and desserts, and the target background types are the first type and the second type, wherein the first type is the type of preset background generated based on the background generation model, the background generation model is an AI raw image model based on artificial intelligence technology (AI), and the preset background of the first type is a real scene background including a table and other physical objects; the second type is the type of preset background generated based on the self-developed raw image engine, the self-developed raw image engine is a program component that provides the preset background of the second type, and the preset background of the second type is a colorful and bright visual background. It should be noted that the background of the second type includes but is not limited to multiple layers such as background layer, text layer, commodity body layer, etc., wherein the text layer may include multiple layers such as activity interest points, main title and subtitle, the activity interest point may be the preferential activities that the commodity participates in, the main title may be the type of commodity, and the subtitle may be the commodity name.
[0042] S103, selecting a target background whose background type is a target background type from a plurality of preset backgrounds;
[0043] Specifically, a plurality of preset backgrounds are provided to the user, and the user selects a target background corresponding to a target background type matching the target commodity type from the plurality of preset backgrounds.
[0044] Taking drinks and Chinese dishes as examples, drinks are refreshing, so choose colorful and bright visual backgrounds to set off the drinks and create a contrasting color effect to attract customers and increase their purchasing desire. Chinese dishes have a long history, so choose real-life backgrounds including tables to better set off the elegance and solemnity of Chinese dishes. Choose a suitable background based on the product type to enhance the aesthetics of the image.
[0045] S104, determining a target synthesis method corresponding to the target background type based on a mapping relationship between the background type and the image synthesis method;
[0046] Specifically, the target synthesis method of the second product image and the target background is determined based on the target background type. When the target background type is the first type, the first type is a real scene background, corresponding to the first synthesis method, the first synthesis method is a synthesis method based on an image synthesis model, and the image synthesis model is an AI synthesis model based on artificial intelligence technology, which synthesizes the first type of preset background with the second product image; when the target background type is the second type, the second type is a visual background, corresponding to the second synthesis method, the second synthesis method can be synthesized based on a self-developed synthesis engine, which is a program component that synthesizes the second type of preset background with the second product image.
[0047] S105 , synthesizing the second product image and the target background according to a target synthesis method to obtain a prepared product image.
[0048] Specifically, according to the target synthesis method, the second product image and the target background are synthesized in the corresponding image synthesis model or the self-developed synthesis engine to obtain the produced product image.
[0049] In the embodiment of the present application, by obtaining the first product image, the first product image is preprocessed to obtain the second product image including the product body and the transparent background, according to the target product type of the product body, the corresponding target background type is determined, the target background corresponding to the target background type is selected from the preset backgrounds, according to the mapping relationship between the background type and the image synthesis method, the target synthesis method corresponding to the target background type is determined, and the second product image and the target background are synthesized according to the target synthesis method to obtain the prepared product image. By selecting the corresponding background type according to the product type, the style of the final product image is guaranteed to be consistent, the aesthetics and image quality of the product image are improved, thereby attracting users and improving the traffic conversion rate of the merchant.
[0050] See also Figure 3, which is a flow chart of a method for producing a product image according to an embodiment of the present application. Figure 3 As shown, the method of the embodiment of the present application may include the following steps S201-S208.
[0051] S201, obtaining a first product image, and identifying a product subject in the first product image;
[0052] Specifically, an online store opening application submitted by a merchant is received, a store is selected, and a first product picture is obtained from the product library of the merchant's store. The first product picture is an image containing a product body uploaded by the merchant. The product body of the first product picture is identified based on image recognition technology. Image recognition technology is a method of analyzing, processing, understanding and identifying images through computer vision and machine learning technology.
[0053] In a feasible implementation, image recognition can be performed based on a convolutional neural network (CNN), the first product image is input into an image recognition model based on a CNN network, the first product image is divided into multiple parts through the image recognition model, and features are preliminarily extracted through the convolution layer of the CNN network, that is, the features of each part of the first product image are extracted through the convolution layer, and the most useful image information in the first product image, that is, the main features of the first product image, is retained through the pooling layer, and then the features extracted by the convolution layer and the pooling layer are summarized by a fully connected layer to generate a classifier, and the extracted features are predicted and recognized, that is, the product body of the first product image is recognized.
[0054] S202, if it is identified that the commodity body is incomplete, then the commodity body is extended to obtain a third commodity image including the complete commodity body;
[0055] Specifically, the commodity body is identified through image recognition technology. If it is identified that the commodity body is incomplete, the commodity body is extended, that is, the missing parts of the commodity body are repaired and supplemented to obtain a third commodity image containing the complete commodity body. If the commodity body is identified as a complete commodity body, there is no need to extend the image, and the first commodity image is used as the third commodity image.
[0056] Among them, the extension processing of the main body of the product is based on visual extension (Outpainting) technology. First, a preliminary Outpainting is done using the Resolution-robust Large Mask Inpaintingwith Fourier Convolutions (LaMa) algorithm based on Fourier convolution. Then, the output result of the LaMa algorithm is used to extend it using the Outpainting of the image restoration model. The LaMa algorithm improves the image restoration efficiency and quality.
[0057] Taking Chinese dishes as an example, the main products in the first product image are dishes and plates for serving dishes. When the plate for serving dishes shown in the first product image is incomplete, the missing parts of the plate are repaired and supplemented to obtain a third product image containing the complete plate and dishes.
[0058] S203, performing a cutout process on the third product image to obtain a second product image;
[0059] Specifically, the third product image is subjected to a cutout processing, wherein the cutout is to extract a foreground target from the image, filter out the background part, separate the product body as the foreground part from the third product image, and synthesize the separated product body with the transparent background to obtain a transparent base image, wherein the transparent base image is an image containing a complete product body and a transparent background. The transparent base image and the first product image are input into an image segmentation model to obtain a cutout quality score output by the image segmentation model. If the cutout quality score reaches a preset quality score, the transparent base image is determined as the second product image. For the transparent base image that does not reach the preset quality score, you can choose to manually adjust the cutout result, or you can choose a suitable image from the local image library to replace the transparent base image that does not reach the preset quality score.
[0060] Among them, the image segmentation model is a target detection model based on the CNN network. The image segmentation model is used to detect targets on the transparent background image, and then determine whether the cutout result is accurate and whether the edge is clear, and output the cutout quality score.
[0061] S204, based on the target commodity type of the commodity subject, determining the target background type corresponding to the target commodity type;
[0062] Specifically, based on the target commodity type of the commodity body, the target background type corresponding to the target commodity type is determined. The target commodity types include but are not limited to beverages, Chinese dishes, Western dishes and desserts, and the target background types are the first type and the second type, wherein the first type is the type of preset background generated based on the background generation model, the background generation model is an AI raw image model based on AI technology, and the preset background of the first type is a real scene background including physical objects such as tables; the second type is the type of preset background generated based on the self-developed raw image engine, the self-developed raw image engine is a program component that provides the second type of preset background, and the second type of preset background is a colorful and bright visual background. It should be noted that the second type of background includes but is not limited to multiple layers such as background layer, text layer, commodity body layer, etc., wherein the text layer may include multiple layers such as activity interest points, main title and subtitle, the activity interest point may be the preferential activities that the commodity participates in, the main title may be the type of commodity, and the subtitle may be the commodity name.
[0063] S205, selecting a target background whose background type is a target background type from a plurality of preset backgrounds;
[0064] Specifically, a plurality of preset backgrounds are provided to the user, and the user selects a target background corresponding to a target background type matching the target commodity type from the plurality of preset backgrounds.
[0065] Taking drinks and Chinese dishes as examples, drinks are refreshing, so choose colorful and bright visual backgrounds to set off the drinks and create a contrasting color effect to attract customers and increase their purchasing desire. Chinese dishes have a long history, so choose real-life backgrounds including tables to better set off the elegance and solemnity of Chinese dishes. Choose a suitable background based on the product type to enhance the aesthetics of the image.
[0066] S206, based on the mapping relationship between the background type and the image synthesis mode, determining a first synthesis mode corresponding to the first type as a target synthesis mode;
[0067] Specifically, the target synthesis method is determined based on the target background type. When the target background type is the first type, the first type is a real scene background, corresponding to the first synthesis method, and the first synthesis method is determined as the target synthesis method. The first synthesis method is a synthesis method based on an image synthesis model. The image synthesis model is an AI synthesis model based on artificial intelligence technology, which synthesizes the first type of preset background with the second product image.
[0068] S207, inputting the second product image and the target background into the image synthesis model according to the first synthesis method to obtain a prepared product image;
[0069] Specifically, based on the first synthesis method, the second product image and the first type of target background are input into the image synthesis model, and the image synthesis model is triggered to synthesize the second product image and the target background. During the synthesis, the display angle of the product body is adjusted so that the display angle of the product body is within the preset angle range, so that the product body in the product image and the target background are more coordinated, so that the dishes and the table are placed reasonably, and the dishes can be fully displayed to the user. After the display angle of the product body is adjusted, the light and shadow corresponding to the display angle change accordingly, and the product body is used as the foreground, and the target background is redrawn based on the foreground through the image synthesis model. The redrawing is based on the latent diffusion model (LDMs) in the image synthesis model, and the image area occupied by the product body in the target background is used as the first area, and the area outside the product body is used as the second area. Based on the pixels of the product body, noise coverage is added to the first area, and denoising and diffusion are performed on the second area. In the process of denoising and diffusion, the information of the product body is used to cover the area in the target background that does not need to be changed, so that the target background obtains light and shadow consistent with the product body, and a prepared product image is obtained.
[0070] S208, performing image quality inspection on the prepared product images, and synchronizing the product images that meet the quality inspection conditions into the product library.
[0071] Specifically, the produced product images may have problems such as dim lighting, low clarity, the product body being a copy or screenshot, black and white edges, and watermarks. Therefore, it is necessary to perform image quality inspection on the produced product images, and synchronize the product images that meet the quality inspection conditions to the merchant's product library and display them to users.
[0072] Among them, image quality detection is a detection technology based on CNN network, which divides the problems existing in product images into two categories: classification and target detection. For example, problems such as dim light, low clarity, and the main body of the product being copied or screenshots belong to classification problems, while black and white edges and watermarks belong to target detection problems. Different algorithm models are used to make judgments for classification problems and target detection problems.
[0073] In a feasible implementation, multiple first product images uploaded to the product library by multiple merchants can be processed in batches to improve the efficiency of product image production. Specifically, the task management module can be used to schedule what steps to execute in each stage. Through the asynchronous queue, a separate message queue listener is used to handle the specific logic of different steps. When the asynchronous queue executes multiple tasks, they can be executed simultaneously, and the multiple tasks are independent of each other, and there is no need to wait for the task to be completed.
[0074] In an embodiment of the present application, a first product image is obtained, the first product image is extended to obtain a third product image, the third product image is cut out to obtain a second product image including a product body and a transparent background, and the corresponding target background type is determined according to the target product type of the product body, and a target background corresponding to the target background type is selected from the preset backgrounds. When the target background type is the first type, the corresponding target synthesis method is determined to be the first synthesis method, and the second product image and the target background are synthesized according to the first synthesis method to obtain a produced product image. Image quality detection is performed on the produced product image, and the product image that meets the quality detection conditions is synchronized to the product library. By selecting the corresponding background type according to the product type, the style of the final product image is guaranteed to be consistent, which improves the aesthetics and image quality of the product image, thereby attracting users and improving the merchant's traffic conversion rate. When the product body is extended, the LaMa algorithm is used to improve the image repair efficiency and quality. When the third product image is cut out, the image segmentation model based on the CNN network is used to improve the accuracy and clarity of the cutout result. When synthesizing the second product image and the target background, the display angle of the product body is adjusted and the light and shadow of the target background and the product body are made consistent to improve the coordination of the product image. The target background is redrawn through the LDMs model to improve the efficiency of the algorithm. Finally, the image quality of the prepared product image is detected to further improve the aesthetics of the product image. The use of asynchronous queues can simultaneously process multiple first product images of multiple merchants, thereby improving the efficiency of product image production.
[0075] See also Figure 4 , which is a flow chart of a method for producing a product image according to an embodiment of the present application. Figure 4 As shown, the method of the embodiment of the present application may include the following steps S301-S312.
[0076] S301, obtaining a first product image, and identifying a product subject in the first product image;
[0077] For specific steps, please refer to S201 and will not be repeated here.
[0078] S302, if it is identified that the commodity body is incomplete, then the commodity body is extended to obtain a third commodity image including the complete commodity body;
[0079] For specific steps, please refer to S202 and will not be repeated here.
[0080] S303, performing cutout processing on the third product image to obtain a transparent base image, where the transparent base image includes a complete product body and a transparent background;
[0081] Specifically, the third product image is subjected to a cutout process, which involves extracting a foreground target from the image, filtering out the background, separating the product body as the foreground from the third product image, and synthesizing the separated product body with the transparent background to obtain a transparent base image, which is an image containing the complete product body and the transparent background.
[0082] S304, inputting the transparent base image and the first product image into an image segmentation model to obtain a cutout quality score of the transparent base image output by the image segmentation model;
[0083] The transparent base image and the first product image are input into the image segmentation model to obtain the cutout quality score output by the image segmentation model. The image segmentation model is a target detection model based on the CNN network. The image segmentation model is used to perform target detection on the transparent base image to determine whether the cutout result is accurate and whether the edge is clear, and then output the cutout quality score.
[0084] S305, if the cutout quality score reaches a preset quality score, determining the transparent base image as the second product image;
[0085] Specifically, if the cutout quality score reaches the preset quality score, the transparent base image will be determined as the second product image. For the transparent base image that does not reach the preset quality score, you can choose to manually adjust the cutout result, or you can choose a suitable image from the local image library to replace the transparent base image that does not reach the preset quality score.
[0086] S306, based on the target commodity type of the commodity subject, determining the target background type corresponding to the target commodity type;
[0087] For specific steps, please refer to S204, which will not be repeated here.
[0088] S307, selecting a target background whose background type is a target background type from a plurality of preset backgrounds;
[0089] For specific steps, please refer to S205, which will not be repeated here.
[0090] S308, based on the mapping relationship between the background type and the image synthesis mode, determining the first synthesis mode corresponding to the first type as the target synthesis mode;
[0091] For specific steps, please refer to S206, which will not be repeated here.
[0092] S309: input the second product image and the target background into the image synthesis model according to the first synthesis mode, trigger the image synthesis model to synthesize the second product image and the target background, and adjust the display angle of the product body so that the display angle of the product body is within a preset display angle range;
[0093] Specifically, based on the first synthesis method, the second product image and the first type of target background are input into the image synthesis model, which triggers the image synthesis model to synthesize the second product image and the target background. During synthesis, the display angle of the product body is adjusted to make the display angle of the product body within a preset angle range, thereby making the product body in the product image and the target background more coordinated. The preset angle range can be 45°. Taking Chinese dishes as an example, if the display angle of the dish in the first product image uploaded by the merchant is 90°, and the target background is a photographed physical table, the display angle of the dish needs to be adjusted to 45° so that the arrangement of the dish and the table is reasonable and the dish can be fully displayed to the user.
[0094] S310, taking the image area occupied by the main body of the product in the target background as the first area, and the area outside the main body of the product as the second area;
[0095] Specifically, after the display angle of the product body is adjusted, the light and shadow corresponding to the display angle changes accordingly. The product body is taken as the foreground, and the target background is redrawn based on the foreground through the image synthesis model. The redrawing is based on the LDMs model in the image synthesis model. The image area occupied by the product body in the target background is taken as the first area, and the area outside the product body is taken as the second area.
[0096] S311, adding noise to the first area based on the pixels of the main body of the product in the second product image, and performing denoising diffusion on the second area to obtain a prepared product image;
[0097] Specifically, based on the pixels of the main body of the product in the second product image, noise coverage is added to the first area, and denoising diffusion is performed on the second area. During the denoising diffusion process, the information of the main body of the product is used to cover the area of the target background that does not need to be changed, so that the target background obtains light and shadow consistent with the main body of the product, and a finished product image is obtained.
[0098] S312, performing image quality inspection on the prepared product images, and synchronizing the product images that meet the quality inspection conditions into the product library.
[0099] For specific steps, please refer to S208, which will not be repeated here.
[0100] In an embodiment of the present application, a first product image is obtained, the first product image is extended to obtain a third product image, the third product image is cut out to obtain a second product image including a product body and a transparent background, and the corresponding target background type is determined according to the target product type of the product body, and a target background corresponding to the target background type is selected from the preset backgrounds. When the target background type is the first type, the corresponding target synthesis method is determined to be the first synthesis method, and the second product image and the target background are synthesized according to the first synthesis method to obtain a produced product image. Image quality detection is performed on the produced product image, and the product image that meets the quality detection conditions is synchronized to the product library. By selecting the corresponding background type according to the product type, the style of the final product image is guaranteed to be consistent, which improves the aesthetics and image quality of the product image, thereby attracting users and improving the merchant's traffic conversion rate. When the product body is extended, the LaMa algorithm is used to improve the image repair efficiency and quality. When the third product image is cut out, the image segmentation model based on the CNN network is used to improve the accuracy and clarity of the cutout result. When synthesizing the second product image and the target background, the display angle of the product body is adjusted and the light and shadow of the target background and the product body are made consistent to improve the coordination of the product image. The target background is redrawn through the LDMs model to improve the efficiency of the algorithm. Finally, the image quality of the prepared product image is detected to further improve the aesthetics of the product image. The use of asynchronous queues can simultaneously process multiple first product images of multiple merchants, thereby improving the efficiency of product image production.
[0101] See also Figure 5 , which is a flow chart of a method for producing a product image according to an embodiment of the present application. Figure 5 As shown, the method of the embodiment of the present application may include the following steps S401-S408.
[0102] S401, obtaining a first product image, and identifying a product subject in the first product image;
[0103] For specific steps, please refer to S201 and will not be repeated here.
[0104] S402, if it is identified that the commodity body is incomplete, the commodity body is extended to obtain a third commodity image including the complete commodity body;
[0105] For specific steps, please refer to S202, which will not be repeated here.
[0106] S403, performing a cutout process on the third product image to obtain a second product image;
[0107] For specific steps, please refer to S203, which will not be repeated here.
[0108] S404, based on the target commodity type of the commodity subject, determining the target background type corresponding to the target commodity type;
[0109] For specific steps, please refer to S204, which will not be repeated here.
[0110] S405, selecting a target background whose background type is a target background type from a plurality of preset backgrounds;
[0111] For specific steps, please refer to S205, which will not be repeated here.
[0112] S406, based on the mapping relationship between the background type and the image synthesis mode, determining the second synthesis mode corresponding to the second type as the target synthesis mode;
[0113] Specifically, the target synthesis method is determined based on the target background type. When the target background type is the second type, the second type is a visual background, corresponding to the second synthesis method. The second synthesis method can be synthesized based on a self-developed synthesis engine. The self-developed synthesis engine is a program component that synthesizes the second type of preset background with the second product image.
[0114] S407, according to the second synthesis method, replacing the image corresponding to the layer where the main body of the product in the target background is located with the second product image, changing the text content in the layer where the text in the target background is located, and obtaining the prepared product image;
[0115] Specifically, based on the second synthesis method, the image corresponding to the layer where the product body is located in the second type of target background is replaced with the second product image, and the text content in the text layer in the second type of target background is replaced with text related to the second product image to obtain the produced product image.
[0116] In a feasible implementation, the product color value of the product body of the second product image in the second type of target background and the background color value of the target background are obtained to determine whether the color difference between the product color value and the background color value reaches a preset color difference value; if the preset color difference value is reached, the background color value is adjusted to a color close to the product color value based on color mapping technology to enhance the aesthetics of the product image and provide users with better visual effects.
[0117] S408, performing image quality inspection on the prepared product images, and synchronizing the product images that meet the quality inspection conditions into the product library.
[0118] For specific steps, please refer to S208, which will not be repeated here.
[0119] In an embodiment of the present application, a first product image is obtained, an extension process is performed on the first product image to obtain a third product image, and a cutout process is performed on the third product image to obtain a second product image including a product body and a transparent background. According to the target product type of the product body, a corresponding target background type is determined, and a target background corresponding to the target background type is selected from the preset backgrounds. When the target background type is the second type, the corresponding target synthesis method is determined to be the second synthesis method. According to the second synthesis method, the image corresponding to the layer where the product body is located in the target background is replaced with the second product image, and the text content in the layer where the text is located in the target background is changed to obtain a produced product image. Image quality detection is performed on the produced product image, and the product image that meets the quality detection conditions is synchronized to the product library. By selecting the corresponding background type according to the product type, the style of the final product image is guaranteed to be consistent, which improves the aesthetics and image quality of the product image, thereby attracting users and improving the merchant's traffic conversion rate. When the product body is extended, the LaMa algorithm is used to improve the image repair efficiency and quality. When the third product image is cut out, the image segmentation model based on the CNN network is used to improve the accuracy and clarity of the cutout result. By replacing the images of each layer of the target background and changing the background color value through color mapping technology, the efficiency of image synthesis is improved and the sense of series of the product image is guaranteed. Finally, the image quality of the produced product image is detected to further improve the aesthetics of the product image. The use of asynchronous queues can simultaneously process multiple first product images of multiple merchants, thereby improving the efficiency of product image production.
[0120] See also Figure 6 , which is a flow chart of a method for producing a product image according to an embodiment of the present application. Figure 6 As shown, the method of the embodiment of the present application may include the following steps S501-S514.
[0121] S501, obtaining a first product image, and identifying a product subject in the first product image;
[0122] For specific steps, please refer to S201 and will not be repeated here.
[0123] S502, if it is identified that the commodity body is incomplete, the commodity body is extended to obtain a third commodity image including the complete commodity body;
[0124] For specific steps, please refer to S202 and will not be repeated here.
[0125] S503, performing a cutout process on the third product image to obtain a transparent base image, where the transparent base image includes a complete product body and a transparent background;
[0126] For specific steps, please refer to S303, which will not be described again here.
[0127] S504, inputting the transparent base image and the first product image into an image segmentation model to obtain a cutout quality score of the transparent base image output by the image segmentation model;
[0128] Please refer to S304 for the specific steps, which will not be described again here.
[0129] S505, if the cutout quality score reaches a preset quality score, determining the transparent base image as the second product image;
[0130] For specific steps, please refer to S305, which will not be described again here.
[0131] S506, based on the target commodity type of the commodity subject, determining the target background type corresponding to the target commodity type;
[0132] For specific steps, please refer to S204, which will not be repeated here.
[0133] S507, selecting a target background whose background type is a target background type from a plurality of preset backgrounds;
[0134] For specific steps, please refer to S205, which will not be repeated here.
[0135] S508, based on the mapping relationship between the background type and the image synthesis mode, determining the second synthesis mode corresponding to the second type as the target synthesis mode;
[0136] For specific steps, please refer to S406, which will not be described again here.
[0137] S509, according to the second synthesis method, replace the image corresponding to the layer where the main body of the product in the target background is located with the second product image;
[0138] Specifically, based on the second synthesis method, the image corresponding to the layer where the main body of the product is located in the second type of target background is replaced with the second product image.
[0139] S510, obtaining a product color value of a product body of a second product image in a target background, and a background color value of the target background;
[0140] Specifically, the product color value of the product body of the second product image in the second type of target background and the background color value of the target background are obtained.
[0141] S511, determining whether the color difference between the product color value and the background color value reaches a preset color difference value;
[0142] It should be noted that when the color difference between the product color value and the background color value is large, it may reduce the aesthetics of the product image and fail to better set off the product. Therefore, the color difference value is set in advance to determine whether the color difference between the product color value and the background color value reaches the preset color difference value.
[0143] S512, if the color difference between the product color value and the background color value reaches a preset color difference value, adjusting the background color value of the target background according to the product color value;
[0144] Specifically, if the color difference between the product color value and the background color value reaches a preset color difference value, the background color value is adjusted to a color close to the product color value based on color mapping technology to improve the aesthetics of the product image and provide users with better visual effects.
[0145] S513, changing the text content in the layer where the text in the target background is located to obtain a prepared product image;
[0146] Specifically, the text content in the text layer in the second type of target background is replaced with text related to the second product image to obtain the prepared product image.
[0147] Taking the "Jasmine Green Tea" drink as an example, replace the image corresponding to the layer where the main body of the product is located in the target background with the second product image including the packaged "Jasmine Green Tea", and change the text of the layer where the activity interest point is located in the target background to the store activities that "Jasmine Green Tea" is currently participating in. If it is not currently participating in any store activities, delete the layer where the activity interest point is located, change the text of the layer where the main title is located to the type "Tea Drink" to which "Jasmine Green Tea" belongs, and change the text of the layer where the subtitle is located to "Jasmine Green Tea".
[0148] S514, performing image quality inspection on the prepared product images, and synchronizing the product images that meet the quality inspection conditions into the product library.
[0149] For specific steps, please refer to S208, which will not be repeated here.
[0150] In an embodiment of the present application, a first product image is obtained, an extension process is performed on the first product image to obtain a third product image, and a cutout process is performed on the third product image to obtain a second product image including a product body and a transparent background. According to the target product type of the product body, a corresponding target background type is determined, and a target background corresponding to the target background type is selected from the preset backgrounds. When the target background type is the second type, the corresponding target synthesis method is determined to be the second synthesis method. According to the second synthesis method, the image corresponding to the layer where the product body is located in the target background is replaced with the second product image, and the text content in the layer where the text is located in the target background is changed to obtain a produced product image. Image quality detection is performed on the produced product image, and the product image that meets the quality detection conditions is synchronized to the product library. By selecting the corresponding background type according to the product type, the style of the final product image is guaranteed to be consistent, which improves the aesthetics and image quality of the product image, thereby attracting users and improving the merchant's traffic conversion rate. When the product body is extended, the LaMa algorithm is used to improve the image repair efficiency and quality. When the third product image is cut out, the image segmentation model based on the CNN network is used to improve the accuracy and clarity of the cutout result. By replacing the images of each layer of the target background and changing the background color value through color mapping technology, the efficiency of image synthesis is improved and the sense of series of the product image is guaranteed. Finally, the image quality of the produced product image is detected to further improve the aesthetics of the product image. The use of asynchronous queues can simultaneously process multiple first product images of multiple merchants, thereby improving the efficiency of product image production.
[0151] See also Figure 7 , which is a flow chart of a method for generating a preset background according to an embodiment of the present application. Figure 7 As shown, the method of the embodiment of the present application may include the following steps S601-S604.
[0152] S601, obtaining text information and multiple seed values;
[0153] Specifically, when generating the first type of preset background, based on the required preset background, text information describing the preset background, ie, prompt, and multiple seed values, ie, seed parameters, are obtained.
[0154] Among them, prompt is the text or instruction that is input into the background generation model to guide it to generate specific outputs. The seed parameter is the number of the image in the background generation model, which is used to balance the controllability and creativity of the image. The background generation model is an AI image generation model based on AI technology. By combining prompt with different seed parameters, similar backgrounds with consistent styles can be generated, which improves the output stability of the background generation model and ensures the series sense of the product images.
[0155] S602, locking the text information, and sequentially inputting the text information into a background generation model in combination with a plurality of different seed values to obtain a plurality of first candidate backgrounds;
[0156] Specifically, the prompt is kept unchanged, the seed parameter is changed, and the prompt combined with different seed parameters is input into the background generation model to obtain multiple first candidate backgrounds.
[0157] S603, if there is a background that meets the reference background condition among the multiple first candidate backgrounds, determine the background that meets the reference background condition as the reference background;
[0158] Specifically, if there is a background that meets the reference background condition in the first candidate backgrounds, the first candidate background is determined as the reference background; if there is no background that meets the reference background condition in the first candidate backgrounds, the prompt is continued to be used in combination with different seed parameters to generate the first candidate background.
[0159] S604: Input the reference background, text information and multiple different seed values into a background generation model to obtain multiple second candidate backgrounds, and determine the first candidate background and the second candidate background as the preset background.
[0160] Specifically, after determining the reference background, based on the prompt and seed parameters, add the reference background constraint condition, keep the prompt and the reference background unchanged, change the seed parameter, and input the prompt and the reference background into the background generation model in combination with different seed parameters to obtain multiple second candidate backgrounds, and determine the first candidate background and the second candidate background as the preset background. The background type of the preset background is the first type, and the first type of preset background is a real scene background including real objects such as tables.
[0161] In an embodiment of the present application, when generating a first type of preset background, a background generation model is used to combine prompt and different seed parameters to generate a first candidate background with a sense of series. In the case of a reference background, a second candidate background with a sense of series is generated by combining the prompt and the reference background, as well as different seed parameters. Both the first candidate background and the second candidate background are determined as preset backgrounds, which improves the output stability of the background generation model and ensures the sense of series of the product images.
[0162] In a feasible implementation, when generating the second type of preset background, obtain the second type of preset background template, replace the image of each layer position in the preset background template, and obtain the second type of preset background. Among them, the preset background template is obtained from the self-developed raw image engine, which is a program component that provides the second type of preset background. The second type of preset background is a colorful and bright visual background. It should be noted that the second type of background includes but is not limited to multiple layers such as background layer, text layer, product body layer, etc., wherein the text layer may include multiple layers such as activity interest points, main title and subtitle. The activity interest point can be the preferential activities that the product participates in, the main title can be the type of product, and the subtitle can be the product name.
[0163] In an embodiment of the present application, by obtaining a second type of preset background template and replacing the images corresponding to each layer position in the preset background template, a second type of preset background is generated, thereby improving the stability of image output and ensuring a sense of series in the product images.
[0164] The following will be combined Figure 8 , the commodity image making device provided in the embodiment of the present application is introduced in detail. It should be noted that, Figure 8 The product image making device in the present application is used to execute Figure 2-Figure 7 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 2-Figure 7 The embodiment shown.
[0165] See also Figure 8 , is a schematic diagram of the structure of a device for producing a product image according to an embodiment of the present application. Figure 8 As shown, the product image production device 1 of the embodiment of the present application may include: a processing unit 11, a first determination unit 12, a background screening unit 13, a second determination unit 14 and a synthesis unit 15.
[0166] The processing unit 11 is used to obtain a first product image, pre-process the first product image, and obtain a pre-processed second product image, where the second product image is an image including a product body and a transparent background;
[0167] A first determining unit 12 is used to determine a target background type corresponding to the target commodity type based on the target commodity type of the commodity subject;
[0168] A background screening unit 13, used for screening a target background whose background type is a target background type from a plurality of preset backgrounds;
[0169] A second determining unit 14 is used to determine a target synthesis method corresponding to a target background type based on a mapping relationship between background types and image synthesis methods;
[0170] The synthesis unit 15 is used to synthesize the second product image and the target background according to the target synthesis method to obtain the prepared product image.
[0171] Optionally, the processing unit 11 is specifically configured to obtain a first product image and identify a product subject in the first product image;
[0172] If it is identified that the main body of the product is incomplete, the main body of the product is extended to obtain a third product image containing the complete main body of the product;
[0173] The third product image is cut out to obtain the second product image.
[0174] Optionally, the processing unit 11 is specifically configured to perform a cutout process on the third product image to obtain a transparent base image, wherein the transparent base image includes a complete product body and a transparent background;
[0175] Inputting the transparent base image and the first product image into the image segmentation model, and obtaining a cutout quality score of the transparent base image output by the image segmentation model;
[0176] If the cutout quality score reaches a preset quality score, the transparent base image is determined as the second product image.
[0177] Optionally, the product image making device 1 further includes: a first background generating unit 16 .
[0178] The first background generating unit 16 is specifically used to obtain text information and a plurality of seed values;
[0179] Locking the text information, and sequentially inputting the text information into a background generation model in combination with a plurality of different seed values to obtain a plurality of first candidate backgrounds;
[0180] If there is a background that meets the reference background condition among the multiple first candidate backgrounds, then the background that meets the reference background condition is determined as the reference background;
[0181] The reference background, text information and multiple different seed values are input into the background generation model to obtain multiple second candidate backgrounds, and the first candidate background and the second candidate background are determined as the preset background, and the background type of the preset background is the first type.
[0182] Optionally, the product image making device 1 further includes: a second background generating unit 17 .
[0183] The second background generating unit 17 is specifically used to obtain a preset background template, replace the image at each layer position in the preset background template, and obtain a preset background, wherein the background type of the preset background is the second type.
[0184] Optionally, when the target background type is the first type, the second determining unit 14 is specifically configured to determine, based on a mapping relationship between background types and image synthesis modes, a first synthesis mode corresponding to the first type as the target synthesis mode.
[0185] Optionally, when the target synthesis mode is the first synthesis mode, the synthesis unit 15 is specifically configured to input the second product image and the target background into the image synthesis model according to the first synthesis mode to obtain the prepared product image.
[0186] Optionally, the synthesis unit 15 is specifically used to input the second product image and the target background into the image synthesis model, trigger the image synthesis model to synthesize the second product image and the target background, and adjust the display angle of the product body so that the display angle of the product body is within a preset display angle range;
[0187] The image area occupied by the main body of the product in the target background is taken as the first area, and the area outside the main body of the product is taken as the second area;
[0188] Noise is added to the first region based on the pixels of the main body of the product in the second product image, and denoising and diffusion are performed on the second region to obtain a prepared product image.
[0189] Optionally, when the target background type is the second type, the second determining unit 14 is specifically configured to determine, based on a mapping relationship between background types and image synthesis modes, a second synthesis mode corresponding to the second type as the target synthesis mode.
[0190] Optionally, when the target synthesis method is the second synthesis method, the synthesis unit 15 is specifically used to replace the image corresponding to the layer where the product body in the target background is located with the second product image according to the second synthesis method, and change the text content in the layer where the text in the target background is located to obtain the produced product image.
[0191] Optionally, the synthesis unit 15 is further configured to obtain a product color value of a product body of the second product image in the target background, and a background color value of the target background;
[0192] Determine whether the color difference between the product color value and the background color value reaches a preset color difference value;
[0193] If the color difference between the product color value and the background color value reaches a preset color difference value, the background color value of the target background is adjusted according to the product color value, and the text content in the layer where the text in the target background is located is changed to obtain the step of producing the product image.
[0194] Optionally, the product image making device further includes: a quality detection unit 18.
[0195] The quality detection unit 18 is specifically used to perform image quality detection on the prepared commodity images, and synchronize the commodity images that meet the quality detection conditions into the commodity library.
[0196] In an embodiment of the present application, a first product image is obtained, the first product image is preprocessed to obtain a second product image including a product body and a transparent background, the corresponding target background type is determined according to the target product type of the product body, the target background corresponding to the target background type is selected from the preset backgrounds, the target synthesis method corresponding to the target background type is determined according to the mapping relationship between the background type and the image synthesis method, and the second product image and the target background are synthesized according to the target synthesis method to obtain a prepared product image. By selecting the corresponding background type according to the product type, the style of the final product image is guaranteed to be consistent, the aesthetics and image quality of the product image are improved, thereby attracting users and improving the merchant's traffic conversion rate. When the product body is extended, the LaMa algorithm is used to improve the image restoration efficiency and restoration quality. When the third product image is cut out, the image segmentation model based on the CNN network is used to improve the accuracy and clarity of the cutout result. When the target background type is the first type, when synthesizing the second product image and the target background, the coordination of the product image is improved by adjusting the display angle of the product body and making the light and shadow of the target background consistent with the product body, and the target background is redrawn through the LDMs model to improve the efficiency of the algorithm; when the target background type is the second type, the efficiency of image synthesis is improved by replacing the images of each layer of the target background and changing the background color value through color mapping technology, ensuring the series sense of the product image, and finally performing image quality detection on the prepared product image to further improve the aesthetics of the product image. When generating the first type of background template, the background generation model is used to combine text information and reference background, as well as different seed values, to improve the stability of the background generation model and ensure the series sense of the product image; when generating the second background, the background template is preset and the images of each layer are replaced to ensure the series sense of the product image.
[0197] See also Fig. 9 , which is a schematic diagram of the structure of a computer device according to an embodiment of the present application. Fig. 9As shown, the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, an input / output interface 1003, a memory 1005, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. Fig. 9 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, an input and output interface module, and a connection establishment application.
[0198] In one embodiment, the processor 1001 may be used to call a connection establishment application stored in the memory 1005, and specifically perform the following operations:
[0199] Acquire a first product image, and preprocess the first product image to obtain a preprocessed second product image, where the second product image is an image including a product body and a transparent background;
[0200] Based on the target commodity type of the commodity subject, determine the target background type corresponding to the target commodity type;
[0201] Filtering a target background whose background type is a target background type from multiple preset backgrounds;
[0202] Based on the mapping relationship between the background type and the image synthesis method, determine the target synthesis method corresponding to the target background type;
[0203] The second product image and the target background are synthesized according to the target synthesis method to obtain a prepared product image.
[0204] Optionally, when the processor 1001 executes the process of acquiring the first product image and preprocessing the first product image to obtain the preprocessed second product image, the processor 1001 specifically performs the following operations:
[0205] Obtaining a first product image, and identifying a product subject in the first product image;
[0206] If it is identified that the main body of the product is incomplete, the main body of the product is extended to obtain a third product image containing the complete main body of the product;
[0207] The third product image is cut out to obtain the second product image.
[0208] Optionally, when the processor 1001 performs the cutout processing on the third product image to obtain the second product image, the processor 1001 specifically performs the following operations:
[0209] The third product image is cut out to obtain a transparent base image, which includes a complete product body and a transparent background.
[0210] Inputting the transparent base image and the first product image into the image segmentation model, and obtaining a cutout quality score of the transparent base image output by the image segmentation model;
[0211] If the cutout quality score reaches a preset quality score, the transparent base image is determined as the second product image.
[0212] Optionally, before executing the target commodity type based on the commodity subject and determining the target background type corresponding to the target commodity type, the processor 1001 further performs the following operations:
[0213] Get text information and multiple seed values;
[0214] Locking the text information, and sequentially inputting the text information into a background generation model in combination with a plurality of different seed values to obtain a plurality of first candidate backgrounds;
[0215] If there is a background that meets the reference background condition among the multiple first candidate backgrounds, then the background that meets the reference background condition is determined as the reference background;
[0216] The reference background, text information and multiple different seed values are input into the background generation model to obtain multiple second candidate backgrounds, and the first candidate background and the second candidate background are determined as the preset background, and the background type of the preset background is the first type.
[0217] Optionally, before executing the target commodity type based on the commodity subject and determining the target background type corresponding to the target commodity type, the processor 1001 further performs the following operations:
[0218] The preset background template is obtained, and the images at each layer position in the preset background template are replaced to obtain the preset background, wherein the background type of the preset background is the second type.
[0219] Optionally, when the target background type is the first type, the processor 1001 performs the following operations specifically when determining the target synthesis mode corresponding to the target background type based on the mapping relationship between the background type and the image synthesis mode:
[0220] Based on the mapping relationship between the background type and the image synthesis mode, a first synthesis mode corresponding to the first type is determined as the target synthesis mode.
[0221] Optionally, when the target synthesis mode is the first synthesis mode, the processor 1001 performs the following operations specifically when synthesizing the second product image and the target background according to the target synthesis mode to obtain the prepared product image:
[0222] According to the first synthesis method, the second product image and the target background are input into the image synthesis model to obtain a prepared product image.
[0223] Optionally, when the processor 1001 inputs the second product image and the target background into the image synthesis model to obtain the prepared product image, the following operations are specifically performed:
[0224] Inputting the second product image and the target background into the image synthesis model, triggering the image synthesis model to synthesize the second product image and the target background, and adjusting the display angle of the product body so that the display angle of the product body is within a preset display angle range;
[0225] The image area occupied by the main body of the product in the target background is taken as the first area, and the area outside the main body of the product is taken as the second area;
[0226] Noise is added to the first region based on the pixels of the main body of the product in the second product image, and denoising and diffusion are performed on the second region to obtain a prepared product image.
[0227] Optionally, when the target background type is the second type, the processor 1001 performs the following operations specifically when determining the target synthesis mode corresponding to the target background type based on the mapping relationship between the background type and the image synthesis mode:
[0228] Based on the mapping relationship between the background type and the image synthesis mode, the second synthesis mode corresponding to the second type is determined as the target synthesis mode.
[0229] Optionally, when the target synthesis mode is the second synthesis mode, the processor 1001 performs the following operations specifically when synthesizing the second product image and the target background according to the target synthesis mode to obtain the prepared product image:
[0230] According to the second synthesis method, the image corresponding to the layer where the main body of the product in the target background is located is replaced with the second product image, and the text content in the layer where the text in the target background is located is changed to obtain the prepared product image.
[0231] Optionally, after replacing the layer where the main body of the product in the target background is located with the second product image, the processor 1001 further performs the following operations:
[0232] Obtain the product color value of the product body of the second product image in the target background, and the background color value of the target background;
[0233] Determine whether the color difference between the product color value and the background color value reaches a preset color difference value;
[0234] If the color difference between the product color value and the background color value reaches a preset color difference value, the background color value of the target background is adjusted according to the product color value, and the text content in the layer where the text in the target background is located is changed to obtain the step of producing the product image.
[0235] Optionally, after obtaining the prepared product map, the processor 1001 further performs the following operations:
[0236] Perform image quality inspection on the prepared product images, and synchronize the product images that meet the quality inspection conditions to the product library.
[0237] In an embodiment of the present application, a first product image is obtained, the first product image is preprocessed to obtain a second product image including a product body and a transparent background, the corresponding target background type is determined according to the target product type of the product body, the target background corresponding to the target background type is selected from the preset backgrounds, the target synthesis method corresponding to the target background type is determined according to the mapping relationship between the background type and the image synthesis method, and the second product image and the target background are synthesized according to the target synthesis method to obtain a prepared product image. By selecting the corresponding background type according to the product type, the style of the final product image is guaranteed to be consistent, the aesthetics and image quality of the product image are improved, thereby attracting users and improving the merchant's traffic conversion rate. When the product body is extended, the LaMa algorithm is used to improve the image restoration efficiency and restoration quality. When the third product image is cut out, the image segmentation model based on the CNN network is used to improve the accuracy and clarity of the cutout result. When the target background type is the first type, when synthesizing the second product image and the target background, the coordination of the product image is improved by adjusting the display angle of the product body and making the light and shadow of the target background consistent with the product body, and the target background is redrawn through the LDMs model to improve the efficiency of the algorithm; when the target background type is the second type, the efficiency of image synthesis is improved by replacing the images of each layer of the target background and changing the background color value through color mapping technology, ensuring the series sense of the product image, and finally performing image quality detection on the prepared product image to further improve the aesthetics of the product image. When generating the first type of background template, the background generation model is used to combine text information and reference background, as well as different seed values, to improve the stability of the background generation model and ensure the series sense of the product image; when generating the second background, the background template is preset and the images of each layer are replaced to ensure the series sense of the product image.
[0238] The present application also provides a computer storage medium that can store multiple program instructions, which are suitable for being loaded and executed by a processor as described above. Figure 2-Figure 7 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 2-Figure 7 The specific description of the illustrated embodiment will not be repeated here.
[0239] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0240] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for producing a product image, characterized in that: include: Acquire a first product image, and preprocess the first product image to obtain a preprocessed second product image, where the second product image is an image including a product body and a transparent background; Based on the target commodity type of the commodity subject, determining the target background type corresponding to the target commodity type; Filtering out a target background whose background type is the target background type from a plurality of preset backgrounds; If the target background type is the first type, determining that a first synthesis mode corresponding to the first type is a target synthesis mode, the first synthesis mode is a synthesis mode based on an image synthesis model; If the target background type is the second type, determining that the second synthesis method corresponding to the second type is the target synthesis method, the second synthesis method is a synthesis method based on the self-developed synthesis engine; Synthesize the second product image and the target background according to the target synthesis method to obtain a prepared product image; Wherein, before determining the target background type corresponding to the target product type based on the product subject, the method further includes: Get text information and multiple seed values; Locking the text information, and sequentially inputting the text information into a background generation model in combination with a plurality of different seed values to obtain a plurality of first candidate backgrounds; If there is a background that meets the reference background condition among the plurality of first candidate backgrounds, determining the background that meets the reference background condition as the reference background; Input the reference background, the text information and a plurality of different seed values into a background generation model to obtain a plurality of second candidate backgrounds, determine the first candidate background and the second candidate background as a preset background, and the background type of the preset background is a first type; A preset background template is obtained, and images at each layer position in the preset background template are replaced to obtain a preset background, wherein the background type of the preset background is the second type.
2. The method according to claim 1, characterized in that The acquiring the first product image and preprocessing the first product image to obtain the preprocessed second product image includes: Obtaining a first product image, and identifying a product subject in the first product image; If it is identified that the commodity body is incomplete, the commodity body is extended to obtain a third commodity image including the complete commodity body; The third product image is cut out to obtain a second product image.
3. The method according to claim 2, characterized in that The step of performing a cutout process on the third product image to obtain a second product image includes: Performing a cutout process on the third product image to obtain a transparent base image, wherein the transparent base image includes a complete product body and a transparent background; Inputting the transparent base image and the first product image into an image segmentation model to obtain a cutout quality score of the transparent base image output by the image segmentation model; If the cutout quality score reaches a preset quality score, the transparent base image is determined as the second product image.
4. The method according to claim 1, characterized in that: The synthesizing the second product image and the target background according to the target synthesis method to obtain the prepared product image includes: According to the first synthesis method, the second product image and the target background are input into the image synthesis model to obtain a prepared product image.
5. The method according to claim 4, characterized in that The step of inputting the second product image and the target background into an image synthesis model to obtain a prepared product image includes: Inputting the second product image and the target background into an image synthesis model, triggering the image synthesis model to synthesize the second product image and the target background, and adjusting the display angle of the product body so that the display angle of the product body is within a preset display angle range; The image area occupied by the main body of the commodity in the target background is taken as the first area, and the area outside the main body of the commodity is taken as the second area; Noise is added to the first region based on the pixels of the commodity body in the second commodity image, and denoising and diffusion are performed on the second region to obtain a prepared commodity image.
6. The method according to claim 1, characterized in that The synthesizing the second product image and the target background according to the target synthesis method to obtain the prepared product image includes: According to the second synthesis method, the image corresponding to the layer where the main body of the product in the target background is located is replaced with the second product image, and the text content in the layer where the text in the target background is located is changed to obtain the prepared product image.
7. The method according to claim 6, characterized in that After replacing the layer where the main body of the commodity in the target background is located with the second commodity image, the method further includes: Acquire a product color value of the product body of the second product image in the target background, and a background color value of the target background; Determine whether a color difference between the product color value and the background color value reaches a preset color difference value; If the color difference between the product color value and the background color value reaches a preset color difference value, the background color value of the target background is adjusted according to the product color value, and the text content in the layer where the text in the target background is located is changed to obtain the prepared product image.
8. The method according to claim 1, characterized in that: After obtaining the prepared product map, the method further includes: Perform image quality inspection on the prepared product images, and synchronize product images that meet quality inspection conditions into the product library.
9. A device for producing a product image, characterized in that: include: a processing unit, configured to obtain a first product image, preprocess the first product image, and obtain a preprocessed second product image, wherein the second product image is an image including a product body and a transparent background; A first determining unit, configured to determine, based on a target commodity type of the commodity subject, a target background type corresponding to the target commodity type; A background screening unit, used for screening out a target background whose background type is the target background type from a plurality of preset backgrounds; A second determining unit is configured to determine, if the target background type is a first type, a first synthesis mode corresponding to the first type as a target synthesis mode, wherein the first synthesis mode is a synthesis mode based on an image synthesis model; If the target background type is the second type, determining that the second synthesis method corresponding to the second type is the target synthesis method, the second synthesis method is a synthesis method based on the self-developed synthesis engine; A synthesis unit, configured to synthesize the second product image and the target background according to the target synthesis method to obtain a prepared product image; Wherein, before determining the target background type corresponding to the target product type based on the product subject, the method further includes: Get text information and multiple seed values; Locking the text information, and sequentially inputting the text information into a background generation model in combination with a plurality of different seed values to obtain a plurality of first candidate backgrounds; If there is a background that meets the reference background condition among the plurality of first candidate backgrounds, determining the background that meets the reference background condition as the reference background; Input the reference background, the text information and a plurality of different seed values into a background generation model to obtain a plurality of second candidate backgrounds, determine the first candidate background and the second candidate background as a preset background, and the background type of the preset background is a first type; A preset background template is obtained, and images at each layer position in the preset background template are replaced to obtain a preset background, wherein the background type of the preset background is the second type.
10. A computer device, characterized in that: Includes processor, memory, input and output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used for page interaction, the memory is used for storing program code, and the processor is used for calling the program code to execute the method according to any one of claims 1-8.
11. A computer storage medium, characterized in that: The computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method according to any one of claims 1 to 8 is executed.
