Image processing method and apparatus, device and storage medium

By obtaining the target identification and inputting it with the original image into the pre-trained image stylization model, the problem of single stylization features on the client is solved, the diversity and distinction of stylized images are improved, and the user experience is improved.

WO2024193489A1PCT designated stage expired Publication Date: 2024-09-26BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Application Number
PCT/CN2024/082106
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-17
Filing Date
2024-03-18
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

The stylization features of existing clients are relatively single, resulting in small differences in style experience between users and similar stylization results, which affects the user experience.

Method used

By obtaining the target identifier and inputting the original image and the target identifier into the pre-trained image stylization model, a variety of stylized images are generated, and a variety of sample data are used to train the model to increase the difference between different styles.

Benefits of technology

It improves the diversity of generated stylized images, increases the difference between different styles, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024082106_26092024_PF_FP
    Figure CN2024082106_26092024_PF_FP
Patent Text Reader

Abstract

Disclosed in the present disclosure are an image processing method and apparatus, a device and a storage medium. The method comprises: when a user obtains a stylized image by using the method, a target identifier can be simultaneously obtained, wherein the target identifier may be used for indicating the stylization type of a raw image, thus a target stylized image corresponding to the target identifier can be obtained after the raw image and the target identifier are inputted into an image stylization model.
Need to check novelty before this filing date? Find Prior Art

Description

Image processing method, device, equipment and storage medium

[0001] This application claims priority to Chinese Patent Application No. 202310263887.2 filed on March 17, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field

[0002] The present disclosure relates to an image processing method, apparatus, device and storage medium. Background Art

[0003] Currently, users can achieve image stylization through the client's stylization function. That is, through the client's stylization software, using the images taken by the camera, stylized effects such as anime style, film and television drama style, etc. can be achieved.

[0004] However, the current client's stylization features are relatively simple, resulting in little difference in style experience between users. The stylization results are relatively similar and have little distinction, which affects the user experience.

[0005] Summary of the Invention

[0006] In view of this, the present disclosure provides an image processing method, apparatus, device, and storage medium to increase the diversity of stylized images generated by a model, thereby improving the user experience.

[0007] To achieve the above objectives, the technical solutions provided by this disclosure are as follows:

[0008] In a first aspect of the present disclosure, there is provided an image processing method, the method comprising:

[0009] Get the original image;

[0010] Obtaining a target identifier, where the target identifier is used to indicate a stylized type of the original image;

[0011] The original image and the target identifier are input into an image stylization model to obtain a target stylized image.

[0012] In a second aspect of the present disclosure, an image processing apparatus is provided, the apparatus comprising:

[0013] A first acquisition unit, configured to acquire an original image;

[0014] a second acquiring unit, configured to acquire a target identifier, wherein the target identifier is used to indicate a stylized type of the original image;

[0015] The third acquisition unit is configured to input the original image and the target identifier into an image stylization model to acquire a target stylized image.

[0016] In a third aspect of the present disclosure, an electronic device is provided, the device comprising: a processor and a memory;

[0017] The memory is used to store instructions or computer programs;

[0018] The processor is configured to execute the instructions or computer program in the memory so that the electronic device executes the method described in the first aspect above.

[0019] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a device, the device executes the method described in the first aspect above.

[0020] In a fifth aspect of the present disclosure, a computer program product is provided, wherein the computer program product comprises a computer program / instructions, and when the computer program / instructions are executed by a processor, the method described in the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments recorded in the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0022] FIG1 is a flow chart of an image processing method provided by an embodiment of the present disclosure;

[0023] FIG2 is a flow chart of a method for training an image generation model provided by an embodiment of the present disclosure;

[0024] FIG3 is a schematic diagram of a stylized image provided by an embodiment of the present disclosure;

[0025] FIG4 is a schematic diagram of an image processing device provided by an embodiment of the present disclosure; and

