WO2023072015A1 - 人物风格形象图的生成方法、装置、设备及存储介质 - Google Patents
人物风格形象图的生成方法、装置、设备及存储介质 Download PDFInfo
- Publication number
- WO2023072015A1 WO2023072015A1 PCT/CN2022/127195 CN2022127195W WO2023072015A1 WO 2023072015 A1 WO2023072015 A1 WO 2023072015A1 CN 2022127195 W CN2022127195 W CN 2022127195W WO 2023072015 A1 WO2023072015 A1 WO 2023072015A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- character
- map
- style
- character image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—Two-dimensional [2D] image generation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—Two-dimensional [2D] image generation
- G06T11/60—Creating or editing images; Combining images with text
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T9/00—Image coding
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
- G06V40/171—Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
Definitions
- Embodiments of the present disclosure relate to the technical field of image processing, for example, to a method, device, device, and storage medium for generating a character style image map.
- Embodiments of the present disclosure provide a method, device, device, and storage medium for generating a character style image map, which can generate a character image map with a set style, thereby increasing the diversity of images.
- An embodiment of the present disclosure provides a method for generating a character style image map, including:
- the initial character style image map is fused into the template map to obtain a target character style image map.
- the embodiment of the present disclosure also provides a device for generating a character style image map, including:
- the first character image feature code acquisition module is configured to input the original character image map into the first feature encoder to obtain the first character image feature code
- the attribute increment determination module is configured to obtain the attribute increment between the original character image map and the template map;
- the second character image feature code acquisition module is configured to input the second character image feature code to the attribute increment and the first character image feature code to obtain the second character image feature code;
- the initial character style image acquisition module is configured to input the second character image feature code into the style image generation model to obtain the initial character style image
- the target character style image acquisition module is configured to integrate the initial character style image into the template map to obtain the target character style image.
- An embodiment of the present disclosure also provides an electronic device, and the electronic device includes:
- a storage device configured to store one or more programs
- the one or more processing devices When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the method for generating a character style image map according to the embodiments of the present disclosure.
- the embodiment of the present disclosure also provides a computer-readable medium on which a computer program is stored, and when the program is executed by the processing device, the method for generating the character style image map as described in the embodiment of the present disclosure is realized.
- FIG. 1 is a flow chart of a method for generating a character style image map in an embodiment of the disclosure
- FIG. 2 is an example diagram of a training character image generation model in an embodiment of the present disclosure
- Fig. 3 is an example diagram of training a first feature encoder in an embodiment of the present disclosure
- Fig. 4 is an example diagram of training a second feature encoder in an embodiment of the present disclosure
- Fig. 5 is an image of a character style in an embodiment of the present disclosure
- Fig. 6 is an example diagram of a training style image generation model in an embodiment of the present disclosure.
- Fig. 7a is a template diagram of setting style in the embodiment of the present disclosure.
- Fig. 7b is a template diagram of another setting style in the embodiment of the present disclosure.
- Fig. 7c is a template diagram of another setting style in the embodiment of the present disclosure.
- Fig. 7d is a template diagram of another setting style in the embodiment of the present disclosure.
- Fig. 8 is an example diagram of a panning character style image in an embodiment of the present disclosure.
- Fig. 9 is a schematic structural diagram of a device for generating a character style image in an embodiment of the present disclosure.
- Fig. 10 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
- the term “comprise” and its variations are open-ended, ie “including but not limited to”.
- the term “based on” is “based at least in part on”.
- the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
- Fig. 1 is a flow chart of a method for generating a character style image map provided by an embodiment of the present disclosure.
- This embodiment is applicable to the case of converting a character image into a set style, and the method can be performed by a device for generating a character style image map
- the device can be composed of hardware and/or software, and can generally be integrated into a device with the function of generating a character style image map, which can be an electronic device such as a server, a mobile terminal, or a server cluster.
- the method includes the following steps:
- Step 110 Input the original character image image into the first feature encoder to obtain the first character image feature code.
- the original character image image may be an image containing a character image, and may be obtained through a camera of a terminal device, or obtained from a database.
- the first feature encoder can encode the input character image image to obtain the first character image feature code.
- the first character image feature code can be represented by a multidimensional matrix.
- the first feature encoder is composed of a set neural network, and is obtained through training of character image sample images.
- the training method of the first feature encoder can be as follows: obtaining a character image sample map; inputting the character image sample map into the first feature encoder to be trained to obtain the character image feature encoding of the first sample; Encoding is input into the character image generation model to obtain the first reconstructed character image; based on the loss function between the first reconstructed character image and the character image sample image, the first feature encoder to be trained is trained to obtain the first feature encoder.
- the character image generation model may be a model obtained after training the generation confrontation network.
- FIG. 2 is an example diagram of training a character image generation model in this embodiment.
- the training method of the character image generation model is: cross-iterative training is performed on the generation model and the discriminant model, until the accuracy of the discriminant result output by the discriminant model meets the set conditions, then the trained generative model is determined as a character image generation model.
- the process of cross iterative training is as follows: input the first random noise data into the generation model to obtain the first character image map; input the first character image map and the first character image sample map into the discriminant model to obtain the first discriminant result; Adjusting the parameters in the generation model with the result of discrimination; inputting the second random noise data into the adjusted generation model to obtain a second character image map; inputting the second character image map and the second character image sample map into the discrimination model to obtain a second discrimination model result, and determine the real discriminant result between the second character image map and the second character image sample map; adjust the parameters in the discriminant model according to the loss function between the second discriminant result and the real discriminant result.
- the first character image sample image and the second character image sample image are sample images of the acquired character image sample images.
- the first feature encoder is trained based on a trained character image generation model.
- FIG. 3 is an example diagram of training the first feature encoder in this embodiment.
- the character image sample image is input into the first feature encoder to be trained to encode the character image sample image, and the first sample character image feature code is output, and then the first sample character image feature Encode the input character image generation model, output the first reconstructed character image image, and finally train the first feature encoder to be trained based on the loss function between the first reconstructed character image image and the character image sample image, and obtain the first feature encoder .
- Step 120 determine the attribute increment between the original character image map and the template map.
- Attributes can include the image's deflection angle, age, hair color, gender, and whether eyes are open.
- a template image can be an image that matches the character's style. For example: assuming that the character style is "Halloween", the template image is an image matching the "Halloween” style.
- the method of determining the attribute increment between the original character image map and the template map may be: input the original character image map into the attribute recognizer, output character attribute information, input the template map into the attribute recognizer, and obtain the template attributes information, calculate the difference between the character attribute information and the template attribute information, and the attribute increment can be obtained.
- the attribute recognizer may be constructed based on a set neural network.
- Step 130 input the attribute increment and the first character image feature code into the second feature encoder to obtain the second character image feature code.
- the second character image feature encoding can be understood as a character image feature encoding with attribute incremental information added.
- the second feature encoder can encode the input attribute increment and the first character image feature code to obtain the second character image feature code.
- the second character image feature code can be represented by a multidimensional matrix.
- the second feature encoder may be obtained based on the trained character image generation model and the first feature encoder.
- the training process of the character image generation model and the first feature encoder refer to the above-mentioned embodiments, which will not be repeated here.
- the training method of the second feature encoder is as follows: obtain a character image sample image; input the character image sample image into the first feature encoder to obtain the character image feature code of the second sample, and input the character image feature code of the second sample into the character image generation model In the process, obtain the second reconstructed character image map; input the second sample character image feature code and the real attribute increment into the second feature encoder to be trained to obtain the third sample character image feature code; encode the third sample character image feature code Enter the character image generation model to obtain the edited character image map; determine the predicted attribute increment between the second reconstructed character image map and the edited character image map; treat the first training based on the loss function between the predicted attribute increment and the real attribute increment
- the second feature encoder is trained to obtain the second feature encoder.
- the character image sample diagram may be a large number of character image diagrams from different angles or under different light conditions.
- the method of determining the predicted attribute increment between the second reconstructed character image map and the edited character image map may be: respectively input the second reconstructed character image map and the edited character image map into the attribute recognizer, obtain the attribute information of the two, and then calculate The difference between the two attribute information, so as to obtain the predicted attribute increment.
- Fig. 4 is an example diagram of training the second feature encoder in this embodiment.
- Step 140 input the second character image feature code into the style image generation model to obtain an initial character style image map.
- the style image generation model can transform the person image into a person image with a set style.
- the set style may be a "Halloween” style.
- FIG. 5 is a character style image diagram in this embodiment. As shown in FIG. 5, the eyes, mouth, skin, and hair in the portrait image have been processed in a "Halloween” style, so that the character The image has a "Halloween” style.
- the style image generation model may be obtained through training based on a trained character image generation model.
- a trained character image generation model For the training process of the character image generation model, reference may be made to the above-mentioned embodiments, which will not be repeated here.
- Fig. 6 is an example diagram of the training style image generation model in this embodiment.
- the training method of the style image generation model is: cross-iterative training is performed on the character image generation model and the character image discrimination model until the character If the accuracy of the discrimination result output by the image discrimination model satisfies the set condition, the trained character image generation model is determined as the style image generation model.
- the process of cross-iterative training is as follows: obtain the sample image of the character image of the set style; input the first random noise data into the image generation model to obtain the image image of the first style; Inputting the figure into the character image discrimination model to obtain a first discrimination result; adjusting parameters in the character image generation model based on the first discrimination result; inputting the second random noise data into the adjusted character image generation model to obtain a second style character image diagram; Inputting the second-style character image map and the set-style character image sample map into the character image discrimination model to obtain the second discrimination result, and determine the true discrimination result between the second-style character image map and the set-style character image sample map; according to The loss function between the second discrimination result and the real discrimination result adjusts the parameters in the person discrimination model.
- the character image sample image of the set style can be a character image image with a "Halloween” style, which can be obtained by rendering or retouching a virtual character.
- Step 150 merging the initial character style image map into the template map to obtain the target character style image map.
- Template images can be images that match the set style. For example: assuming that the set style is "Halloween”, the template image is an image matching the "Halloween” style.
- FIG. 7a-FIG. 7d are template diagrams for setting styles. Figures 7a-7d are style pictures matching the style of "Halloween", and the number of characters is changed from 1 to 4.
- the process of merging the initial character style image image into the template image to obtain the target character style image image may be: translating the position of the character style image in the initial character style image image; The image is fused into the template image to obtain the style image image of the target character.
- the character style image may be translated to the center of the initial character style image map.
- the method of translating the character style image in the initial character style image map to the center of the initial character style image map may be: aligning the central key point of the character style image with the center point of the initial character style image map.
- the way to translate the character style image in the initial character style image map to the center of the initial character style image map may be: obtain the vertical standard line and horizontal standard line of the initial character style image map; extract the initial character style image map The central key point and the corner key point of the character's style image; determine the distance difference between the vertical coordinates of the central key point and the vertical standard line, and determine the distance difference between the vertical coordinates of the central key point and the vertical standard line as the first Distance difference: Determine the distance difference between the horizontal coordinates of the key points of the mouth corner and the horizontal standard line, and determine the distance difference between the horizontal coordinates of the key points of the mouth corner and the horizontal standard line as the second distance difference; translate the character along the vertical direction according to the first distance difference A style image, translating the character style image along the horizontal direction according to the second distance difference, so as to translate the character style image to the center of the initial character style image map.
- FIG. 8 is an example diagram of panning a character's style image in this embodiment.
- the initial character style image size is 512*512
- the world coordinate system is established with the upper left corner vertex of the initial character style image size as the origin
- the process of merging the initial character style image into the template image to obtain the target character style image may be: identifying the template character image in the template image to obtain a recognition rectangle; cutting the initial character style image according to the recognition rectangle It is an image of a set size; paste the image of the set size into the recognition rectangle frame; obtain the character image mask map of the template image; fuse the image of the set size pasted into the recognition rectangle frame based on the character image mask map Go to the template diagram to obtain the style image diagram of the target character.
- the set size may be determined by the size of the recognition rectangle, that is, the size of the cropped initial character style image is the same as the size of the recognition rectangle.
- the character image mask map can be understood as a binary map formed by the area surrounded by the template character image in the template map, for example, the image surrounded by the white area in Fig. 7a-7b is the character image mask map.
- the method of pasting the image with the set size to the recognition rectangle may be: align the upper left vertex of the image with the set size with the upper left vertex of the recognition rectangle.
- R is the pixel matrix of the target character style image image
- mask is the pixel matrix of the character image mask image
- output is the pixel matrix of the image with the set size
- template is the pixel matrix of the template image.
- the original character image map is input into the first feature encoder to obtain the first character image feature code; the attribute increment between the original character image map and the template map is determined; the attribute increment and the first character Input the image feature code into the second feature encoder to obtain the second character image feature code; input the second character image feature code into the style image generation model to obtain the initial character style image map; merge the initial character style image map into the In the template diagram, the style image diagram of the target character is obtained.
- the method for generating a character style image map provided by an embodiment of the present disclosure can generate a character image map with a set style, thereby increasing the diversity of images.
- FIG. 9 is a schematic structural diagram of an apparatus for generating a character style image map disclosed in an embodiment of the present disclosure.
- the device includes: a first character image feature code acquisition module 210, configured to input the original character image map into the first feature encoder to obtain the first character image feature code; an attribute increment determination module 220, set In order to obtain the attribute increment between the original character image map and the template map; the second character image feature code acquisition module 230 is set to input the attribute increment and the first character image feature code into the second feature encoder to obtain the second character image Feature coding; the initial character style image acquisition module 240 is set to input the second character image feature code into the style image generation model to obtain the initial character style image; the target character style image acquisition module 250 is set to input the initial character style image The image is fused into the template image to obtain the style image image of the target character.
- the target character style image acquisition module 250 is set to: translate the character style image in the initial character style image image to the center of the image; merge the translated initial character style image image into the template image to obtain the target Character style image map.
- the target character style image acquisition module 250 is configured to translate the character style image in the initial character style image map to the center of the image in the following manner: obtain the vertical standard line and horizontal standard line of the initial character style image map; Extract the central key point and mouth corner key point of the character style image in the initial character style image image; determine the distance difference between the vertical coordinates of the central key point and the vertical standard line, and compare the vertical coordinates of the central key point with the vertical The distance difference of the straight standard line is determined as the first distance difference; determine the distance difference between the horizontal coordinates of the corner of the mouth key point and the horizontal standard line, and determine the distance difference between the horizontal coordinates of the corner of the mouth key point and the horizontal standard line as the second Distance difference; according to the first distance difference, the character style image is translated along the vertical direction, and according to the second distance difference, the character style image is translated along the horizontal direction, so as to translate the character style image to the center of the image.
- the target character style image acquisition module 250 is set to: identify the template character image in the template image to obtain a recognition rectangle; cut the initial character style image into an image of a set size according to the recognition rectangle ;Paste the image of the set size into the recognition rectangle frame; obtain the character image mask map of the template map; fuse the image of the set size pasted into the recognition rectangle frame into the template map based on the character image mask map , to obtain the style image of the target character.
- the device for generating a character style image map also includes a training module of the first feature encoder, which is configured to: acquire a character image sample map; input the character image sample map into the first feature encoder to be trained to obtain the first feature encoder.
- the first feature encoder is trained to obtain the first feature encoder.
- the device for generating a character style image map also includes a second feature encoder training module, which is configured to: obtain a character image sample map; input the character image sample map into the first feature encoder to obtain a second sample character image feature Encoding; input the second sample character image feature code into the character image generation model to obtain the second reconstructed character image map; input the second sample character image feature code and real attribute increment into the second feature encoder to be trained to obtain the first Three-sample character image feature encoding; input the third sample character image feature encoding into the character image generation model to obtain the edited character image map; determine the predicted attribute increment between the second reconstructed character image map and the edited character image map; based on the predicted attribute The loss function between the increment and the real attribute increment is trained on the second feature encoder to be trained to obtain the second feature encoder.
- a second feature encoder training module which is configured to: obtain a character image sample map; input the character image sample map into the first feature encoder to obtain a second sample character image feature Encoding; input the second sample character
- the device for generating a character image image further includes a style image generation model training module, which is set to: perform cross-iterative training on the character image generation model and the character image discrimination model until the accuracy of the discrimination result output by the character image discrimination model is If the set conditions are met, the trained character image generation model is determined as the style image generation model; wherein, the process of cross-iterative training is: obtaining a sample image of the set style character image; inputting the first random noise data into the character image generation model , to obtain the first-style character image; input the first-style character image and the set-style character image sample image into the character image discrimination model, and obtain the first discrimination result; adjust the parameters in the character image generation model based on the first discrimination result; Inputting the second random noise data into the adjusted character image generation model to obtain a second-style character image; inputting the second-style character image and the set-style character image sample image into the character image discrimination model to obtain a second discrimination result, And determine the real discrimination result between the
- the above-mentioned device can execute the methods provided by all the foregoing embodiments of the present disclosure, and has corresponding functional modules and effects for executing the above-mentioned methods.
- the above-mentioned device can execute the methods provided by all the foregoing embodiments of the present disclosure, and has corresponding functional modules and effects for executing the above-mentioned methods.
- FIG. 10 it shows a schematic structural diagram of an electronic device 300 suitable for implementing the embodiments of the present disclosure.
- Electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablet computer PAD, portable multimedia player (Portable Media Player, PMP ), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers, such as independent servers or server clusters.
- PDA Personal Digital Assistant
- PMP portable multimedia player
- mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals)
- fixed terminals such as digital TVs, desktop computers, etc.
- servers such as independent servers or server clusters.
- the electronic device shown in FIG. 10 is only an example, and should not limit the functions and application scope of the embodiments of the present disclosure.
- the electronic device 300 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 301, and the electronic device 300 may be stored in a program or
- the program loaded from the storage device 305 into the random access memory (Random Access Memory, RAM) 303 executes various actions and processes.
- RAM 303 Random Access Memory
- various programs and data necessary for the operation of the electronic device 300 are also stored.
- the processing device 301, ROM 302, and RAM 303 are connected to each other through a bus 304.
- An input/output (Input/Output, I/O) interface 305 is also connected to the bus 304 .
- an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; including, for example, a liquid crystal display (Liquid Crystal Display, LCD) , an output device 307 such as a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309.
- the communication means 309 may allow the electronic device 300 to perform wireless or wired communication with other devices to exchange data.
- embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for performing a word recommendation method.
- the computer program may be downloaded and installed from the network through the communication means 309, or installed through the storage means 305, or installed through the ROM 302.
- the processing device 301 When the computer program is executed by the processing device 301, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
- the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
- a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof.
- Computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, RAM, ROM, Electrically Erasable Programmable Read-Only Memory (EPROM or Flash memory, optical fiber, portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage device, magnetic storage device, or any combination of the above.
- the computer-readable storage medium can be any A tangible medium that contains a stored program that can be used by an instruction execution system, device or device or used in conjunction with an instruction execution system, device or device.
- a computer-readable signal medium can be included in the baseband or as a carrier wave The transmitted data signal, the computer-readable signal medium carries the computer-readable program code.
- This transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals or any combination of the above.
- Computer-readable The signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can be sent, propagated, or transmitted for use by or in conjunction with an instruction execution system, apparatus, or device program.
- the program code contained on the computer-readable medium can be transmitted by any medium, including but not limited to: wires, optical cables, radio frequency (Radio Frequency, RF), etc., or any combination of the above.
- the client and the server can communicate using any currently known or future-developed network protocols such as Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, HTTP), and can communicate through any form or medium of digital Data communication (eg, communication network) interconnections.
- Examples of communication networks include local area networks (Local Area Networks, LANs), wide area networks (Wide Area Networks, WANs), internetworks (e.g., the Internet), peer-to-peer networks (e.g., ad hoc peer-to-peer networks), and any currently established networks that are known or developed in the future.
- the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
- the above-mentioned computer-readable medium carries one or more programs.
- the electronic device When the above-mentioned one or more programs are executed by the electronic device, the electronic device performs the following steps: input the original character image map into the first feature encoder, and obtain the first character feature encoding; determining the attribute increment between the original character image map and the template map; inputting the attribute increment and the first character image feature code into a second feature encoder to obtain a second character image feature code ; inputting the second character image feature code into the style image generation model to obtain an initial character style image map; merging the initial character style image map into the template map to obtain a target character style image map.
- Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as the "C" language or similar programming languages.
- the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
- the remote computer can be connected to the user computer through any kind of network, including a LAN or WAN, or it can be connected to an external computer (eg via the Internet using an Internet Service Provider).
- each block in a flowchart or block diagram may represent a module, program segment, or a portion of code that includes one or more executable instructions for implementing specified logical functions.
- the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed in parallel, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
- the units involved in the embodiments of the present disclosure may be implemented by software or by hardware. Wherein, the name of the unit does not constitute a limitation of the unit itself.
- exemplary types of hardware logic components include: Field Programmable Gate Arrays (Field Programmable Gate Arrays, FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (Application Specific Standard Product, ASSP), System on Chip (System on Chip, SOC), Complex Programmable Logic Device (Complex Programmable Logic Device, CPLD) and so on.
- a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
- a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
- a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared semiconductor systems, devices, or devices, or any suitable combination of the foregoing.
- the machine-readable storage medium may include one or more wire-based electrical connections, a portable computer disk, hard disk, RAM, ROM, EPROM or flash memory, optical fiber, CD-ROM, optical storage, magnetic storage, or the foregoing any combination of .
- the embodiments of the present disclosure disclose a method for generating a character style image map, including: inputting the original character image map into the first feature encoder to obtain the first character image feature code ; Determine the attribute increment between the original character image map and the template map; Input the attribute increment and the first character image feature code into the second feature encoder to obtain the second character image feature code; The second character image feature code is input into the style image generation model to obtain an initial character style image map; the initial character style image map is fused into the template map to obtain a target character style image map.
- Fusing the initial character style image map into the template map to obtain the target character style image map including: translating the position of the character style image in the initial character style image map; translating the initial character style image after translation
- the image image is fused into the template image to obtain the style image image of the target character.
- Translating the position of the character style image in the initial character style image map includes: obtaining the vertical standard line and horizontal standard line of the initial character style image map; extracting the character style image in the initial character style image map The central key point and the mouth corner key point; determine the distance difference between the vertical coordinates of the central key point and the vertical standard line, and the distance difference between the vertical coordinates of the central key point and the vertical standard line Determine as the first distance difference; determine the distance difference between the horizontal coordinates of the key point of the corner of the mouth and the horizontal standard line, and determine the distance difference between the horizontal coordinates of the key point of the corner of the mouth and the horizontal standard line as the second distance difference Translating the character style image in the vertical direction according to the first distance difference, and translating the character style image in the horizontal direction according to the second distance difference, so as to translate the character style image to the center of the image.
- Fusing the initial character image image into the template image to obtain the target character image image including: identifying the template character image in the template image to obtain a recognition rectangle; according to the recognition rectangle
- the initial character style image is cut into an image of a set size; the image of the set size is pasted into the recognition rectangle frame; the character image mask map of the template image is obtained; based on the character image mask
- the film map fuses the image of the set size pasted into the recognition rectangle into the template map to obtain a style image map of the target character.
- the training method of the first feature encoder is as follows: obtaining a character image sample map; inputting the character image sample map into the first feature encoder to be trained to obtain the first sample character image feature encoding;
- the sample character image feature code is input into the character image generation model to obtain the first reconstructed character image graph; based on the loss function between the first reconstructed character image graph and the character image sample graph, the first feature to be trained is
- the encoder is trained to obtain the first feature encoder.
- the training method of the second feature encoder is as follows: obtaining a character image sample map; inputting the character image sample map into the first feature encoder to obtain a second sample character image feature encoding;
- the image feature code is input into the character image generation model to obtain the second reconstructed character image map;
- the second sample character image feature code and the real attribute increment are input into the second feature encoder to be trained to obtain the third sample character image feature Encoding;
- the training method of the style image generation model is: perform cross-iterative training on the character image generation model and the character image discrimination model, until the accuracy of the discrimination result output by the character image discrimination model meets the set conditions, then the trained character
- the image generation model is determined as a style image generation model; wherein, the process of cross-iterative training is: obtaining a sample image of a character image in a set style; inputting the first random noise data into the image generation model to obtain a first style image image; Inputting the first style character image diagram and the set style character image sample diagram into a character image discrimination model to obtain a first discrimination result; adjusting parameters in the character image generation model based on the first discrimination result; Input the second random noise data into the adjusted character image generation model to obtain a second-style character image map; input the second-style character image map and the set-style character image sample map into the character image discrimination model to obtain The second discrimination result, and determine the real discrimination result between the second style character image map and the set style character image sample
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Multimedia (AREA)
- General Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Human Computer Interaction (AREA)
- Artificial Intelligence (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Processing Or Creating Images (AREA)
- Character Discrimination (AREA)
Abstract
Description
Claims (10)
- 一种人物风格形象图的生成方法,包括:将原始人物形象图输入第一特征编码器,获得第一人物形象特征编码;确定所述原始人物形象图与模板图间的属性增量;将所述属性增量和所述第一人物形象特征编码输入第二特征编码器,获得第二人物形象特征编码;将所述第二人物形象特征编码输入风格形象生成模型,获得初始人物风格形象图;将所述初始人物风格形象图融合至所述模板图中,获得目标人物风格形象图。
- 根据权利要求1所述的方法,其中,将所述初始人物风格形象图融合至所述模板图中,获得目标人物风格形象图,包括:将所述初始人物风格形象图中的人物风格形象的位置进行平移;将平移后的初始人物风格形象图融合至所述模板图中,获得目标人物风格形象图。
- 根据权利要求2所述的方法,其中,将所述初始人物风格形象图中的人物风格形象的位置进行平移,包括:获取所述初始人物风格形象图的竖直标准线和水平标准线;提取所述初始人物风格形象图中人物风格形象的中心关键点及嘴角关键点;确定所述中心关键点的竖直坐标与所述竖直标准线的距离差,将所述中心关键点的竖直坐标与所述竖直标准线的距离差确定为第一距离差;确定所述嘴角关键点的水平坐标与所述水平标准线的距离差,将所述嘴角关键点的水平坐标与所述水平标准线的距离差确定为第二距离差;根据所述第一距离差沿竖直方向平移所述人物风格形象,根据所述第二距离差沿水平方向平移所述人物风格形象。
- 根据权利要求1或2所述的方法,其中,将所述初始人物风格形象图融合至所述模板图中,获得目标人物风格形象图,包括:对所述模板图中的模板人物形象进行识别,获得识别矩形框;根据所述识别矩形框将所述初始人物风格形象图裁剪为设定尺寸的图像;将所述设定尺寸的图像粘贴至所述识别矩形框内;获取所述模板图的人物形象掩膜图;基于所述人物形象掩膜图将粘贴至所述识别矩形框内的所述设定尺寸的图像融合至所述模板图中,获得目标人物风格形象图。
- 根据权利要求1所述的方法,其中,所述第一特征编码器的训练方式为:获取人物形象样本图;将所述人物形象样本图输入待训练的第一特征编码器,获得第一样本人物形象特征编码;将所述第一样本人物形象特征编码输入人物形象生成模型中,获得第一重建人物形象图;基于所述第一重建人物形象图和所述人物形象样本图间的损失函数对所述待训练的第一特征编码器进行训练,得到所述第一特征编码器。
- 根据权利要求1所述的方法,其中,所述第二特征编码器的训练方式为:获取人物形象样本图;将所述人物形象样本图输入所述第一特征编码器,获得第二样本人物形象特征编码;将所述第二样本人物形象特征编码输入人物形象生成模型中,获得第二重 建人物形象图;将所述第二样本人物形象特征编码和真实属性增量输入待训练的第二特征编码器,获得第三样本人物形象特征编码;将所述第三样本人物形象特征编码输入人物形象生成模型中,获得编辑人物形象图;确定所述第二重建人物形象图和所述编辑人物形象图间的预测属性增量;基于所述预测属性增量和所述真实属性增量间的损失函数对所述待训练的第二特征编码器进行训练,得到所述第二特征编码器。
- 根据权利要求1所述的方法,其中,所述风格形象生成模型的训练方式为:对人物形象生成模型和人物形象判别模型进行交叉迭代训练,直到所述人物形象判别模型输出的判别结果的精度满足设定条件,则将训练后的人物形象生成模型确定为风格形象生成模型;其中,交叉迭代训练的过程为:获取设定风格人物形象样本图;将第一随机噪声数据输入所述人物形象生成模型,获得第一风格人物形象图;将所述第一风格人物形象图和所述设定风格人物形象样本图输入所述人物形象判别模型,获得第一判别结果;基于所述第一判别结果调整所述人物形象生成模型中的参数;将第二随机噪声数据输入调整后的人物形象生成模型,获得第二风格人物形象图;将所述第二风格人物形象图和所述设定风格人物形象样本图输入所述人物 形象判别模型,获得第二判别结果,并确定所述第二风格人物形象图和所述设定风格人物形象样本图间的真实判别结果;根据所述第二判别结果和所述真实判别结果间的损失函数调整所述人物判别模型中的参数。
- 一种人物风格形象图的生成装置,包括:第一人物形象特征编码获取模块,设置为将原始人物形象图输入第一特征编码器,获得第一人物形象特征编码;属性增量确定模块,设置为获取所述原始人物形象图与模板图间的属性增量;第二人物形象特征编码获取模块,设置为将所述属性增量和所述第一人物形象特征编码输入第二特征编码器,获得第二人物形象特征编码;初始人物风格形象图获取模块,设置为将所述第二人物形象特征编码输入风格形象生成模型,获得初始人物风格形象图;目标人物风格形象图获取模块,设置为将所述初始人物风格形象图融合至所述模板图中,获得目标人物风格形象图。
- 一种电子设备,包括:至少一个处理装置;存储装置,设置为存储至少一个程序;当所述至少一个程序被所述至少一个处理装置执行时,所述至少一个处理装置实现如权利要求1-7中任一所述的人物风格形象图的生成方法。
- 一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现如权利要求1-7中任一所述的人物风格形象图的生成方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US18/693,899 US20240386640A1 (en) | 2021-10-25 | 2022-10-25 | Method, apparatus, device and storage medium for generating character style profile image |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111241440.2A CN114004905B (zh) | 2021-10-25 | 2021-10-25 | 人物风格形象图的生成方法、装置、设备及存储介质 |
| CN202111241440.2 | 2021-10-25 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2023072015A1 true WO2023072015A1 (zh) | 2023-05-04 |
Family
ID=79923843
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/127195 Ceased WO2023072015A1 (zh) | 2021-10-25 | 2022-10-25 | 人物风格形象图的生成方法、装置、设备及存储介质 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20240386640A1 (zh) |
| CN (1) | CN114004905B (zh) |
| WO (1) | WO2023072015A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116421960A (zh) * | 2023-06-12 | 2023-07-14 | 山东中清智能科技股份有限公司 | 一种基于图像处理的抓取控制方法及装置 |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114004905B (zh) * | 2021-10-25 | 2024-03-29 | 北京字节跳动网络技术有限公司 | 人物风格形象图的生成方法、装置、设备及存储介质 |
| CN116797500B (zh) * | 2022-03-14 | 2024-09-06 | 腾讯科技(深圳)有限公司 | 图像处理方法、装置、存储介质、电子设备及产品 |
| US20230325975A1 (en) * | 2023-04-25 | 2023-10-12 | Lemon Inc. | Augmentation and layer freezing for neural network model training |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160275107A1 (en) * | 2015-03-19 | 2016-09-22 | International Business Machines Corporation | System and method for creating a preference profile from shared images |
| CN109829353A (zh) * | 2018-11-21 | 2019-05-31 | 东南大学 | 一种基于空间约束的人脸图像风格化方法 |
| CN112861805A (zh) * | 2021-03-17 | 2021-05-28 | 中山大学 | 一种基于内容特征和风格特征的人脸图像生成方法 |
| CN114004905A (zh) * | 2021-10-25 | 2022-02-01 | 北京字节跳动网络技术有限公司 | 人物风格形象图的生成方法、装置、设备及存储介质 |
Family Cites Families (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| AU2014100094A4 (en) * | 2013-06-26 | 2014-03-06 | Zazzle Inc. | Displaying Customization Options and Collecting Customization Specifications |
| US10832387B2 (en) * | 2017-07-19 | 2020-11-10 | Petuum Inc. | Real-time intelligent image manipulation system |
| US20190279075A1 (en) * | 2018-03-09 | 2019-09-12 | Nvidia Corporation | Multi-modal image translation using neural networks |
| CN108846793B (zh) * | 2018-05-25 | 2022-04-22 | 深圳市商汤科技有限公司 | 基于图像风格转换模型的图像处理方法和终端设备 |
| CN109308679B (zh) * | 2018-08-13 | 2022-08-30 | 深圳市商汤科技有限公司 | 一种图像风格转换方法及装置、设备、存储介质 |
| CN109685749B (zh) * | 2018-09-25 | 2023-04-18 | 平安科技(深圳)有限公司 | 图像风格转换方法、装置、设备和计算机存储介质 |
| CN109559363B (zh) * | 2018-11-23 | 2023-05-23 | 杭州网易智企科技有限公司 | 图像的风格化处理方法、装置、介质和电子设备 |
| US10839493B2 (en) * | 2019-01-11 | 2020-11-17 | Adobe Inc. | Transferring image style to content of a digital image |
| US11010421B2 (en) * | 2019-05-09 | 2021-05-18 | Microsoft Technology Licensing, Llc | Techniques for modifying a query image |
| CN110555896B (zh) * | 2019-09-05 | 2022-12-09 | 腾讯科技(深圳)有限公司 | 一种图像生成方法、装置以及存储介质 |
| CN111127378A (zh) * | 2019-12-23 | 2020-05-08 | Oppo广东移动通信有限公司 | 图像处理方法、装置、计算机设备及存储介质 |
| US11508169B2 (en) * | 2020-01-08 | 2022-11-22 | Palo Alto Research Center Incorporated | System and method for synthetic image generation with localized editing |
| CN111339918B (zh) * | 2020-02-24 | 2023-09-19 | 深圳市商汤科技有限公司 | 图像处理方法、装置、计算机设备及存储介质 |
| KR20210138240A (ko) * | 2020-05-12 | 2021-11-19 | 라인플러스 주식회사 | 아바타용 아이템 생성 방법, 컴퓨터 프로그램 및 컴퓨팅 장치 |
| CN111783525B (zh) * | 2020-05-20 | 2022-10-18 | 中国人民解放军93114部队 | 基于风格迁移的航空摄影图像目标样本生成方法 |
| CN112991358A (zh) * | 2020-09-30 | 2021-06-18 | 北京字节跳动网络技术有限公司 | 风格图像生成方法、模型训练方法、装置、设备和介质 |
| CN113409342B (zh) * | 2021-05-12 | 2025-02-11 | 北京达佳互联信息技术有限公司 | 图像风格迁移模型的训练方法、装置及电子设备 |
-
2021
- 2021-10-25 CN CN202111241440.2A patent/CN114004905B/zh active Active
-
2022
- 2022-10-25 WO PCT/CN2022/127195 patent/WO2023072015A1/zh not_active Ceased
- 2022-10-25 US US18/693,899 patent/US20240386640A1/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160275107A1 (en) * | 2015-03-19 | 2016-09-22 | International Business Machines Corporation | System and method for creating a preference profile from shared images |
| CN109829353A (zh) * | 2018-11-21 | 2019-05-31 | 东南大学 | 一种基于空间约束的人脸图像风格化方法 |
| CN112861805A (zh) * | 2021-03-17 | 2021-05-28 | 中山大学 | 一种基于内容特征和风格特征的人脸图像生成方法 |
| CN114004905A (zh) * | 2021-10-25 | 2022-02-01 | 北京字节跳动网络技术有限公司 | 人物风格形象图的生成方法、装置、设备及存储介质 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116421960A (zh) * | 2023-06-12 | 2023-07-14 | 山东中清智能科技股份有限公司 | 一种基于图像处理的抓取控制方法及装置 |
| CN116421960B (zh) * | 2023-06-12 | 2023-08-25 | 山东中清智能科技股份有限公司 | 一种基于图像处理的抓取控制方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114004905B (zh) | 2024-03-29 |
| US20240386640A1 (en) | 2024-11-21 |
| CN114004905A (zh) | 2022-02-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2023072015A1 (zh) | 人物风格形象图的生成方法、装置、设备及存储介质 | |
| WO2023125361A1 (zh) | 文字生成方法、装置、电子设备及存储介质 | |
| CN111369427B (zh) | 图像处理方法、装置、可读介质和电子设备 | |
| WO2023125379A1 (zh) | 文字生成方法、装置、电子设备及存储介质 | |
| WO2023232056A1 (zh) | 图像处理方法、装置、存储介质及电子设备 | |
| WO2023125374A1 (zh) | 图像处理方法、装置、电子设备及存储介质 | |
| CN118097157B (zh) | 基于模糊聚类算法的图像分割方法及系统 | |
| US20250191299A1 (en) | Rendering method and apparatus for 3d material, and device and storage medium | |
| WO2023051244A1 (zh) | 图像生成方法、装置、设备及存储介质 | |
| CN111696176A (zh) | 图像处理方法、装置、电子设备及计算机可读介质 | |
| CN111414879A (zh) | 人脸遮挡程度识别方法、装置、电子设备及可读存储介质 | |
| US12526460B2 (en) | Video generation method and apparatus, and device and storage medium | |
| CN114463768A (zh) | 表格识别方法、装置、可读介质和电子设备 | |
| WO2020211573A1 (zh) | 用于处理图像的方法和装置 | |
| WO2023103897A1 (zh) | 图像处理方法、装置、设备及存储介质 | |
| WO2023179310A1 (zh) | 图像修复方法、装置、设备、介质及产品 | |
| WO2023093683A1 (zh) | 图像剪裁方法、模型训练方法、装置、电子设备及介质 | |
| CN116596748A (zh) | 图像风格化处理方法、装置、设备、存储介质和程序产品 | |
| CN114422698A (zh) | 视频生成方法、装置、设备及存储介质 | |
| WO2023143222A1 (zh) | 图像处理方法、装置、设备及存储介质 | |
| WO2023143118A1 (zh) | 图像处理方法、装置、设备及介质 | |
| CN110211195B (zh) | 生成图像集合的方法、装置、电子设备和计算机可读存储介质 | |
| CN113240599B (zh) | 图像调色方法及装置、计算机可读存储介质、电子设备 | |
| CN115311178A (zh) | 图像拼接方法、装置、设备及介质 | |
| CN113284206A (zh) | 信息获取方法及装置、计算机可读存储介质、电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22885892 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 18693899 Country of ref document: US |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07/08/2024) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22885892 Country of ref document: EP Kind code of ref document: A1 |