Image processing method and device
By extracting feature information from the original portrait and generating encoding, the problem of quickly and accurately finding templates to meet the needs in a large number of portrait templates is solved, and the image effects that meet the needs of users are quickly generated.
Patent Information
- Application Number
- CN202411294703.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-13
AI Technical Summary
There is difficulty in quickly and accurately finding portrait templates that meet user needs among a large number of portrait templates, and it is difficult for the existing technology to solve this problem efficiently.
By extracting feature information from the uploaded original portrait, generating feature codes, and matching them with the preset template codes, we can quickly and accurately obtain portrait templates that meet user needs.
It greatly saves users time to find portrait templates and can quickly generate images of various styles that meet user needs.
Smart Images

Figure CN119131159A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method and electronic device. Background Art
[0002] With the development of AIGC (Artificial Intelligence Generative Content) technology, applications of AI-generated portraits have sprung up like mushrooms after a rain.
[0003] In the related technical solution, the user uploads a person image, then selects a portrait template, and generates an image similar to the style of the portrait template based on the portrait template and the person image uploaded by the user. However, in this technical solution, when there are a large number of portrait templates, it is impossible to quickly and accurately obtain a portrait template that meets the user's needs.
[0004] Therefore, how to quickly and accurately obtain portrait templates that meet user needs from a large number of portrait templates has become a technical problem that needs to be solved urgently.
[0005] The content of the background technology section is only the information known to the inventor personally, and does not mean that the above information has entered the public domain before the application date of this disclosure, nor does it mean that it can become the prior art of the present disclosure. Summary of the invention
[0006] The present specification provides an image processing method and an electronic device, which can quickly and accurately obtain a portrait template that meets user needs from a large number of portrait templates.
[0007] In a first aspect, this specification provides an image processing method, comprising:
[0008] In response to an image upload operation in the graphical user interface, obtaining at least one uploaded original portrait;
[0009] Extracting original portrait feature information corresponding to each original person from the at least one original portrait;
[0010] Based on the original portrait feature information corresponding to each of the original characters, generating an original portrait feature code corresponding to the at least one original portrait;
[0011] Based on the original portrait feature code and the template code, at least one matching portrait template is obtained from multiple preset portrait templates, wherein the template code is a pre-generated template portrait feature code of the portrait template, and the portrait template is used to generate a target portrait in combination with the original portrait.
[0012] In some example embodiments, based on the above solution, the step of obtaining at least one matching portrait template from a plurality of preset portrait templates based on the original portrait feature code and the template code includes:
[0013] Based on the original portrait feature code, searching for a target template code corresponding to the original portrait feature code from template code indexes corresponding to a plurality of preset first portrait templates;
[0014] Based on the target template code, at least one matching portrait template is acquired from the multiple first portrait templates.
[0015] In some example embodiments, based on the above solution, before acquiring a matching portrait template from a plurality of preset portrait templates, the method further includes:
[0016] Determining template portrait feature information of each template character in the portrait template;
[0017] Encoding the template portrait feature information according to a predetermined encoding rule to obtain the template portrait feature code corresponding to each template character;
[0018] Based on the template portrait feature codes, the portrait feature codes corresponding to the template characters are sorted and combined according to a predetermined code index order to obtain template codes corresponding to the portrait templates.
[0019] The template codes corresponding to the sorted multiple portrait templates form the template code index.
[0020] In some example embodiments, based on the above solution, generating the original portrait feature code corresponding to the at least one original portrait based on the original portrait feature information corresponding to each of the original characters includes:
[0021] Encoding the original portrait feature information corresponding to each of the original characters according to a predetermined encoding rule to obtain the original portrait feature code corresponding to each of the original characters;
[0022] The original portrait feature codes corresponding to the original characters are combined to generate an original portrait feature code corresponding to the at least one original portrait.
[0023] In some example embodiments, based on the above scheme, the original portrait feature information includes gender information and age information, and the original portrait feature information corresponding to each of the original characters is encoded according to a predetermined encoding rule to obtain the original portrait feature code corresponding to each of the original characters, including:
[0024] Determine the gender information and age information corresponding to each of the original portraits;
[0025] The gender information and age information corresponding to each of the original characters are encoded according to a predetermined encoding rule to obtain the gender information code and age information code corresponding to each of the original characters.
[0026] In some example embodiments, based on the above scheme, the at least one original portrait includes a plurality of original persons, and combining the original portrait feature codes corresponding to the respective original persons to generate the original portrait feature code corresponding to the at least one original portrait includes:
[0027] Based on the gender information code and age information code, the original portrait feature codes corresponding to the original characters are sorted according to a predetermined code index sequence;
[0028] The sorted original portrait feature codes corresponding to the original characters are combined to generate original portrait feature codes corresponding to the multiple original characters.
[0029] In some example embodiments, based on the above solution, the method further includes:
[0030] If the portrait template is not matched from the multiple first portrait templates;
[0031] Then, according to the number of people information corresponding to the at least one original portrait, a portrait template corresponding to the number of people information is searched from a plurality of preset second portrait templates, wherein the second portrait template is a jigsaw template.
[0032] In some example embodiments, based on the above solution, the original portrait feature information includes facial characteristic information, and the method further includes:
[0033] Based on the facial feature information corresponding to each original character in the at least one original portrait and the second portrait template, a character puzzle image corresponding to each original character in the at least one original portrait is generated.
[0034] In some example embodiments, based on the above solution, searching for a portrait template corresponding to the number of people information corresponding to the at least one original portrait from a plurality of preset second portrait templates includes:
[0035] generating a number code corresponding to the at least one original portrait according to the number of people information corresponding to the at least one original portrait;
[0036] Based on the number of people code, searching for a target number of people code corresponding to the number of people information from a plurality of preset number of second portrait templates' number code indexes;
[0037] Based on the target number of people code, at least one matching portrait template is acquired from the multiple second portrait templates.
[0038] In some example embodiments, based on the above solution, after extracting original portrait feature information corresponding to each original person from the at least one original portrait, the method further includes:
[0039] Presenting the original portrait feature information corresponding to each of the original characters on the graphical user interface;
[0040] In response to the information change operation on the original portrait feature information corresponding to the original person, the original portrait feature information corresponding to the original person is changed. In some example embodiments, based on the above scheme, after obtaining at least one matching portrait template from the preset multiple portrait templates, the method further includes:
[0041] Distinctive presentation of at least one of the portrait templates on the graphical user interface;
[0042] In response to the template selection operation for the target portrait template, a selected target portrait template is determined.
[0043] In some example embodiments, based on the above solution, the distinctively presenting at least one portrait template on the graphical user interface includes:
[0044] Determine the historical selection probability of each of the portrait templates;
[0045] Based on the size of the historical selection probability, at least one of the portrait templates is distinctively presented on the graphical user interface of the image generation scene.
[0046] In some example embodiments, based on the above solution, the original portrait feature information includes gender information and age information, and extracting the original portrait feature information corresponding to each original person from the at least one original portrait includes:
[0047] The original portrait feature information corresponding to each original person is extracted from the at least one original portrait by using a portrait feature recognition model, wherein the portrait feature recognition model is a pre-trained face recognition model.
[0048] In some example embodiments, based on the above solution, the original portrait feature information further includes facial characteristic information, and extracting the original portrait feature information corresponding to each original person from the at least one original portrait by using a portrait feature recognition model includes:
[0049] The original portraits are cropped to obtain portraits corresponding to the original characters;
[0050] The facial feature information of the head portraits corresponding to the original characters is extracted through the portrait feature recognition model.
[0051] In a second aspect, the present specification also provides an electronic device, comprising: at least one storage medium storing at least one instruction set for performing image processing; and at least one processor communicatively connected to the at least one storage medium, wherein when the electronic device is running, the at least one processor reads the at least one instruction set and executes the image processing method described in the first aspect of the present specification according to the instructions of the at least one instruction set.
[0052] It can be seen from the above technical solutions that the image processing method and device provided in the embodiments of this specification, on the one hand, generate an original portrait feature code corresponding to at least one original portrait based on the original portrait feature information corresponding to each original character in at least one uploaded original portrait, and can efficiently encode the portrait feature information in the original portrait, such as age, gender; on the other hand, based on the original portrait feature code and the template code, obtain at least one matching portrait template from multiple preset portrait templates, and can quickly and accurately obtain a portrait template that meets user needs from a large number of portrait templates, greatly saving the user's time in searching for portrait templates; on the other hand, since the target portrait can be generated by combining the portrait template with the original portrait, it is possible to quickly generate images of various styles that meet user needs.
[0053] Other features of the image processing methods and devices provided by this specification will be partially listed in the following description. Based on the description, the content introduced by the following figures and examples will be obvious to those of ordinary skill in the art. The creative aspects of the image processing methods and devices provided by this specification can be fully explained by practicing or using the methods, devices and combinations described in the following detailed examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0055] Figure 1 A schematic diagram showing an implementation environment of an image processing method provided in an embodiment of this specification;
[0056] Figure 2 A hardware structure diagram of an electronic device 200 provided according to an embodiment of this specification is shown;
[0057] Figure 3 A flowchart of an image processing method provided according to some embodiments of this specification is shown;
[0058] Figure 4 A schematic diagram of an interface for uploading an image and identifying character information provided according to some embodiments of this specification is shown;
[0059] Figure 5 A schematic diagram of an interface for editing character information provided according to some embodiments of this specification is shown;
[0060] Figure 6 A schematic diagram of an interface for selecting a portrait template provided according to some embodiments of this specification is shown;
[0061] Figure 7 A schematic diagram of an interface for selecting a puzzle template according to some embodiments of this specification is shown; and
[0062] Figure 8 A schematic diagram of a process for generating a portrait feature code according to some embodiments of this specification is shown. DETAILED DESCRIPTION
[0063] The following description provides specific application scenarios and requirements of this specification, with the purpose of enabling those skilled in the art to make and use the contents of this specification. Various local modifications to the disclosed embodiments will be apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of this specification. Therefore, this specification is not limited to the embodiments shown, but to the widest scope consistent with the claims.
[0064] The terms used herein are only used for the purpose of describing specific example embodiments and are not restrictive. For example, unless the context clearly indicates otherwise, as used herein, the singular forms "a", "an" and "the" may also include plural forms. When used in this specification, the terms "include", "comprise" and / or "contain" mean that the associated integers, steps, operations, elements and / or components exist, but do not exclude the existence of one or more other features, integers, steps, operations, elements, components and / or groups or that other features, integers, steps, operations, elements, components and / or groups may be added in the system / method.
[0065] In view of the following description, these and other features of the present specification, as well as the operation and function of the related elements of the structure, and the economy of the combination and manufacture of the parts can be significantly improved. Reference is made to the accompanying drawings, all of which form a part of this specification. However, it should be clearly understood that the drawings are for illustration and description purposes only and are not intended to limit the scope of this specification. It should also be understood that the drawings are not drawn to scale.
[0066] The flowcharts used in this specification illustrate the operations implemented by the system according to some embodiments in this specification. It should be clearly understood that the operations of the flowcharts may not be implemented in sequence. On the contrary, the operations may be implemented in reverse order or simultaneously. In addition, one or more other operations may be added to the flowchart. One or more operations may be removed from the flowchart.
[0067] First, the terms involved in one or more embodiments of this specification are explained.
[0068] Portrait template: The basic material for AI face-changing. In image generation applications, the image generation algorithm extracts portrait information from photos uploaded by users and replaces the face with a pre-shot template.
[0069] AIGC: With the help of artificial intelligence content generation methods, the content generated by AIGC can include text, images, audio, video and other forms.
[0070] Jigsaw template: To ensure user experience, if the current portrait template cannot match a portrait template that meets the user's age and gender information, the final result is obtained by splicing single images in the puzzle template.
[0071] In the related technical solution, when users generate multi-person images through image generation applications, they first need to upload photos of the characters and parse the portraits of the characters in the photos, manually set the age and gender of each character, and then manually select templates that meet the age, gender, and number requirements from the template library based on the age and gender to generate. However, in order to fully meet the different demands of users, image generation applications usually prepare portrait templates of various styles for users, and each style has a variety of different shooting postures, which will generate tens of thousands of templates. Therefore, in the case of a large number of portrait templates, the manual template selection method cannot accurately and efficiently recommend the required templates to users.
[0072] Based on the above content, the embodiments of this specification provide an image processing method and an electronic device. On the one hand, based on the original portrait feature information corresponding to each original character in at least one uploaded original portrait, an original portrait feature code corresponding to at least one original portrait is generated, which can efficiently encode the portrait features in the original portrait, such as age, gender; on the other hand, based on the original portrait feature code and the template code, at least one matching portrait template is obtained from multiple preset portrait templates, and a portrait template that meets the user's needs is quickly and accurately obtained from a large number of portrait templates, which greatly saves the user's time in searching for portrait templates; on the other hand, since the target portrait can be generated by combining the portrait template with the original portrait, images of various styles that meet the user's needs can be quickly generated.
[0073] The technical solutions of the embodiments of this specification will be described in detail below with reference to the accompanying drawings.
[0074] Figure 1 A schematic diagram showing an implementation environment of an image processing method provided in an embodiment of this specification is shown.
[0075] See also Figure 1 As shown, the implementation environment 100 may include a terminal 110 , a server 130 , and a database 140 .
[0076] The terminal 110 is connected to the server 130 via a wireless network or a wired network 120. The terminal 110 may be a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto.
[0077] The terminal 110 may store data or instructions for executing the image processing method described in this specification. The terminal 110 may include a hardware device with data information processing capabilities and a necessary program to drive the hardware device to work.
[0078] The server 130 is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms, etc. The server 130 provides background services for applications running on the terminal 110.
[0079] The server 130 is equipped with an integrated development platform. The integrated development platform, also known as an integrated development environment (IDE), is an application program for providing a program development environment, generally including tools such as a code editor, a compiler, a debugger, and a graphical user interface. Developers can write program codes (i.e., program development) on the integrated development platform. The integrated development platform server can be a computing device specifically used by the integrated development platform to implement the image processing method. The server 130 can communicate data with the terminal 110 and the database 140 respectively.
[0080] In addition, the server 130 may store data or instructions for executing the image processing method described in this specification. The server 130 may include a hardware device with data information processing capabilities and the necessary programs required to drive the hardware device to work. Of course, the server 130 may also be only a hardware device with data processing capabilities, or only a program running in the hardware device. In some embodiments, the server 130 may also be used as a plug-in and deployed in the terminal 110. In this case, the server 130 stores data or instructions for executing the image processing method corresponding to the terminal 110 described in this specification.
[0081] Database 140 can store data and / or instructions. In some embodiments, database 140 can store portrait templates and portrait feature coding indexes. In some embodiments, database 140 can store data and / or instructions that server 130 executes or uses to execute the image processing method described in this specification. Terminal 110 and server 130 have access to database 140, and terminal 110 and server 130 can access data or instructions stored in database 140 through a network. In some embodiments, database 140 can be directly connected to terminal 110 and server 130. In some embodiments, database 140 can be part of server 130. In some embodiments, database 140 can include mass storage, removable storage, volatile read-write memory, read-only memory (ROM) or the like, or any combination thereof. Exemplary mass storage may include non-transitory storage media such as disks, optical disks, solid-state drives, etc. Example removable storage may include flash drives, floppy disks, optical disks, memory cards, zip disks, tapes, etc. Typical volatile read-write memory may include random access memory (RAM). Example RAMs may include dynamic RAM (DRAM), double date rate synchronous dynamic RAM (DDRSDRAM), static RAM (SRAM), thyristor RAM (T-RAM), zero capacitance RAM (Z-RAM), etc. Exemplary ROMs may include mask ROM (MROM), programmable ROM (PROM), virtually programmable ROM (PEROM), electronically programmable ROM (EEPROM), compact disk (CD ROM), digital versatile disk ROM, etc.
[0082] Those skilled in the art will appreciate that the number of the above terminals may be more or less. For example, the above terminal may be only one, or the above terminals may be dozens or hundreds, or a greater number, in which case the above implementation environment may also include other terminals. The embodiments of this specification do not limit the number of terminals and device types.
[0083] After introducing the implementation environment of the embodiments of this specification, the application scenarios of the embodiments of this specification will be introduced in combination with the above implementation environment. In the following description, the terminal is the terminal 110 in the above implementation environment, and the server is the server 130 in the above implementation environment. The technical solutions provided by the embodiments of this specification can be applied in image generation scenarios, such as image generation applications, image generation applets, image generation websites, image generation models, etc.
[0084] Taking the application of the technical solution provided in the embodiments of this specification in an image generation application as an example, the terminal 110 obtains at least one uploaded original portrait in response to an image upload operation under the graphical user interface of the image generation application; extracts original portrait feature information corresponding to each original character from the at least one original portrait; generates a portrait feature code corresponding to at least one original portrait based on the original portrait feature information corresponding to each original character; based on the portrait feature code, obtains at least one matching portrait template from multiple preset portrait templates, and the portrait template is used to generate a target portrait in combination with the original portrait.
[0085] It should be noted that the above is explained by taking the application of the technical solution provided in the embodiments of this specification in an image generation application as an example. The technical solution provided in the embodiments of this specification can also be applied to other appropriate image generation scenarios, such as image generation applets, image generation websites, etc. The implementation process belongs to the same inventive concept as the above description and will not be repeated here.
[0086] It should be noted that the steps in the image processing method in the example embodiment of this specification may be partially executed by the client, partially executed by the server, or entirely executed by the server or entirely executed by the client, and this specification does not specifically limit this.
[0087] based on Figure 1 The implementation environment shown below will be combined with Figure 2-Figure 8 , the image processing method and electronic device provided by the embodiments of this specification are introduced in detail. It should be noted that the above implementation environment is only shown to facilitate understanding of the spirit and principle of this specification, and the embodiments of this specification are not limited in this regard. On the contrary, the embodiments of this specification can be applied to any applicable scenario.
[0088] Figure 2 2 is a schematic diagram of the structure of an electronic device 200 provided according to some embodiments of the present specification. The electronic device 200 can execute the image processing method described in the present specification. The image processing method is introduced in other parts of the present specification. The electronic device 200 can be a general-purpose computer or a special-purpose computer. For example, the electronic device 200 can be a server, a personal computer, a portable computer (such as a notebook computer, a tablet computer, etc.), or other electronic devices with computing capabilities. Of course, the electronic device can be Figure 1 The terminal 110 or the server 130 may also be a terminal device used by multiple developers to develop programs on an integrated development platform.
[0089] The electronic device in this specification may include one or more of the following components: a processor 210, a memory 220, an input device 230, an output device 240, and a bus 250. The processor 210, the memory 220, the input device 230, and the output device 240 may be connected via a bus 250.
[0090] The processor 210 may include one or more processing cores. The processor 210 uses various interfaces and lines to connect various parts of the entire electronic device, and executes the image processing method described in this specification by running or executing instructions, programs, code sets or instruction sets stored in the memory 220, and calling data stored in the memory 220. Optionally, the processor 210 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 210 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 210, but may be implemented separately through a communication chip.
[0091] The memory 220 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 220 includes a non-transitory computer-readable storage medium. The memory 220 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 220 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (e.g., a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an IOS system, including a system deeply developed based on the IOS system, or other systems.
[0092] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.
[0093] The input device 230 is used to receive input commands or data, and includes but is not limited to a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 240 is used to output commands or data, and includes but is not limited to a display device and a speaker. In one example, the input device 230 and the output device 240 can be combined, and the input device 230 and the output device 240 are touch screen displays.
[0094] In addition, those skilled in the art will appreciate that the structure of the electronic device shown in the above drawings does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the electronic device also includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a Bluetooth module and other components, which will not be described in detail here.
[0095] Figure 3 A flowchart of an image processing method provided according to an embodiment of the present specification is shown. As before, the electronic device 200 can execute the image processing method of the embodiment of the present specification. Specifically, the processor 210 can read the instruction set stored in its local storage medium, and then execute the image processing method of the embodiment of the present specification according to the provisions of the instruction set. Below, steps S310 to S340 in the image processing method will be described in detail in conjunction with the accompanying drawings.
[0096] like Figure 3 As shown, in step S310, in response to an image upload operation in a graphical user interface, at least one uploaded original portrait is obtained.
[0097] In an example embodiment, the graphical user interface is a graphical user interface in an image generation scenario. The image generation scenario may be a scenario in which a user uses an image generation application or an image generation applet. For example, an image upload control is provided on the graphical user interface of the image generation scenario, and the user selects an original portrait to be uploaded through the image upload control. The electronic device 200 obtains at least one original portrait uploaded by the user in response to the user's image upload operation for the original image selected under the image upload control.
[0098] Reference Figure 4As shown, an image upload control, i.e., a circular control including a plus sign, is provided on the graphical user interface of the image generation application, through which the original image to be uploaded can be selected. The electronic device 200 responds to the user's image confirmation upload operation for the three original images selected under the image upload control, and obtains the three original portraits uploaded by the user.
[0099] It should be noted that although the image generation scenario is described as an image generation application, a person of ordinary skill in the art should understand that the technical solution provided in the embodiments of this specification can also be applied to other appropriate image generation scenarios, such as image generation applets, image generation websites, etc., which are also within the scope of the embodiments of this specification.
[0100] In step S320, original portrait feature information corresponding to each original person is extracted from at least one original portrait.
[0101] In an example embodiment, the original portrait feature information includes gender information and age information. The electronic device 200 extracts the original portrait feature information corresponding to each original person from at least one original portrait through a portrait feature recognition model, and the portrait feature recognition model is a pre-trained face recognition model, such as a convolutional neural network model or a Transformer model.
[0102] For example, the electronic device 200 obtains at least one original portrait and performs cropping processing to obtain original portraits corresponding to each original person, and uses a pre-trained face recognition model to detect original portrait feature information in each original portrait, such as gender information and age information.
[0103] See also Figure 4 As shown, the electronic device 200 crops the three original portraits into three original head portraits, namely, head portrait 1, head portrait 2, and head portrait 3, and uses a pre-trained face recognition model to detect the gender and age information in each original head portrait, namely, head portrait 1: male 3-5 years old; head portrait 2: male 18-25 years old; head portrait 3: female 18-25 years old.
[0104] It should be noted that although the description is given using gender information and age information as an example, those skilled in the art should understand that the original portrait feature information may also include other appropriate information such as facial feature information, height information or body shape information, which is also within the scope of the embodiments of this specification.
[0105] In step S330, based on the original portrait feature information corresponding to each original person, a portrait feature code corresponding to at least one original portrait is generated.
[0106] In an example embodiment, the original portrait feature information includes gender information and age information. The portrait feature encoding is used to convert various features of the portrait feature information into numerical vectors. For example, the encoding corresponding to the gender information is M (Male) and F (Female). The encoding corresponding to the age information can be a specific age, or the user's age is divided into 7 age groups, namely "0-2", "3-5", "6-17", "18-25", "26-49", "50-69", and "70-100". According to the age group of the original age information of the user's uploaded avatar, it is mapped to the numbers 1-7.
[0107] The electronic device 200 encodes the original portrait feature information corresponding to each original person according to a predetermined encoding rule to obtain the original portrait feature code corresponding to each original person; combines the original portrait feature codes corresponding to each original person to generate an original portrait feature code corresponding to at least one original portrait.
[0108] In the exemplary embodiment, the original portrait feature information includes gender information and age information. The electronic device 200 determines the gender information and age information corresponding to each original portrait; encodes the gender information and age information corresponding to each original character according to a predetermined encoding rule to obtain the gender information code and age information code corresponding to each original character; the gender information code and age information code corresponding to each original character are combined to generate an original portrait feature code corresponding to at least one original portrait.
[0109] For example, assume that the preset coding rule is: the codes corresponding to male and female information are M and F, and the above 7 age groups are mapped to numbers 1-7. Figure 4 As shown, avatar 1: male 3-5 years old; avatar 2: male 18-25 years old; avatar 3: female 18-25 years old, the electronic device 200 encodes the gender information and age information of the original characters 1 to 3 according to the above-mentioned predetermined encoding rules, and obtains the original portrait feature code corresponding to each original character, namely avatar 1: M1; avatar 2: M4; avatar 3: F4; the original portrait feature codes corresponding to each original character are combined to generate the original portrait feature codes corresponding to 3 original portraits, namely M1M4F4, where M represents male, F represents female, 1 represents 3-5 years old, and 4 represents 18-25 years old.
[0110] Further, in the exemplary embodiment, at least one original portrait includes multiple original characters, and the electronic device 200 sorts the original portrait feature codes corresponding to each original character according to a predetermined code index order based on the gender information code and the age information code; combines the sorted original portrait feature codes corresponding to each original character to generate original portrait feature codes corresponding to multiple original characters. For example, encode each original character; sort and combine the codes of each original character according to the order of F>M and the increasing age range to obtain the original portrait feature codes corresponding to multiple original characters.
[0111] It should be noted that although the above-mentioned preset coding rules are used as an example for explanation, those skilled in the art should understand that the preset coding rules can also be other appropriate rules, such as using other letters to represent gender information or using other numbers to represent age information, etc., which is also within the scope of the embodiments of this specification.
[0112] In step S340, at least one matching portrait template is obtained from a plurality of preset portrait templates based on the portrait feature code and the template code.
[0113] In an example embodiment, the template encoding is an encoding of a template portrait feature of a portrait template, and the portrait template is used to generate a target portrait in combination with an original portrait. A portrait template refers to a preset pattern or framework for generating an image of a specific style or type, and a portrait template can be used to guide an image generation model to generate a portrait image that conforms to a certain artistic style, a specific theme, or a visual effect. The electronic device 200 matches the portrait feature encoding and the template encoding of the preset multiple portrait templates, and obtains at least one matching portrait template from the preset multiple portrait templates based on the matching result.
[0114] For example, the electronic device 200 searches for a target template code corresponding to the original portrait feature code from a preset template code index corresponding to multiple first portrait templates based on the original portrait feature code; and obtains at least one matching portrait template from the multiple first portrait templates based on the target template code. For example, the template codes of the portrait templates in the multiple first portrait templates are sorted in advance, and the template codes corresponding to the sorted multiple portrait templates form a template code index. Suppose the original portrait feature code is M1M4F4, and the target template code corresponding to M1M4F4 is searched from the preset template code index corresponding to the multiple first portrait templates; and at least one matching portrait template is obtained from the multiple first portrait templates based on the target template code.
[0115] Further, in the exemplary embodiment, the portrait template is used to generate a target portrait in combination with the original portrait. After obtaining the matching portrait template, the electronic device 200 generates the target portrait in combination with the portrait template and the portrait characteristic information of the original portrait, such as facial feature information. For example, the electronic device 200 fuses the facial feature information of the original portrait with the image of the portrait template to generate a new target image, which contains the features of the portrait template while retaining the facial features of the original portrait.
[0116] according to Figure 3 The technical solution in the example embodiment, on the one hand, generates an original portrait feature code corresponding to at least one original portrait based on the original portrait feature information corresponding to each original character in at least one uploaded original portrait, which can efficiently encode the portrait features in the original portrait, such as age, gender; on the other hand, based on the original portrait feature code and the template code, obtains at least one matching portrait template from multiple preset portrait templates, quickly and accurately obtains a portrait template that meets the user's needs from a large number of portrait templates, and greatly saves the user's time in searching for portrait templates; on the other hand, since the target portrait can be generated by combining the portrait template with the original portrait, it is possible to quickly generate images of various styles that meet the user's needs.
[0117] Further, in an example embodiment, before obtaining a matching portrait template from a plurality of preset portrait templates, the electronic device 200 determines template portrait feature information of each template character in the portrait template; encodes the template portrait feature information according to a predetermined encoding rule to obtain a template portrait feature code corresponding to each template character; based on the template portrait feature code, the portrait feature codes corresponding to each template character are sorted and combined according to a predetermined encoding index order to obtain a template code corresponding to each portrait template, wherein the template codes corresponding to the sorted plurality of portrait templates form a template code index.
[0118] For example, the electronic device 200 determines the gender and age information of each template character in the portrait template, and encodes each template character of the portrait template according to the seven age ranges of "0-2", "3-5", "6-17", "18-25", "26-49", "50-69", and "70-100" mapped to numbers 1-7, and males are mapped to "M" and females are mapped to "F"; the codes of each template character are sorted and combined in the order of F>M and in ascending order of age range to obtain the template code corresponding to the portrait template.
[0119] According to the technical solution in the above-mentioned example embodiment, by encoding the portrait feature information of each template character of the portrait template, such as age and gender information, and sorting and combining the codes of each template character, the template code corresponding to each portrait template can be obtained, and then the template code index of multiple portrait templates can be generated, thereby facilitating efficient retrieval of the portrait templates.
[0120] In addition, in some example embodiments, the original portrait feature information also includes facial characteristic information. The electronic device 200 crops the original portrait to obtain a head portrait corresponding to each original person; and extracts the facial feature information of the head portrait corresponding to each original person through a portrait feature recognition model.
[0121] Furthermore, the electronic device 200 combines the facial feature information of the portrait template and the original portrait to generate a target portrait. For example, the electronic device 200 fuses the facial feature information of the original portrait with the image of the portrait template to generate a new target image, which contains the features of the portrait template while retaining the facial features of the original portrait.
[0122] According to the technical solution in the above example embodiment, the facial feature information of each original person is extracted through the portrait feature recognition model, and the target portrait can be generated by combining the portrait template and the facial feature information of the original portrait.
[0123] Figure 5 A schematic diagram of an interface for editing character information provided according to some embodiments of this specification is shown;
[0124] In an example embodiment, after extracting original portrait feature information corresponding to each original person from at least one original portrait, the electronic device 200 presents the original portrait feature information corresponding to each original person on a graphical user interface; in response to an information change operation on the original portrait feature information corresponding to the original person, the original portrait feature information corresponding to the original person is changed.
[0125] Reference Figure 5 As shown, the original portrait feature information includes gender information and age information. In response to the user's click operation on the target person's portrait, the electronic device 200 presents a character information editing control corresponding to the target original person on the graphical user interface. The character information editing control provides a variety of optional task information, such as female, male, 0-2 years old, 3-5 years old, 6-17 years old, 18-25 years old, etc.; in response to the information change operation on the original portrait feature information corresponding to the target original person; the original portrait feature information corresponding to the original person is changed, for example, 3-5 years old is changed to 6-17 years old.
[0126] according to Figure 5The technical solution in the example embodiment changes the original portrait feature information corresponding to the original person in response to the information change operation, can modify the result of algorithm recognition through the editing operation, and can more accurately obtain the characteristic information of the original portrait, such as age information.
[0127] Figure 6 A schematic diagram of an interface for selecting a portrait template provided according to some embodiments of the present specification is shown.
[0128] In an exemplary embodiment, after obtaining at least one matching portrait template from multiple preset portrait templates, the electronic device 200 distinctively presents at least one portrait template on the graphical user interface; in response to a template selection operation for a target portrait template, the selected target portrait template is determined.
[0129] For example, the electronic device determines the historical selection probability of each portrait template; based on the size of the historical selection probability, it distinctively presents at least one portrait template on the graphical user interface of the image generation scene, for example, the portrait template ranked first in the historical selection probability is magnified and presented in the center of the graphical user interface.
[0130] Reference Figure 6 As shown, three portrait templates are presented on the graphical user interface of the image generation scene, namely, portrait template 1, portrait template 2, and portrait template 3, among which portrait template 2 has the highest historical selection probability and is magnified and presented in the center. In response to the user's sliding operation, the portrait template displayed in the center can be switched.
[0131] according to Figure 6 The technical solution in the example embodiment of the embodiment distinctively presents at least one portrait template on the graphical user interface, for example, in an enlarged manner, so that the user can select a target portrait template, which can help the user obtain a portrait template that meets the user's needs faster and more accurately.
[0132] Figure 7 A schematic diagram of an interface for selecting a puzzle template provided according to some embodiments of the present specification is shown.
[0133] In order to ensure user experience, when the current portrait template cannot match a portrait template that meets user feature information such as user age and gender information, a target portrait is generated by splicing single images in a puzzle template. Assume that the first portrait template is a common template and the second portrait template is a puzzle template. In an example embodiment, if a portrait template is not matched from multiple first portrait templates; the electronic device 200 searches for a portrait template corresponding to the number of people information from multiple preset second portrait templates based on the number of people information corresponding to at least one original portrait, wherein the second portrait template is a puzzle template. A puzzle template is a portrait template formed by splicing multiple single portrait templates.
[0134] For example, the electronic device 200 generates a number code corresponding to at least one original portrait based on the number of people information corresponding to at least one original portrait; based on the number code, searches for a target number code corresponding to the number information from the number code indexes of the preset multiple second portrait templates; based on the target number code, obtains at least one matching portrait template from the multiple second portrait templates. For example, the number of people is pre-assembled according to the number of people included in the template, with "SLOT_" as a prefix, to obtain a template code. For example, SLOT_3 represents a puzzle template with 3 people. The electronic device 200 generates a number code corresponding to at least one original portrait, namely SLOT_3, based on the number information 3 corresponding to the 3 original portraits; based on the number code SLOT_3, searches for a target number code SLOT_3 corresponding to the number information from the number code indexes of the preset multiple second portrait templates.
[0135] According to the technical solution in the above-mentioned example embodiment, when the first portrait template is not matched, the second portrait template, i.e., the puzzle template, is matched according to the recognition information, so that the portrait template can be obtained by matching the number of people information when an accurate match is not possible, thereby ensuring that the portrait template can be matched in various extreme situations.
[0136] Further, in an exemplary embodiment, the original portrait feature information includes facial characteristic information, and the electronic device 200 generates a character puzzle image corresponding to each original character in at least one original portrait based on the facial feature information corresponding to each original character in at least one original portrait and the second portrait template. For example, the electronic device 200 merges the facial feature information of the original portrait with each sub-puzzle image of the puzzle template to generate a new target image, and the target image contains the features of each sub-puzzle of the puzzle template while retaining the facial features of each original portrait.
[0137] Reference Figure 7 As shown, the electronic device 200 generates a puzzle image corresponding to each of the original characters in the three original portraits based on the facial feature information corresponding to each of the original characters in the three original portraits and a second portrait template, namely, puzzle template 2. Puzzle template 2 includes three sub-puzzle portraits 1 to 3 spliced together.
[0138] According to the technical solution in the above-mentioned example embodiment, when the current portrait template cannot be matched to a portrait template that satisfies user characteristic information such as user age and gender information, the target portrait is generated by splicing single images in the puzzle template, which can ensure that the target image can be generated in various extreme situations.
[0139] Figure 8 A schematic diagram of a process for generating a portrait feature code according to some embodiments of this specification is shown.
[0140] Reference Figure 8 As shown, after the user's uploaded image is recognized by the portrait feature recognition model and manually adjusted by the user, the electronic device 200 can obtain the original portrait feature information of N cropped avatars, such as gender, age, and other algorithm feature information such as facial feature information, and search for a portrait template suitable for the user based on the original portrait feature information. The portrait feature recognition model is a pre-trained face recognition model, such as a convolutional neural network model or a Transformer model.
[0141] See also Figure 4 As shown, the electronic device 200 crops the three original portraits into three original head portraits, namely, head portrait 1, head portrait 2, and head portrait 3, and uses a pre-trained face recognition model to detect the gender and age information in each original head portrait, namely, head portrait 1: male 3-5 years old; head portrait 2: male 18-25 years old; head portrait 3: female 18-25 years old.
[0142] In the example embodiment, two matching schemes are provided: a common template and a puzzle template. The two matching schemes are described in detail below:
[0143] (1) Ordinary template: The electronic device 200 encodes the original portrait feature information corresponding to each cropped portrait, such as gender information and age information, according to a predetermined encoding rule to obtain the original portrait feature code corresponding to each original person; and combines the original portrait feature codes corresponding to each original person to generate an original portrait feature code corresponding to at least one original portrait.
[0144] For example, assume that the preset coding rule is: the codes corresponding to male and female information are M and F, and the above 7 age groups are mapped to numbers 1-7. Figure 4 As shown, avatar 1: male 3-5 years old; avatar 2: male 18-25 years old; avatar 3: female 18-25 years old, the electronic device 200 encodes the gender information and age information of the original characters 1 to 3 according to the above-mentioned predetermined encoding rules, and obtains the original portrait feature code corresponding to each original character, namely avatar 1: M1; avatar 2: M4; avatar 3: F4; the original portrait feature codes corresponding to each original character are combined to generate the original portrait feature codes corresponding to 3 original portraits, namely M1M4F4, where M represents male, F represents female, 1 represents 3-5 years old, and 4 represents 18-25 years old.
[0145] Reference Figure 8As shown, the electronic device 200 encodes the cropped user-uploaded avatar according to the following steps: 1. According to the gender of the avatar, the gender information of the user-uploaded avatar is mapped to "F" (Female) and "M" (Male), respectively; 2. The user's age is divided into 7 age groups, namely "0-2", "3-5", "6-17", "18-25", "26-49", "50-69", and "70-100", and mapped to 1-7 according to the age group of the user-uploaded avatar, that is, 0-2 is mapped to 1, 2-5 is mapped to 2, 6-17 is mapped to 3, 18-25 is mapped to 4, 26-49 is mapped to 5, 50-69 is mapped to 6, and 70-100 is mapped to 7.
[0146] Furthermore, after obtaining the template portrait feature codes corresponding to each template character, the electronic device 200 sorts and combines the portrait feature codes corresponding to each template character in a predetermined coding index order based on the template portrait feature codes to obtain the template codes corresponding to each portrait template, wherein the template codes corresponding to the sorted multiple portrait templates form a template coding index.
[0147] For example, the electronic device 200 determines the gender and age information of each template character in the portrait template, and encodes each template character of the portrait template according to the seven age ranges of "0-2", "3-5", "6-17", "18-25", "26-49", "50-69", and "70-100" mapped to numbers 1-7, and males are mapped to "M" and females are mapped to "F"; the codes of each template character are sorted and combined in the order of F>M and in ascending order of age range to obtain the template code corresponding to the portrait template.
[0148] Reference Figure 8 As shown, after the encoding results of the original portrait feature codes of N avatars are obtained, the original portrait feature codes of each avatar are sorted and combined in the ascending order of F>M and 1-7 to obtain the final original portrait feature codes of multiple avatars.
[0149] Furthermore, the electronic device 200 matches the portrait feature code with the template codes of the preset multiple portrait templates, and obtains at least one matched portrait template from the preset multiple portrait templates based on the matching result.
[0150] For example, the electronic device 200 searches for a target template code corresponding to the original portrait feature code from a preset template code index corresponding to multiple first portrait templates based on the original portrait feature code; and obtains at least one matching portrait template from the multiple first portrait templates based on the target template code. For example, the template codes of the portrait templates in the multiple first portrait templates are sorted in advance, and the template codes corresponding to the sorted multiple portrait templates form a template code index. Suppose the original portrait feature code is M1M4F4, and the target template code corresponding to M1M4F4 is searched from the preset template code index corresponding to the multiple first portrait templates; and at least one matching portrait template is obtained from the multiple first portrait templates based on the target template code.
[0151] In addition, in an example embodiment, the electronic device determines the historical selection probability of each portrait template; based on the size of the historical selection probability, at least one portrait template is distinctively presented on the graphical user interface of the image generation scene. For example, according to the size of the historical selection probability, 5 portrait templates are selected for the user to choose from, and the portrait template ranked first in the historical selection probability is presented in an enlarged manner in the center of the graphical user interface.
[0152] (2) Jigsaw template solution: In the ordinary template matching stage, if no portrait template can be matched, the jigsaw template matching process will be automatically entered: the electronic device 200 generates a number code corresponding to at least one original portrait based on the number of people information corresponding to at least one original portrait; based on the number code, the target number code corresponding to the number of people information is searched from the preset number code index of multiple second portrait templates; based on the target number code, at least one matching portrait template is obtained from multiple second portrait templates. For example, the number of people included in the template is pre-assembled with "SLOT_" as a prefix to obtain a template code. For example, SLOT_3 represents a jigsaw template with 3 people. The electronic device 200 generates a number code corresponding to at least one original portrait, i.e., SLOT_3, based on the number of people information 3 corresponding to the 3 original portraits; based on the number code SLOT_3, the target number code SLOT_3 corresponding to the number information is searched from the preset number code index of multiple second portrait templates.
[0153] according to Figure 8The technical solution in the example embodiment, on the one hand, encodes the age and gender of the portrait uploaded by the user, and directly maps the encoded result to the pre-set available portrait template by indexing, so as to accurately and efficiently recommend a portrait template that meets the user's needs to the user, and then the user makes the final choice, which greatly saves the user's time in searching for portrait templates; on the other hand, the age and gender information of the portrait is obtained through the portrait recognition algorithm and displayed to the user. At the same time, the user can modify the result of the algorithm recognition through editing operations, so as to more accurately obtain the characteristic information of the original portrait, such as age information.
[0154] On the other hand, the present specification provides a non-transitory storage medium storing at least one set of executable instructions for image processing. When the executable instructions are executed by a processor, the executable instructions instruct the processor to implement the steps of the image processing method described in the present specification. In some possible implementations, various aspects of the present specification can also be implemented in the form of a program product, which includes a program code. When the program product is run on an electronic device 200, the program code is used to enable the electronic device 200 to perform the steps of the image processing method described in the present specification. The program product for implementing the above method can use a portable compact disk read-only memory (CD-ROM) to include program code and can be run on the electronic device 200. However, the program product of the present specification is not limited to this. In the present specification, the readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system or used in combination with it. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media include: an electrical connection with one or more conductors, a portable 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. The computer-readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above. Program code for performing the operations of the present specification may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the electronic device 200, partially on the electronic device 200, as a separate software package, partially on the electronic device 200 and partially on a remote computing device, or entirely on a remote computing device.
[0155] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require a specific order or a continuous order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0156] In summary, after reading this detailed disclosure, those skilled in the art will appreciate that the foregoing detailed disclosure may be presented only by way of example and may not be limiting. Although not explicitly stated herein, those skilled in the art will appreciate that this specification requires various reasonable changes, improvements and modifications to the embodiments. These changes, improvements and modifications are intended to be proposed by this specification and are within the spirit and scope of the exemplary embodiments of this specification.
[0157] In addition, certain terms in this specification have been used to describe embodiments of this specification. For example, "one embodiment", "an embodiment" and / or "some embodiments" mean that a particular feature, structure or characteristic described in conjunction with the embodiment may be included in at least one embodiment of this specification. Therefore, it can be emphasized and should be understood that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in various parts of this specification do not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics may be appropriately combined in one or more embodiments of this specification.
[0158] It should be understood that in the foregoing description of the embodiments of this specification, in order to help understand a feature and for the purpose of simplifying this specification, this specification combines various features in a single embodiment, figure or its description. However, this does not mean that the combination of these features is necessary. When reading this specification, it is entirely possible for a person skilled in the art to mark out some of the devices as separate embodiments. In other words, the embodiments in this specification can also be understood as the integration of multiple secondary embodiments. This is also true when the content of each secondary embodiment is less than all the features of a single aforementioned disclosed embodiment.
[0159] Each patent, patent application, patent application publication, and other material, such as articles, books, specifications, publications, documents, articles, etc., cited herein may be incorporated herein by reference in its entirety for all purposes, except for any prosecution document history related thereto, any equivalent that may be inconsistent or conflicting with this document, or any equivalent prosecution document history that may have a limiting effect on the broadest scope of the claims now or later associated with this document. For example, if there is any inconsistency or conflict between the description, definition, and / or use of a term associated with any of the incorporated materials and the term, description, definition, and / or use associated with this document, the term in this document shall control.
[0160] Finally, it should be understood that the embodiments of the application disclosed herein are explanations of the principles of the embodiments of this specification. Other modified embodiments are also within the scope of this specification. Therefore, the embodiments disclosed in this specification are only used as examples and not as limitations. Those skilled in the art can adopt alternative configurations according to the embodiments in this specification to implement the applications in this specification. Therefore, the embodiments of this specification are not limited to the embodiments accurately described in the application.
Claims
1. An image processing method, comprising: In response to an image upload operation in the graphical user interface, obtaining at least one uploaded original portrait; Extracting original portrait feature information corresponding to each original person from the at least one original portrait; Based on the original portrait feature information corresponding to each of the original characters, generating an original portrait feature code corresponding to the at least one original portrait; Based on the original portrait feature code and the template code, at least one matching portrait template is obtained from multiple preset portrait templates, wherein the template code is a code of the template portrait feature of the pre-generated portrait template, and the portrait template is used to generate a target portrait in combination with the original portrait.
2. The method according to claim 1, wherein: The acquiring at least one matching portrait template from a plurality of preset portrait templates based on the original portrait feature code and the template code comprises: Based on the original portrait feature code, searching for a target template code corresponding to the original portrait feature code from template code indexes corresponding to a plurality of preset first portrait templates; Based on the target template code, at least one matching portrait template is acquired from the multiple first portrait templates.
3. The method according to claim 2, wherein: Before acquiring a matching portrait template from a plurality of preset portrait templates, the method further includes: Determining template portrait feature information of each template character in the portrait template; Encoding the template portrait feature information according to a predetermined encoding rule to obtain the template portrait feature code corresponding to each template character; Based on the template portrait feature codes, the portrait feature codes corresponding to the template characters are sorted and combined according to a predetermined code index order to obtain template codes corresponding to the portrait templates. The template codes corresponding to the sorted multiple portrait templates form the template code index.
4. The method according to claim 1, wherein: The step of generating an original portrait feature code corresponding to the at least one original portrait based on the original portrait feature information corresponding to each of the original characters includes: Encoding the original portrait feature information corresponding to each of the original characters according to a predetermined encoding rule to obtain the original portrait feature code corresponding to each of the original characters; The original portrait feature codes corresponding to the original characters are combined to generate an original portrait feature code corresponding to the at least one original portrait.
5. The method according to claim 4, wherein: The original portrait feature information includes gender information and age information. The original portrait feature information corresponding to each original person is encoded according to a predetermined encoding rule to obtain the original portrait feature code corresponding to each original person, including: Determine the gender information and age information corresponding to each of the original portraits; The gender information and age information corresponding to each of the original characters are encoded according to a predetermined encoding rule to obtain the gender information code and age information code corresponding to each of the original characters.
6. The method according to claim 4, wherein: The at least one original portrait includes a plurality of original persons, and the original portrait feature codes corresponding to the original persons are combined to generate the original portrait feature code corresponding to the at least one original portrait, including: Based on the gender information code and age information code, the original portrait feature codes corresponding to the original characters are sorted according to a predetermined code index sequence; The sorted original portrait feature codes corresponding to the original characters are combined to generate original portrait feature codes corresponding to the multiple original characters.
7. The method according to claim 2, wherein: The method further comprises: If the portrait template is not matched from the multiple first portrait templates; Then, according to the number of people information corresponding to the at least one original portrait, a portrait template corresponding to the number of people information is searched from a plurality of preset second portrait templates, wherein the second portrait template is a jigsaw template.
8. The method according to claim 7, wherein: The original portrait feature information includes facial characteristic information, and the method further includes: Based on the facial feature information corresponding to each original character in the at least one original portrait and the second portrait template, a character puzzle image corresponding to each original character in the at least one original portrait is generated.
9. The method according to claim 7, wherein: The searching, according to the number of people information corresponding to the at least one original portrait, from a plurality of preset second portrait templates for a portrait template corresponding to the number of people information, comprises: generating a number code corresponding to the at least one original portrait according to the number of people information corresponding to the at least one original portrait; Based on the number of people code, searching for a target number of people code corresponding to the number of people information from a plurality of preset number of second portrait templates' number code indexes; Based on the target number of people code, at least one matching portrait template is obtained from the multiple second portrait templates.
10. The method according to claim 1, wherein: After extracting original portrait feature information corresponding to each original person from the at least one original portrait, the method further includes: Presenting the original portrait feature information corresponding to each of the original characters on the graphical user interface; In response to an information changing operation on the original portrait feature information corresponding to the original person, the original portrait feature information corresponding to the original person is changed.
11. The method according to claim 1, wherein: After acquiring at least one matching portrait template from the preset multiple portrait templates, the method further includes: Distinctive presentation of at least one of the portrait templates on the graphical user interface; In response to the template selection operation for the target portrait template, a selected target portrait template is determined.
12. The method according to claim 11, wherein: The distinctively presenting at least one portrait template on the graphical user interface comprises: Determine the historical selection probability of each of the portrait templates; Based on the size of the historical selection probability, at least one of the portrait templates is distinctively presented on the graphical user interface.
13. The method according to claim 1, wherein: The original portrait feature information includes gender information and age information, and the extracting of the original portrait feature information corresponding to each original person from the at least one original portrait includes: The original portrait feature information corresponding to each original person is extracted from the at least one original portrait by a portrait feature recognition model, wherein the portrait feature recognition model is a pre-trained face recognition model.
14. The method according to claim 13, wherein: The original portrait feature information also includes facial characteristic information, and the extracting the original portrait feature information corresponding to each original person from the at least one original portrait by using the portrait feature recognition model includes: The original portraits are cropped to obtain portraits corresponding to the original characters; The facial feature information of the head portraits corresponding to the original characters is extracted through the portrait feature recognition model.
15. An electronic device, comprising: at least one storage medium storing at least one instruction set for performing image processing; as well as at least one processor, in communication with the at least one storage medium, Wherein, when the electronic device is running, the at least one processor reads the at least one instruction set and executes the image processing method according to any one of claims 1 to 14 according to the instructions of the at least one instruction set.