[0026] FIG5 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] To help those skilled in the art better understand the present disclosure, the following will provide a clear and complete description of the technical solutions in the embodiments of the present disclosure, in conjunction with the accompanying drawings. It should be understood that the described embodiments are only a portion of the embodiments of the present disclosure, not all of them. All other embodiments derived by persons skilled in the art based on the embodiments of the present disclosure without inventive effort are intended to fall within the scope of protection of the present disclosure.

[0028] It is understood that before using the technical solutions disclosed in each embodiment of the present disclosure, the user should be informed of the type, scope of use, and usage scenarios of the personal information involved in the present disclosure and obtain the user's authorization in an appropriate manner in accordance with relevant laws and regulations. For example, in response to receiving an active request from the user, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information, so that the user can independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operation of the technical solution of the present disclosure based on the prompt message.

[0029] As an optional but non-limiting implementation, in response to receiving a user's active request, a prompt message may be sent to the user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. Furthermore, the pop-up window may also include a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0030] It is understood that images generated by the methods provided in various embodiments of the present disclosure should be processed in accordance with relevant laws and regulations. For example, technical measures may be taken in accordance with regulations to add a logo that does not affect user use, or prominent logos may be placed in reasonable locations and areas in accordance with regulations to inform the public of deep compositing.

[0031] It is understandable that the above notification and user authorization process, as well as image processing, are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0032] Currently, users can use the client's stylization function to stylize images, such as anime style, film and television drama style, etc. However, the current client's stylization features are relatively simple, resulting in little differentiation in style experience between users and relatively similar stylization results, which affects the user experience.

[0033] Based on this, the embodiments of the present disclosure provide an image processing method to improve the diversity of generated stylized images and improve the user experience. In specific implementation, in order to improve the diversity of generated stylized images, the model can be pre-trained using sample data with more features to obtain a trained image stylization model. When the user obtains a stylized image using the image stylization model, a target identifier can be obtained, which can be used to indicate the stylization type of the original image. After the original image and the target identifier are input into the image stylization model, the target stylized image corresponding to the target identifier can be obtained. Through the method provided by the embodiments of the present disclosure, the model can be trained with samples of different styles to improve the diversity of stylized images generated by the model, and the difference between different styles can also be increased to improve the user experience.

[0034] To facilitate understanding of the technical method provided by the embodiments of the present disclosure, the technical solution provided by the embodiments of the present disclosure will be introduced below with reference to the accompanying drawings.

[0035] Refer to FIG1 , which is a flow chart of an image generation method provided by an embodiment of the present disclosure.

[0036] The method can be applied to a client and includes the following steps:

[0037] S101: Acquire an original image.

[0038] In order to obtain a stylized image of the original image, the client can collect the original image based on the camera. Optionally, the original image can be a real facial image captured in real time, or a captured picture of the facial image.

[0039] S102: Obtain a target identifier, where the target identifier is used to indicate a stylized type of the original image.

[0040] In this embodiment, different stylized images generated by the client have different identifiers. Different target identifiers can be input on the client to obtain images of corresponding stylized types.

[0041] Alternatively, the target identifier can be obtained by presetting certain conditions on the client side. The corresponding target identifier can be determined when the conditions are met. Specifically, after acquiring the original image, the client side can analyze the target object in the original image to determine the conditions met by the target object, thereby determining the target identifier corresponding to the conditions. These conditions can include facial features of varying characteristics, key point data, and so on.

[0042] Furthermore, the client can pre-set various identifiers within the stylized image software's display interface, with each identifier corresponding to a specific type of stylized image. In response to a user selecting an identifier, the target identifier is retrieved. Specifically, the user can select an identifier within the display interface to enter the corresponding stylized image interface, thereby retrieving the stylized image corresponding to the selected identifier. Alternatively, after retrieving the target stylized image within the stylized image interface, the user can switch between different identifiers by switching between stylized image interfaces, thereby retrieving a different target stylized image.

