Photo frame implementation method and device supporting sound changing and face changing, equipment and medium
By realizing dynamic replacement of character photos and synchronous video generation of sound and lip in electronic photo frames, the problems of single functions and lack of interaction in existing electronic photo frames are solved, and personalized customization and high interactive mental health effects are achieved.
Patent Information
- Application Number
- CN202411681999.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
The existing electronic photo frame has a single function and lacks personalized customization and interactivity, which cannot meet the mental health care needs of patients in medical scenarios.
By obtaining the target character photos and the base character photos, replacing the human face of the base character photos as the human face of the target character photos, and generating pending photos; then generating lip-moving character videos based on the target text and pending photos; generating voice segments based on the target recording and text; finally generating voice-lip-syncing character videos based on the voice segment and the lip-moving character videos, and displaying them in a smart photo frame.
The dynamic changes and personalized customization of photos are realized, which enhances the interaction and personalized characteristics of mental health care, helps patients better communicate and interact with the deceased and improves the treatment effect.
Smart Images

Figure CN119629431A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of voice and face changing, and in particular to a method, device, electronic device and computer-readable storage medium for implementing a photo frame supporting voice and face changing. Background Art
[0002] With the continuous development of science and technology, people's requirements for objects are getting higher and higher. They not only pay attention to the appearance, but also pay more attention to the spiritual benefits that objects can bring. In people's lives, when relatives and friends leave, people usually remember them by looking at photos, so as to achieve a certain spiritual nourishment.
[0003] In medical scenarios, patients often need long-term treatment and rehabilitation, which may lead to negative emotions such as depression and anxiety, thus affecting the treatment effect. At this time, mental rehabilitation is particularly important. However, the electronic photo frames on the current market have single functions and lack of personalized customization, which cannot meet the needs of patients. At the same time, the interactivity of electronic photo frames is weak, making it difficult to interact effectively with patients and unable to provide more personalized services. Therefore, in medical scenarios, electronic photo frames need to further enhance their interactivity and personalization to better meet the needs of patients and improve treatment effects. Summary of the invention
[0004] The present invention provides a method, device and computer-readable storage medium for realizing a photo frame supporting voice and face changing, the main purpose of which is to realize dynamic changes of photos to solve the static and boring nature of the photos themselves, and to enhance the interactivity and personalized customization characteristics of mental therapy.
[0005] To achieve the above purpose, the present invention provides a method for implementing a photo frame supporting voice and face changing, comprising:
[0006] Obtain a target person photo and a base person photo, and replace the face part in the base person photo with the face part in the target person photo to obtain a photo to be processed;
[0007] Acquire a target text, and generate a lip-moving character video according to the target text and the photo to be processed;
[0008] Obtaining a target recording, and generating a speech segment of the target text according to the target recording and the target text;
[0009] A lip-sync character video is generated according to the voice segment and the lip-movement character video, and the lip-sync character video is displayed in a preset smart photo frame.
[0010] Optionally, replacing the facial part in the base person photo with the facial part in the target person photo to obtain the photo to be processed includes:
[0011] According to the target person's photo, identifying the target person's facial key point position information;
[0012] The photo to be processed is generated according to the facial key point position information and the base person photo, wherein the generated photo to be processed has the background of the base person photo and has facial features of the target person.
[0013] Optionally, generating the to-be-processed photo according to the facial key point position information and the base character photo includes:
[0014] Measuring the size information of the face position in the base character photo; obtaining a generative adversarial network model, wherein the generative adversarial network model includes a generative network and a discriminative network;
[0015] Using the generation network to generate a plurality of face replacement regions according to the facial key point position information and the size information;
[0016] The naturalness of each face replacement region is calculated using the discriminant network, and the face replacement region with the largest naturalness is used to replace the face position in the base character photo to obtain a photo to be processed.
[0017] Optionally, generating a lip-moving character video according to the target text and the photo to be processed includes:
[0018] Segmenting the target text to obtain multiple text sentences;
[0019] Parsing out the text syllables of each of the text sentences, and obtaining the lip movements corresponding to the text syllables;
[0020] Establishing a mapping relationship between the text syllable and the lip movement;
[0021] Generate a lip motion image frame corresponding to each lip movement of the photo to be processed according to the mapping relationship;
[0022] A lip-moving character video is synthesized according to the lip-moving image frames.
[0023] Optionally, synthesizing a lip-moving character video according to the lip-moving image frames includes:
[0024] According to the multiple text sentences obtained by the sentence segmentation, adding sentence segmentation marks to the lip motion image frame;
[0025] A time slice is added at the sentence segment mark, and the lip-moving character video is generated according to the pause rhythm of the time slice.
[0026] Optionally, generating a speech segment of the target text according to the target recording and the target text includes:
[0027] Extracting a voiceprint feature vector of the target recording;
[0028] A speech segment of the target text is generated according to the voiceprint feature vector and the target text.
[0029] Optionally, generating a lip-synced character video according to the voice segment and the lip-movement character video, and displaying the lip-synced character video in a preset smart photo frame includes:
[0030] The speech segment and the lip-moving character video are synthesized for lip-screen coordination consistency to obtain a lip-synchronized character video;
[0031] The lip-synced character videos are stored in a designated directory of a storage device of the electronic photo frame, and the lip-synced character videos in the designated directory are periodically read for carousel display.
[0032] In order to solve the above problems, the present invention also provides a photo frame implementation device supporting voice and face changing, the device comprising:
[0033] A face part replacement module is used to obtain a target person photo and a base person photo, and replace the face parts in the base person photo with the face parts in the target person photo to obtain a photo to be processed;
[0034] A lip-moving character video generation module is used to obtain a target text and generate a lip-moving character video according to the target text and the photo to be processed;
[0035] The speech synthesis module obtains the target recording, and generates a speech segment of the target text according to the target recording and the target text;
[0036] The lip-sync character video generation module generates a lip-sync character video according to the speech segment and the lip movement character video, and displays the lip-sync character video in a preset smart photo frame.
[0037] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0038] at least one processor; and,
[0039] a memory communicatively connected to the at least one processor; wherein,
[0040] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned method for implementing a photo frame supporting voice and face changing.
[0041] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned method for implementing a photo frame supporting voice and face changing.
[0042] The embodiment of the present invention uses the target person photo and the base person photo to generate the photo to be processed, and then generates the person lip movement video according to the photo to be processed and the target text obtained, so that the person in the patient's mind is displayed in the electronic photo frame, thereby realizing the dynamic transformation effect of the photo and realizing the personalized customization of the photo; synthesizing the lip-synchronized person video according to the target text, the target recording and the lip movement person video can improve the personalized interactive communication with the patient, and also achieve the effect of eliminating the static and boring photo itself, thereby improving the mental care effect. Therefore, the photo frame implementation method, device, electronic device and computer-readable storage medium that support voice and face changing proposed by the present invention can realize the dynamic change of photos and solve the static and boring photo itself; and because the present invention can realize the voice and appearance simulation and simulated dialogue communication of the deceased's relatives and friends, it can be used as a mental care method, through voice and appearance simulation and simulated dialogue communication to help people integrate into life more quickly, complete the personalized customization and interactive communication of mental care, thereby improving the treatment effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic flow chart of a method for implementing a photo frame supporting voice and face changing provided by an embodiment of the present invention;
[0044] Figure 2 A schematic diagram of a process for generating the photo to be processed provided by an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of a process for generating a lip-moving character video according to a target text and a photo to be processed provided by an embodiment of the present invention;
[0046] Figure 4 A functional module diagram of a photo frame implementation device supporting voice and face changing provided by an embodiment of the present invention;
[0047] Figure 5 A schematic diagram of the structure of an electronic device for implementing a method for implementing a photo frame supporting voice and face changing provided by an embodiment of the present invention.
[0048] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0050] The embodiment of the present application provides a method for implementing a photo frame that supports voice and face changing. The execution subject of the method for implementing a photo frame that supports voice and face changing includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for implementing a photo frame that supports voice and face changing can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be 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, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0051] Reference Figure 1 FIG. 2 is a flow chart of a method for implementing a photo frame supporting voice and face changing provided by an embodiment of the present invention. In this embodiment, the method for implementing a photo frame supporting voice and face changing includes:
[0052] S1, obtaining a target person photo and a base person photo, replacing the face part in the base person photo with the face part in the target person photo, to obtain a photo to be processed;
[0053] In the example of the present invention, the base character photo refers to a character photo that provides a background.
[0054] In the example of the present invention, the target person photo refers to a person photo that provides key point information of the person's face, such as a photo of the deceased's spouse or children living in another place.
[0055] In one of the practical application scenarios of the present invention, the facial parts in the base person photo are replaced with the facial parts in the target person photo. The purpose of obtaining the photo to be processed is to replace the base person in the base person photo with the target person in the target person photo, so as to fabricate people's unfulfilled wishes or scenes. For example, for the elderly in the hospital, replacing the deceased spouse or children with other photos for simulation can give the elderly some spiritual sustenance, thereby meeting the spiritual needs of the elderly and achieving the effect of mental rehabilitation.
[0056] In the example of the present invention, the step of replacing the facial part in the base person photo with the facial part in the target person photo to obtain the photo to be processed includes:
[0057] According to the target person's photo, identifying the target person's facial key point position information;
[0058] The photo to be processed is generated according to the facial key point position information and the base person photo, wherein the generated photo to be processed has the background of the base person photo and has facial features of the target person.
[0059] In detail, the facial detail feature extraction model (such as GhostNet model, WeightNet model) or the key point recognition model (such as landmark detector model, Dlib model) and other methods can be used to identify the facial key point position information of the target person, and then based on the extracted facial key point position information.
[0060] Specifically, when the GhostNet model or the WeightNet model is used as the facial detail feature extraction model, since the GhostNet model or the WeightNet model is a lightweight network model, it can quickly select the main information feature points of the face, and then identify the facial key point position information of the target person with high efficiency.
[0061] Specifically, when the landmark detector model or the Dlib model is used as the key point recognition model, since the landmark detector model or the Dlib model is based on single point detection, it can accurately identify the main information feature points of the face, and thus identify the key point position information with high accuracy.
[0062] Furthermore, a variational autoencoder or a generative adversarial network model may be used to replace the facial parts in the base person photo with the facial parts in the target person photo to obtain a photo to be processed.
[0063] Specifically, when a variational autoencoder is used to obtain a photo to be processed, since the distribution of the variational autoencoder encoding is normalized, the synthesized photo to be processed has high accuracy.
[0064] In the embodiment of the present invention, Figure 2 As shown, the step of generating the to-be-processed photo according to the facial key point position information and the base character photo includes:
[0065] S21, measuring the size information of the face position in the base person photo;
[0066] S22, obtaining a generative adversarial network model, wherein the generative adversarial network model includes a generative network and a discriminative network;
[0067] S23, using the generation network to generate a plurality of face replacement regions according to the facial key point position information and the size information;
[0068] S24, using the discriminant network to calculate the naturalness of each face replacement area, and using the face replacement area with the largest naturalness to replace the face position in the base character photo to obtain a photo to be processed.
[0069] In detail, the naturalness refers to the degree of consistency between the face replacement area and the size information.
[0070] Specifically, when the generative adversarial network model is used to obtain the photo to be processed, since the generative adversarial network model uses two networks to game each other to generate the photo to be processed, the generated photo to be processed has high clarity.
[0071] In detail, the photo to be processed can be obtained by using a pre-acquired generative adversarial network model, wherein the generative adversarial network model includes a generative network and a discriminative network, wherein the generative network can generate multiple photos according to the facial key point position information and the base person photo, wherein each generated photo has the background of the base person photo and the facial features of the target person, and the discriminative network is used to discriminate the authenticity of each photo generated by the generative network, and then determine the photo with the highest authenticity as the photo to be processed, wherein the authenticity refers to the degree of conformity between each photo generated by the generative network and the real person photo, for example, when the facial proportion, size, expression, etc. in the photo generated by the generative network are closer to the face in the target person photo, the authenticity of the photo is higher.
[0072] For example, two photos of people, A and B, are obtained, where A is the photo of the target person and B is the base photo. The positions of the key points in the face of the person in photo A are obtained, and the positions of the key points and the photo B are input into the GAN network. The generation model in the GAN network will continuously generate photos and send them to the discriminant model for judgment until the discriminant model cannot distinguish the generated photos from the real photos, thereby generating a photo to be processed, wherein the photo to be processed has the background of photo B and has the facial features of photo A.
[0073] In detail, the facial parts in the base person photo are replaced with the facial parts in the target person photo to obtain the photo to be processed. The advantage is that this method can make the face replacement effect more accurate, so that the processed photo obtained is more similar to the target person and can achieve personalized customization to the greatest extent; at the same time, the facial key point position information of the target person obtained can also facilitate the next step of processing the photo to be processed.
[0074] S2, obtaining a target text, and generating a lip-moving character video according to the target text and the photo to be processed;
[0075] In the example of the present invention, the target text refers to a passage that a relative or friend once said or wants a relative or friend to say.
[0076] In one of the practical application scenarios of the present invention, the reason for generating a lip-moving character video based on the target text and the to-be-processed photo is that the photo is static, while the video is a dynamic image, so the video has a stronger nostalgic extension and a stronger sense of immersion. For example, for some deceased relatives and friends, because the individual does not like to take videos or cannot take videos, at this time, there may only be some ID photos left. Prepare some ID photos and what he would say, and dynamically generate lip-moving videos. Watching these videos can help people better recall him or get out of the pain faster, achieve the effect of mental recuperation, and also realize the characteristics of personalized customization.
[0077] In the example of the present invention, the step of generating a lip-moving character video according to the target text and the photo to be processed includes:
[0078] Segmenting the target text to obtain multiple text sentences;
[0079] Parsing out the text syllables of each of the text sentences, and obtaining the lip movements corresponding to the text syllables;
[0080] Establishing a mapping relationship between the text syllable and the lip movement;
[0081] Generate a lip motion image frame corresponding to each lip movement of the photo to be processed according to the mapping relationship;
[0082] A lip-moving character video is synthesized according to the lip-moving image frames.
[0083] Specifically, natural language processing or a method based on regular expressions may be used to segment the target text into sentences, thereby obtaining a plurality of text sentences.
[0084] Specifically, when the target text is segmented using the natural language, since the basis for the natural language segmentation is a meaningful word sequence, such as the four words "absolute strength" become a whole word when segmented, rather than fragments such as "absolute" and "strength", the result obtained by segmenting the target text using the natural language will be more concise and precise.
[0085] Specifically, when the target text is segmented using the regular expression-based method, since the regular expression-based method segments sentences based on separators, the result obtained by segmenting using the regular expression-based method is more accurate.
[0086] In detail, mapping methods (such as mapping between facial key point animation and 2D animation) and synthesis models (such as GAN network) can be used to generate lip motion image frames corresponding to the photo to be processed and each lip movement.
[0087] Specifically, when the mapping between facial key point animation and 2D animation is used to complete the lip motion image frames corresponding to the photo to be processed and each lip movement, since the mapping between the facial key point animation and the 2D animation is generated based on the facial key point position information of the target person, the image frames of the lip motion corresponding to the photo to be processed and each lip movement are generated, the authenticity of the generated lip motion image frames is higher and the difference between frames will be smaller.
[0088] In detail, when the mapping between facial key point animation and 2D animation is used to complete the lip movement image frame corresponding to the photo to be processed and each lip movement, the mapping between the facial key point animation and the 2D animation is to construct the facial key point offset according to the facial key point position information and lip movement of the target person extracted in S1, that is, how the facial key point position information of the target person changes when completing the lip movement, and the amplitude of the change, and then the facial key point offset is synthesized with the photo to be processed into a key point photo, thereby generating the image frame of the lip movement corresponding to the photo to be processed and each lip movement.
[0089] For example, the key point position information of the photo to be processed C and the target person's face has been obtained, and the information is called d, and the lip movement is opening the lips; now based on the information d and the lip movement, the key point position information offset of a face with open lips is obtained, and the obtained key point position information offset is synthesized with the photo to be processed C, that is, the photo to be processed with open lips is obtained, that is, an image frame of the lip movement corresponding to the photo to be processed and the lip opening movement is generated.
[0090] Specifically, when the GAN method is used to complete the image frames of the lip movements corresponding to the photo to be processed and each lip movement, since they are directly generated using the lip movements and the photo to be processed, the efficiency of generating the image frames of the lip movements corresponding to the photo to be processed and each lip movement is higher.
[0091] In detail, the advantage of generating a lip-movement character video based on the target text and the photo to be processed is that since each frame is completed based on the photo to be processed and the corresponding lip movement, the synthesized video will appear more realistic and smooth.
[0092] In the embodiment of the present invention, Figure 3 As shown, the step of synthesizing a lip-moving character video according to the lip-moving image frame includes:
[0093] S31, adding sentence segmentation marks to the lip motion image frame according to the multiple text sentences obtained by the sentence segmentation;
[0094] S32, adding a time slice at the sentence mark, and generating the lip-moving character video according to the pause rhythm of the time slice.
[0095] In detail, the lip-moving character video can be generated according to the pause rhythm of the time slice by using a preset video software (such as PR, AE, etc.) or by using a python algorithm with a video synthesis function.
[0096] Specifically, when the lip-moving character video is generated by using video software, due to the convenience of the video software, the lip-moving character video can be easily generated based on the lip movement image frames.
[0097] Specifically, when the lip-moving character video is generated using a python algorithm with a video synthesis function, the lip-moving character video can be generated more easily according to the pause rhythm of the time slice because the algorithm can correctly solve the problem.
[0098] In detail, the advantage of synthesizing the lip-moving character video based on the lip motion image frames is that the lip-moving character video is generated according to the pause rhythm of the time slice, so the lip-moving character video is more rhythmic.
[0099] S3, obtaining a target recording, and generating a speech segment of the target text according to the target recording and the target text;
[0100] In the example of the present invention, the target recording refers to a recording of a relative or friend speaking.
[0101] In one of the practical application scenarios of the present invention, obtaining the target recording and generating the speech segment of the target text according to the target recording and the target text can help people hear words that they want to hear but have never heard or words that they have not heard for various reasons, thereby making up for people's regrets.
[0102] In the example of the present invention, obtaining a target recording, and generating a speech segment of the target text according to the target recording and the target text, includes:
[0103] Extracting a voiceprint feature vector of the target recording;
[0104] A speech segment of the target text is generated according to the voiceprint feature vector and the target text.
[0105] In detail, a voiceprint model (such as an x-vector model or a TDNNx-vector model, etc.) or a voiceprint algorithm (such as an iVector algorithm, an FBank algorithm, etc.) can be used to identify the voiceprint features of the target recording, and then extract the voiceprint feature vector of the target recording.
[0106] Specifically, when the x-vector model or the TDNNx-vector model is used to obtain the voiceprint features of the target recording, because the x-vector model or the TDNNx-vector model introduces a data enhancement strategy including noise and reverberation during training, it is able to accurately identify the voiceprint features of the target recording and then extract the voiceprint feature vector of the target recording.
[0107] Specifically, when the iVector algorithm and the FBank algorithm are used to obtain the voiceprint features of the target recording, since the processing restrictions on the target recording are relaxed, the efficiency of identifying the voiceprint features of the target recording is high.
[0108] Specifically, a speech conversion model (such as a Voice Conversion model, etc.) or a speech synthesis algorithm (such as phoneme to inverse spectrum mapping, etc.) can be used to realize the generation of a speech segment of the target text by combining the voiceprint feature vector of the target recording with the target text.
[0109] Specifically, when the Voice Conversion model is used to generate the speech segment of the target text, since the indicator for measuring the proximity of the generated speech segment of the target text to the voiceprint feature vector of the target recording is selected during the model training process, the generated speech segment of the target text will be closer to the target recording.
[0110] Specifically, when the speech segment of the target text is generated by using phoneme-to-cephalogram mapping, the speech segment of the target text will be more natural and smooth because it is synthesized based on the rhythm and timbre and tone of each frame in the voiceprint features of the target recording.
[0111] In detail, the advantage of obtaining the target recording and generating the speech segment of the target text according to the target recording and the target text is that it can be closer to the target recording and even achieve an effect of being indistinguishable from the real thing.
[0112] S4. Generate a lip-sync character video according to the voice segment and the lip-movement character video, and display the lip-sync character video in a preset smart photo frame.
[0113] In one of the practical application scenarios of the present invention, a lip-synced character video is generated according to the voice segment and the lip-movement character video, and the lip-synced character video is displayed in a preset smart photo frame to reproduce the voice and appearance of deceased relatives or friends, helping people to better remember their relatives and friends. At the same time, for example, for some deceased relatives and friends, because the individual does not like to take videos or cannot take videos, there may only be some ID photos left at this time. Some ID photos and his audio during his lifetime are prepared to synthesize a new lip-synced video to reproduce the beautiful scenes of the past. Watching these videos can help people recall him better and achieve the effect of mental healing, and also realize the characteristics of personalized customization and interactive communication.
[0114] In an example of the present invention, generating a lip-synced character video according to the voice segment and the lip-movement character video, and displaying the lip-synced character video in a preset smart photo frame includes:
[0115] The speech segment and the lip-moving character video are synthesized for lip-screen coordination consistency to obtain a lip-synchronized character video;
[0116] The lip-synced character videos are stored in a designated directory of a storage device of the electronic photo frame, and the lip-synced character videos in the designated directory are periodically read for carousel display.
[0117] In detail, the voice segment and the lip-moving character video can be synthesized into the lip-synchronized character video using a direct synthesis method (such as the Wav2Lip model) and an indirect synthesis method (such as using an intermediate modal representation to connect the audio input and the video output).
[0118] Specifically, when the lip-sync character video is generated using the Wav2Lip model, since the model directly determines whether the sound and the mouth shape are synchronized, the lip shape and the sound in the synthesized lip-sync character video are well synchronized.
[0119] Specifically, the method of connecting audio input and video output using intermediate modal representation, because the lip-synced character video is generated based on the intermediate representation model, the synthesized lip-synced character video will have better fluency and a better viewing experience when playing the video.
[0120] In detail, the lip-synced character video is generated according to the speech segment and the lip-movement character video, and the lip-synced character video is displayed in a preset smart photo frame. The advantage is that the lip-synced character video of the speech segment and the lip-movement character video can be better achieved and the smoothness of the lip-synced character video can be maximized.
[0121] like Figure 4 , is a functional module diagram of a photo frame implementation device supporting voice and face changing provided by an embodiment of the present invention.
[0122] The photo frame implementation device 100 supporting voice and face changing of the present invention can be installed in an electronic device. According to the functions implemented, the photo frame implementation device 100 supporting voice and face changing can include a face part replacement module 101, a lip movement character video generation module 102, a speech synthesis module 103 and a lip synchronization character video generation module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0123] In this embodiment, the functions of each module / unit are as follows:
[0124] The face part replacement module 101 is used to obtain a target person photo and a base person photo, and replace the face part in the base person photo with the face part in the target person photo to obtain a photo to be processed;
[0125] The lip-moving character video generation module 102 is used to obtain a target text and generate a lip-moving character video according to the target text and the photo to be processed;
[0126] The speech synthesis module 103 is used to obtain a target recording and generate a speech segment of the target text according to the target recording and the target text;
[0127] The lip-sync character video generation module 104 is used to generate a lip-sync character video according to the speech segment and the lip movement character video, and display the lip-sync character video in a preset smart photo frame.
[0128] In detail, each module described in the device 100 for implementing the photo frame supporting voice and face changing according to the embodiment of the present invention is used in the same manner as described above. Figures 1 to 3 The same technical means as the method for implementing a photo frame supporting voice and face changing described in , and can produce the same technical effects, will not be repeated here.
[0129] like Figure 5 2 is a schematic diagram of the structure of an electronic device for implementing a method for implementing a photo frame supporting voice and face changing provided by an embodiment of the present invention.
[0130] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a photo frame implementation program that supports voice and face changing.
[0131] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a photo frame implementation program that supports voice and face changing, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0132] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 can also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 can also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the photo frame implementation program that supports voice and face changing, but can also be used to temporarily store data that has been output or is to be output.
[0133] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0134] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0135] The figure only shows an electronic device with components. Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0136] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0137] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0138] The photo frame implementation program supporting voice and face changing stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0139] Obtain a target person photo and a base person photo, and replace the face part in the base person photo with the face part in the target person photo to obtain a photo to be processed;
[0140] Acquire a target text, and generate a lip-moving character video according to the target text and the photo to be processed;
[0141] Obtaining a target recording, and generating a speech segment of the target text according to the target recording and the target text;
[0142] A lip-sync character video is generated according to the voice segment and the lip-movement character video, and the lip-sync character video is displayed in a preset smart photo frame.
[0143] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0144] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0145] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0146] Obtain a target person photo and a base person photo, and replace the face part in the base person photo with the face part in the target person photo to obtain a photo to be processed;
[0147] Acquire a target text, and generate a lip-moving character video according to the target text and the photo to be processed;
[0148] Obtaining a target recording, and generating a speech segment of the target text according to the target recording and the target text;
[0149] A lip-sync character video is generated according to the voice segment and the lip-movement character video, and the lip-sync character video is displayed in a preset smart photo frame.
[0150] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0151] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0152] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0153] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0154] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0155] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0156] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0157] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for implementing a photo frame supporting voice and face changing, characterized in that: The method comprises: Obtain a target person photo and a base person photo, and replace the face part in the base person photo with the face part in the target person photo to obtain a photo to be processed; Acquire a target text, and generate a lip-moving character video according to the target text and the photo to be processed; Obtaining a target recording, and generating a speech segment of the target text according to the target recording and the target text; A lip-sync character video is generated according to the voice segment and the lip-movement character video, and the lip-sync character video is displayed in a preset smart photo frame.
2. A method for implementing a photo frame supporting voice and face changing as claimed in claim 1, characterized in that: The step of replacing the facial part in the base person photo with the facial part in the target person photo to obtain a photo to be processed includes: According to the target person's photo, identifying the target person's facial key point position information; The photo to be processed is generated according to the facial key point position information and the base person photo, wherein the generated photo to be processed has the background of the base person photo and has the facial features of the target person.
3. The method for implementing a photo frame supporting voice and face changing according to claim 2, characterized in that: The step of generating the to-be-processed photo according to the facial key point position information and the base character photo comprises: Measuring the size information of the face position in the base character photo; obtaining a generative adversarial network model, wherein the generative adversarial network model includes a generative network and a discriminative network; Using the generation network to generate a plurality of face replacement regions according to the facial key point position information and the size information; The naturalness of each face replacement region is calculated using the discriminant network, and the face replacement region with the largest naturalness is used to replace the face position in the base character photo to obtain a photo to be processed.
4. The method for implementing a photo frame supporting voice and face changing according to claim 1, characterized in that: The step of generating a lip-moving character video according to the target text and the photo to be processed includes: Segmenting the target text to obtain multiple text sentences; Parsing out the text syllables of each of the text sentences, and obtaining the lip movements corresponding to the text syllables; Establishing a mapping relationship between the text syllable and the lip movement; Generate a lip motion image frame corresponding to each lip movement of the photo to be processed according to the mapping relationship; A lip-moving character video is synthesized according to the lip-moving image frames.
5. The method for implementing a photo frame supporting voice and face changing according to claim 4, characterized in that: The step of synthesizing a lip-moving character video according to the lip-moving image frame comprises: According to the multiple text sentences obtained by the sentence segmentation, adding sentence segmentation marks to the lip motion image frame; A time slice is added at the sentence segment mark, and the lip-moving character video is generated according to the pause rhythm of the time slice.
6. The method for implementing a photo frame supporting voice and face changing according to any one of claims 1 to 5, characterized in that: Generating a speech segment of the target text according to the target recording and the target text includes: Extracting a voiceprint feature vector of the target recording; A speech segment of the target text is generated according to the voiceprint feature vector and the target text.
7. The method for implementing a photo frame supporting voice and face changing according to claim 1, characterized in that: The step of generating a lip-sync character video according to the voice segment and the lip-movement character video, and displaying the lip-sync character video in a preset smart photo frame includes: The speech segment and the lip-moving character video are synthesized for lip-screen coordination consistency to obtain a lip-synchronized character video; The lip-synced character videos are stored in a designated directory of a storage device of the electronic photo frame, and the lip-synced character videos in the designated directory are periodically read for carousel display.
8. A photo frame implementation device supporting voice and face changing, characterized in that: The device comprises: A face part replacement module is used to obtain a target person photo and a base person photo, and replace the face part in the base person photo with the face part in the target person photo to obtain a photo to be processed; A lip-moving character video generation module is used to obtain a target text and generate a lip-moving character video according to the target text and the photo to be processed; A speech synthesis module, used to obtain a target recording, and generate a speech segment of the target text according to the target recording and the target text; The lip-sync character video generation module is used to generate a lip-sync character video according to the voice segment and the lip movement character video, and display the lip-sync character video in a preset smart photo frame.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a method for implementing a photo frame supporting voice and face changing as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, a method for implementing a photo frame supporting voice and face changing as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Face changing method and device, electronic equipment and storage medium
CN112734634A
Intelligent display method of digital photo frame, digital photo frame and readable storage medium
CN112817503A
Virtual human image video generation method, system and device and storage medium
CN113192161A
AI interaction method, system and device and medium
CN116564336A