[0043] S103: Input the original image and the target identifier into the image stylization model to obtain a target stylized image.

[0044] After the client obtains the original image and target identifier, it can input them into the image stylization model to generate the corresponding target stylized image. The image stylization model is pre-trained. To facilitate understanding of the principles of stylized image generation, the following describes the training process of the image stylization model.

[0045] See Figure 2, which is a flowchart of a training method for an image generation model provided in an embodiment of the present disclosure.

[0046] The method may be executed by a server, for example, by a processing device of the server. The method may include the following steps:

[0047] S201: Acquire multiple groups of image pairs, where the image pairs include reference images and stylized images.

[0048] To enable the image stylization model to generate a wider variety of stylized images, we can obtain a wider variety of sample data and use this data to train the initial image generation model. This sample data consists of multiple image pairs, each of which includes a reference image and a stylized image. Each pair has a corresponding identifier that distinguishes the style type of each pair.

[0049] Optionally, multiple sets of image pairs can be obtained in the following manner: first, a stylized image set is obtained, wherein the stylized image set includes multiple stylized images. For example, the stylized image can be anime-styled images, such as character images from anime such as "Detective Conan," "Slam Dunk," and "Naruto," or stylized images from film and television dramas such as "The Return of the Condor Heroes" and "Journey to the West." In this embodiment, stylized image types that meet the effect definition can be pre-set to obtain a stylized image set. For example, it can be set to only obtain stylized images that meet the anime style as samples. The stylized image set is then clustered to obtain multiple subcategory image sets. By classifying the first stylized image set, the distinction and difference between stylized images of different categories can be improved, thereby enhancing the quality of the stylized images of each subcategory.

[0050] After obtaining multiple subcategory image sets through clustering, multiple identifiers corresponding to the multiple subcategory image sets can be determined, wherein the multiple subcategory image sets correspond one-to-one to the multiple identifiers. That is, each subcategory image set uniquely corresponds to an identifier, and the identifier can be used to distinguish different types of stylized images. It should be noted that the specific method of setting the identifier is not limited in this embodiment. For example, numbers such as "a, b, c" can be used to distinguish image pairs of different categories. Alternatively, for any category of image pairs, the pixel values ​​of each stylized image included in the category can be normalized, and the value obtained after normalization is used as the identifier corresponding to the category image pair. The value range of the identifier is [0,1].

[0051] Using the multiple subcategory image sets, subcategory stylized images corresponding to the reference images are obtained, thereby forming a set of image pairs consisting of the reference images and the corresponding subcategory stylized images. This can be achieved specifically by: for any subcategory image set from the multiple subcategory image sets, an initial generator is trained using the subcategory image set to obtain a trained first generator. The subcategory image sets correspond one-to-one to the first generators. That is, a generator is trained for each subcategory image set, thereby obtaining multiple generators corresponding to the multiple subcategory image sets. For any first generator, multiple reference images are input into the first generator to obtain multiple corresponding stylized images, i.e., the multiple reference images correspond one-to-one to the multiple stylized images. For any reference image from the multiple reference images, the reference image and the stylized image corresponding to the reference image are formed into an image pair. The same steps are performed on the first generator trained for each subcategory image set, thereby obtaining multiple image pairs of different categories as sample data. Among them, the identifier corresponding to each image pair is the identifier corresponding to the subcategory image set. The type of image pairs is the same as the type of subcategory image set obtained by clustering the stylized image set, and is also the same as the number of the first generator.

[0052] In one possible implementation, the stylized image set may be a collected initial stylized image set, such as directly captured images of characters from anime. To ensure sample diversity, character images with different features may be obtained, such as facial images from various angles.

[0053] Optionally, to further improve the adequacy and diversity of samples, the stylized image set can be expanded based on the initial stylized image. For example, after obtaining the initial stylized image set, the initial stylized image set can be used to train a second generator, so that the discriminant model of the second generator cannot determine whether the stylized images generated by the generative model are real samples, thereby obtaining a trained third generator. The random variable set is then input into the third generator to obtain the first stylized image set. The random variable set includes multiple random variables. Inputting any random variable set into the third generator can obtain a corresponding stylized image, thereby obtaining multiple stylized images as the first stylized image set. The initial stylized image set and the first stylized image set can then be combined into a stylized image set.

[0054] When the original image is a facial image, the collected original stylized images may include different facial angles. Therefore, by acquiring stylized images from multiple facial angles, we can improve sample diversity and sufficiency. The original stylized image set is classified based on a set of preset angle ranges to obtain multiple angle-stylized image sets. When the number of original stylized images in a particular angle-stylized image set is less than a threshold, a supplementary angle-stylized image set is generated that matches the facial angles of the angle-stylized image set, forming the stylized image set.

[0055] In one possible implementation, a set of random variables may be input into a third generator. After obtaining a second set of stylized images, the server may perform facial attribute recognition on the second set of stylized images to obtain the facial angle of each stylized image. After determining the facial angle of each stylized image, the server may classify the second set of stylized images according to a set of preset angle ranges, thereby determining a set of angular stylized images corresponding to each angle range. This embodiment does not limit the specific method of classifying the set of preset angle ranges for facial images. For example, the set of preset angle ranges may include -90°-30°, -30°-0°, 0°-30°, and 30°-90°, where 0° indicates a frontal face, the angle is negative when the facial image is tilted to the left, and positive when the facial image is tilted to the right.

[0056] When the number of stylized images in a certain angle-stylized image set falls below a threshold, indicating insufficient sample data for that angle range, a target random variable set corresponding to the angle-stylized images in that range can be obtained to supplement the sample. Specifically, the target random variable set is re-input into the third generator to obtain a supplementary angle-stylized image set that satisfies that angle range. The second stylized image set and the newly generated supplementary angle-stylized image set are then combined to form a second stylized image set, improving the adequacy of the sample features.

[0057] In one possible implementation, clustering of a set of stylized images can be achieved by performing feature extraction on any stylized image in the set of stylized images to obtain a feature vector. Optionally, a convolutional neural network can be used to extract features from the image. That is, by performing feature extraction on each image in the set of stylized images using a convolutional neural network, a corresponding plurality of feature vectors can be obtained, which can be used to represent the feature information of the image. After obtaining the feature vector corresponding to each image in the set of stylized images, the plurality of feature vectors are clustered to obtain a plurality of feature vector sets corresponding to a plurality of subcategory image sets. Based on the feature vectors included in each feature vector set, the image set belonging to that category can be determined.

[0058] Alternatively, a K-means clustering algorithm can be used to cluster multiple eigenvectors. The basic principle of the K-means clustering algorithm is as follows: first, k eigenvectors are randomly selected from multiple eigenvectors as initial cluster centers, and then the distance between each eigenvector and each seed cluster center is calculated, such as the Euclidean distance, and each eigenvector is assigned to the cluster center closest to it. After the clustering is completed, the cluster centers and the eigenvectors assigned to them represent a cluster, and then the cluster center of the cluster is recalculated based on the eigenvectors included in each cluster. For example, the cluster center can be the one with the smallest sum of distances to each eigenvector in the cluster. Based on the newly calculated cluster center, each eigenvector is reassigned, and the clustering process is repeated until a certain termination condition is met. For example, the termination condition can be that no eigenvectors are reassigned to different clusters, or no cluster center changes.

[0059] S202: Inputting a reference image and a marker corresponding to the reference image into an initial image generation model to obtain an output stylized image.

[0060] After determining the identifier corresponding to each image pair, an initial image generation model can be trained based on the image pairs and the corresponding identifiers. Specifically, multiple reference images and the identifiers corresponding to these reference images can be input into the initial image generation model to obtain multiple output stylized images, where the multiple facial images correspond one-to-one to the multiple output stylized images.

[0061] S203: Adjusting the initial image generation model based on the stylized image and the output stylized image.

[0062] Since the sample data includes multiple image pairs, that is, each reference image corresponds to a stylized image, a loss function can be determined based on the multiple stylized images corresponding to the multiple reference images and the multiple output stylized images. The loss function can be used to represent the difference between the stylized image in the image pair and the output stylized image, that is, the accuracy of the initial image generation model. The larger the loss function, the greater the difference between the stylized image and the output stylized image, that is, the less accurate the initial image generation model. For example, the first eigenvector of any stylized image in the image pair and the second eigenvector of the output stylized image corresponding to the stylized image can be obtained. The eigenvectors can be used to represent the characteristics of the image, and then the similarity between the first eigenvector and the second eigenvector is calculated as the loss function.

[0063] When the loss function is greater than or equal to a preset value, the parameters of the initial image generation model are adjusted, and the multiple images in the sample data and the identifiers corresponding to the multiple images are input into the initial image generation model and the subsequent training process is re-executed until the loss function is less than the preset value, and the image stylization model is obtained.

[0064] When the loss function is greater than or equal to a preset value, it indicates that the accuracy of the initial image generation model does not meet the requirements. The parameters of the initial image generation model can be adjusted, and the multiple reference images and the identifiers corresponding to the multiple reference images can be input into the initial image generation model and the subsequent training process can be re-executed until the determined loss function is less than the preset value, thereby obtaining a trained image stylization model.

[0065] The image generation model training method provided in the above embodiment allows the image generation model to be trained based on a wider variety of samples, thereby increasing the diversity of generated stylized images. Furthermore, during model training, clustering can be used to determine the identifiers of different types of stylized images, thereby increasing the distinction between them and improving the user experience. See Figure 3, which is a schematic diagram of a stylized image provided in an embodiment of the present disclosure. When multiple image pairs include four types of identifiers, the four stylized images generated by inputting a facial image are shown in Figure 3.

[0066] Once the server has trained and obtained an image stylization model, it can be provided to the client. The client can then utilize the image stylization model to generate a stylized image. The client's stylized image generation function can be stylized image generation software. In other words, a user can generate a stylized image based on an image by using the client's stylized image generation function. The client can be a mobile phone, tablet, or other device.

[0067] Based on the above method embodiment, the present disclosure also provides an image processing device. Referring to FIG4 , FIG4 is a schematic diagram of an image processing device provided by the present disclosure embodiment.

[0068] The apparatus 400 comprises:

[0069] A first acquiring unit 401 is configured to acquire an original image;

[0070] A second acquiring unit 402 is configured to acquire a target identifier, where the target identifier is used to indicate a stylized type of the original image;

[0071] The third acquisition unit 403 is configured to input the original image and the target identifier into an image stylization model to acquire a target stylized image.

[0072] In one possible implementation, the second acquisition unit 402 is specifically configured to parse the target object in the original image, and when the target object meets a preset condition, obtain a target identifier corresponding to the preset condition; or, in response to a user selecting an identifier, obtain the target identifier.

[0073] In a possible implementation, the apparatus 400 further includes: a fourth acquiring unit;

[0074] The fourth acquisition unit is used to acquire multiple groups of image pairs, each of which includes a reference image and a stylized image, and each of the image pairs has a corresponding identifier, and the identifier is used to distinguish the style types of different image pairs; input the reference image and the identifier corresponding to the reference image into the initial image generation model to obtain an output stylized image; and adjust the initial image generation model based on the stylized image and the output stylized image.

[0075] In one possible implementation, the fourth acquisition unit is specifically used to acquire a stylized image set; cluster the stylized image set to acquire multiple subcategory image sets; determine multiple identifiers corresponding to the multiple subcategory image sets, and the multiple subcategory image sets correspond one-to-one to the multiple identifiers; use the multiple subcategory image sets to acquire a subcategory stylized image corresponding to the reference image; and use the reference image and the corresponding subcategory stylized image as the image pair, and the identifier corresponding to the image pair is the same as the identifier corresponding to the subcategory image set.

[0076] In one possible implementation, the fourth acquisition unit is specifically configured to acquire a set of original stylized images; perform attribute recognition on the set of original stylized images to determine the angles of the original stylized images in the set of original stylized images; classify the set of original stylized images based on a preset angle range set to acquire multiple angle-stylized image sets; and when the number of original stylized images in the angle-stylized image set is less than a threshold, generate a set of supplementary angle-stylized images that match the angles of the angle-stylized image set to form the set of stylized images.

[0077] In a possible implementation, the fourth acquisition unit is specifically configured to perform feature extraction on the stylized image to obtain a feature vector; cluster multiple feature vectors to obtain multiple feature vector sets; and determine the multiple subcategory image sets based on the multiple feature vector sets.

[0078] The beneficial effects of the image processing device provided by the embodiment of the present disclosure can be found in the above method embodiment and will not be described in detail here.

[0079] It should be noted that the specific implementation of each unit in this embodiment can refer to the relevant description in the above-mentioned method embodiment. The division of units in the embodiment of the present disclosure is schematic and is only a logical function division. There may be other division methods in actual implementation. The functional units in the embodiment of the present disclosure can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. For example, in the above-mentioned embodiment, the processing unit and the sending unit can be the same unit or different units. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0080] Referring to FIG5 , a schematic diagram of the structure of an electronic device 500 suitable for implementing embodiments of the present disclosure is shown. Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG5 is merely an example and should not limit the functionality or scope of use of embodiments of the present disclosure.

[0081] As shown in Figure 5, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0082] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although FIG5 shows the electronic device 500 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.

[0083] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0084] The electronic device provided by the embodiment of the present disclosure and the method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0085] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the method provided in the above embodiment is implemented.

[0086] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0087] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0088] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0089] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device can perform the method.

[0090] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0091] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0092] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit / module does not, in some cases, limit the unit itself.

[0093] The functions described above in the present disclosure may be performed at least in part by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

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

[0095] According to one or more embodiments of the present disclosure, there is provided an image processing method, which may include:

[0096] Get the original image;

[0097] Obtaining a target identifier, where the target identifier is used to indicate a stylized type of the original image;

[0098] The original image and the target identifier are input into an image stylization model to obtain a target stylized image.

[0099] According to one or more embodiments of the present disclosure, obtaining the target identifier includes:

[0100] The target object in the original image is parsed, and when the target object meets a preset condition, a target identifier corresponding to the preset condition is obtained; or, in response to a user selecting an identifier, the target identifier is obtained.

[0101] According to one or more embodiments of the present disclosure, the image stylization model is obtained based on the following steps:

[0102] Acquire multiple sets of image pairs, each of which includes a reference image and a stylized image, each of which has a corresponding identifier, and each identifier is used to distinguish the style types of different image pairs;

[0103] Inputting the reference image and the identifier corresponding to the reference image into an initial image generation model to obtain an output stylized image;

[0104] The initial image generation model is adjusted based on the stylized image and the output stylized image.

[0105] According to one or more embodiments of the present disclosure, acquiring multiple sets of image pairs includes:

[0106] Get a collection of stylized images;

[0107] Clustering the stylized image set to obtain multiple subcategory image sets;

[0108] Determining a plurality of identifiers corresponding to the plurality of subcategory image sets, wherein the plurality of subcategory image sets correspond to the plurality of identifiers in a one-to-one manner;

[0109] Acquire a subcategory stylized image corresponding to the reference image using the multiple subcategory image sets;

[0110] The reference image and the corresponding subcategory stylized image are taken as the image pair, and the identifier corresponding to the image pair is the same as the identifier corresponding to the subcategory image set.

[0111] According to one or more embodiments of the present disclosure, obtaining a set of stylized images includes:

[0112] Get the original stylized image collection;

[0113] performing attribute recognition on the set of original stylized images to determine angles of original stylized images in the set of original stylized images;

[0114] Classifying the original stylized image set based on a preset angle range set to obtain a plurality of angle stylized image sets;

[0115] When the number of original stylized images in the angular stylized image set is less than a threshold, a supplementary angular stylized image set matching the angle of the angular stylized image set is generated to form the stylized image set.

[0116] According to one or more embodiments of the present disclosure, clustering the stylized image set to obtain multiple subcategory image sets includes:

[0117] Performing feature extraction on the stylized image to obtain a feature vector;

[0118] Clustering the plurality of feature vectors to obtain a plurality of feature vector sets;

[0119] The plurality of subcategory image sets are determined based on the plurality of feature vector sets.

[0120] According to one or more embodiments of the present disclosure, an image processing apparatus is provided, which may include:

[0121] A first acquisition unit, configured to acquire an original image;

[0122] a second acquiring unit, configured to acquire a target identifier, wherein the target identifier is used to indicate a stylized type of the original image;

[0123] The third acquisition unit is configured to input the original image and the target identifier into an image stylization model to acquire a target stylized image.

[0124] In one or more embodiments of the present disclosure, the second acquisition unit is specifically used to parse the target object in the original image, and when the target object meets the preset conditions, obtain the target identification corresponding to the preset conditions; or, in response to the user selecting the identification operation, obtain the target identification.

[0125] In one or more embodiments of the present disclosure, the apparatus further includes: a fourth acquiring unit;

[0126] The fourth acquisition unit is used to acquire multiple groups of image pairs, each of which includes a reference image and a stylized image, and each of the image pairs has a corresponding identifier, and the identifier is used to distinguish the style types of different image pairs; input the reference image and the identifier corresponding to the reference image into the initial image generation model to obtain an output stylized image; and adjust the initial image generation model based on the stylized image and the output stylized image.

[0127] In one or more embodiments of the present disclosure, the fourth acquisition unit is specifically used to acquire a stylized image set; cluster the stylized image set to acquire multiple subcategory image sets; determine multiple identifiers corresponding to the multiple subcategory image sets, and the multiple subcategory image sets correspond one-to-one to the multiple identifiers; use the multiple subcategory image sets to acquire a subcategory stylized image corresponding to the reference image; use the reference image and the corresponding subcategory stylized image as the image pair, and the identifier corresponding to the image pair is the same as the identifier corresponding to the subcategory image set.

[0128] In one or more embodiments of the present disclosure, the fourth acquisition unit is specifically configured to acquire a set of original stylized images; perform attribute recognition on the set of original stylized images to determine the angles of the original stylized images in the set of original stylized images; classify the set of original stylized images based on a preset angle range set to acquire multiple angle stylized image sets; and when the number of original stylized images in the angle stylized image set is less than a threshold, generate a set of supplementary angle stylized images that match the angles of the angle stylized image set to form the set of stylized images.

[0129] In one or more embodiments of the present disclosure, the fourth acquisition unit is specifically configured to perform feature extraction on the stylized image to obtain a feature vector; cluster multiple feature vectors to obtain multiple feature vector sets; and determine the multiple subcategory image sets based on the multiple feature vector sets.

[0130] According to one or more embodiments of the present disclosure, there is provided an electronic device, the device comprising: a processor and a memory;

[0131] The memory is used to store instructions or computer programs;

[0132] The processor is configured to execute the instructions or computer program in the memory so that the electronic device performs the image processing method.

[0133] According to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a device, the device executes the image processing method.

[0134] It should be noted that the various embodiments of this disclosure are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the descriptions of the systems or devices disclosed in the embodiments for similarities and differences between them. Since the systems or devices disclosed in the embodiments correspond to the methods disclosed in the embodiments, their descriptions are relatively simple, and reference can be made to the descriptions of the methods for any related details.

[0135] It should be understood that in the present disclosure, "at least one (item)" refers to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0136] It should also be noted that, in the present disclosure, relational terms such as first and second, etc., are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the statement "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0137] The steps of the methods or algorithms described in conjunction with the embodiments of the present disclosure may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0138] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined in this disclosure may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments shown herein, but is intended to be applied in the widest manner consistent with the principles and novel features of the present disclosure.

Claims

1. An image processing method, comprising: Get the original image; Acquire a target identifier, wherein the target identifier is used to indicate a stylized type of the original image; as well as The original image and the target identifier are input into an image stylization model to obtain a target stylized image.

2. The method according to claim 1, wherein: The obtaining of the target identifier includes: Parsing the target object in the original image, and when the target object meets a preset condition, obtaining a target identifier corresponding to the preset condition; or, In response to a user selecting an identifier, the target identifier is acquired.

3. The method according to claim 1, wherein: The image stylization model is obtained based on the following steps: Acquire multiple groups of image pairs, the image pairs including reference images and stylized images, the image pairs having corresponding identifiers, and the identifiers are used to distinguish style types of different image pairs; Inputting the reference image and the identifier corresponding to the reference image into an initial image generation model to obtain an output stylized image; The initial image generation model is adjusted based on the stylized image and the output stylized image.

4. The method according to claim 3, wherein: The obtaining of multiple sets of image pairs comprises: Get a collection of stylized images; Clustering the stylized image set to obtain multiple subcategory image sets; Determine a plurality of identifiers corresponding to the plurality of subcategory image sets, wherein the plurality of subcategory image sets correspond to the plurality of identifiers one-to-one; Acquire a subcategory stylized image corresponding to the reference image using the plurality of subcategory image sets; The reference image and the corresponding subcategory stylized image are taken as the image pair, and the identifier corresponding to the image pair is the same as the identifier corresponding to the subcategory image set.

5. The method according to claim 4, wherein: The step of obtaining a set of stylized images comprises: Get the original stylized image set; Performing attribute recognition on the original stylized image set to determine angles of original stylized images in the original stylized image set; Classifying the original stylized image set based on a preset angle range set to obtain a plurality of angle stylized image sets; When the number of original stylized images in the angular stylized image set is less than a threshold, a set of supplementary angular stylized images matching the angles of the angular stylized image set is generated to form the stylized image set.

6. The method according to claim 4, wherein: The step of clustering the stylized image set to obtain a plurality of subcategory image sets includes: Performing feature extraction on the stylized image to obtain a feature vector; Clustering the plurality of feature vectors to obtain a plurality of feature vector sets; The plurality of subcategory image sets are determined based on the plurality of feature vector sets.

7. An image processing device, comprising: A first acquisition unit, configured to acquire an original image; A second acquisition unit is configured to acquire a target identifier, wherein the target identifier is used to indicate a stylized type of the original image; as well as The third acquisition unit is configured to input the original image and the target identifier into an image stylization model to acquire a target stylized image.

8. An electronic device, comprising: Processor and memory; in The memory is configured to store instructions or computer programs; The processor is configured to execute the instructions or the computer program in the memory, so that the electronic device performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, wherein: The computer-readable storage medium stores instructions, and when the instructions are executed on a device, the device is caused to execute the method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Training method and device of image style conversion model, and image style conversion method and device

    CN113850712A

  • Image style migration method and device, storage medium and terminal

    CN114066718A

  • Sample image generation method and device, electronic equipment and storage medium

    CN114511754A

  • Image processing apparatus and method for style transformation

    US20220067421A1

Cited By

  • Training method of image generation model, image generation method and device thereof

    CN119600378A