IP Library › Granted Patent US 11,670,015
Granted Patent B2
US 11,670,015 · App. 17/112,212 · Granted Jun 6, 2023

Method and apparatus for generating video

Inventors: Yunfeng Liu (Beijing, CN); Chao Wang (Beijing, CN); Yuanhang Li (Beijing, CN); Ting Yun (Beijing, CN); Guoqing Chen (Beijing, CN)
Assignee: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
G06T11/001G06T11/60G06V40/165G06V40/171G06T2207/30201
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,670,015
App. No.
17/112,212
Granted
Jun 6, 2023
Kind
B2
Abstract

Embodiments of the present disclosure provide a method and apparatus for generating a video. The method may include: acquiring a cartoon face image sequence of a target cartoon character from a received cartoon-style video, and generating a cartoon face contour figure sequence based on the cartoon face image sequence; generating a face image sequence for a real face based on the cartoon face contour figure sequence and a received initial face image of the real face, a face expression in the face image sequence matching a face expression in the cartoon face image sequence; generating a cartoon-style face image sequence for the real face according to the face image sequence; and replacing a face image of the target cartoon character in the cartoon-style video with a cartoon-style face image in a cartoon-style face image sequence, to generate a cartoon-style video corresponding to the real face.

Claims (52)

1. A method for generating a video, comprising:

determining a target cartoon character from a received cartoon-style video according to an operation of a user, performing screen capturing on face images of the target cartoon character in the cartoon-style video to form a cartoon face image sequence for the target cartoon character, and generating a cartoon face contour figure sequence for the target cartoon character based on the cartoon face image sequence for the target cartoon character;

generating a face image sequence for a real face based on the cartoon face contour figure sequence for the target cartoon character and a received initial face image of the real face, wherein a face expression in the face image sequence for the real face matches a face expression in the cartoon face image sequence for the target cartoon character;

generating a cartoon-style face image sequence for the real face according to the face image sequence for the real face; and

replacing face images of the target cartoon character in the cartoon-style video with cartoon-style face images in the cartoon-style face image sequence for the real face, to generate a cartoon-style video corresponding to the real face;

wherein the generating of the cartoon-style face image sequence for the real face according to the face image sequence comprises:

inputting a face image in the face image sequence into a pre-established cartoon-style image generative model to generate the cartoon-style face image sequence for the real face, wherein the cartoon-style image generative model is a model trained and obtained based on a machine learning algorithm, or a generative model included in a generative adversarial network (GAN), and the cartoon-style image generative model is used to generate a cartoon-style face image according to the face image of the real face;

wherein the generating a face image sequence for a real face based on the cartoon face contour figure sequence for the target cartoon character and a received initial face image of the real face comprises:

for a cartoon face contour figure in the cartoon face contour figure sequence, performing sequentially following operations of generating a face image: generating a first face image based on a current cartoon face contour figure and face feature information of the initial face image;

determining a face image for the real face based on the first face image by: generating an optical flow diagram based on at least two current face images finally determined; generating a second face image based on a current face image finally determined and the optical flow diagram; and generating the face image for the real face based on the first face image and the second face image; and

generating the face image sequence for the real face using the determined face image.

2. The method according to claim 1 , wherein the generating a cartoon face contour figure sequence based on the cartoon face image sequence comprises:

for each cartoon face image in the cartoon face image sequence, performing a face keypoint detection on the cartoon face image, and generating each cartoon face contour figure based on detected face keypoints.

3. The method according to claim 1 , wherein the generating an optical flow diagram based on at least two current face images finally determined comprises:

inputting the at least two current face images finally determined into a pre-established optical flow estimation model to obtain an optical flow diagram.

4. The method according to claim 3 , wherein the pre-established optical flow estimation model is obtained by performing training comprising:

acquiring a training sample set, the training sample set comprising at least two face images and an optical flow diagram corresponding to the at least two face images; and

using the at least two face images in the training sample set as an input, and using the optical flow diagram corresponding to the at least two face images as a desired output, to train and obtain the optical flow estimation model.

5. The method according to claim 4 , wherein the optical flow diagram comprises motion information of a face.

6. The method according to claim 1 , wherein the generating a second face image based on a current face image finally determined and the optical flow diagram, comprises:

inputting the current face image finally determined and the optical flow diagram into a pre-established face generative model, to generate the second face image, wherein the face image generative model represents a corresponding relationship between the current face image finally determined, the optical flow diagram, and the second face image.

7. The method according to claim 1 , wherein the generating the face image for the real face based on the first face image and the second face image, comprises:

performing a weighted fusion on the first face image and the second face image, to obtain the face image for the real face.

8. A device, comprising:

one or more processors; and

a storage apparatus, storing one or more programs,

wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform operations, the operations comprising:

determining a target cartoon character from a received cartoon-style video according to an operation of a user, performing screen capturing on face images of the target cartoon character in the cartoon-style video to form a cartoon face image sequence for the target cartoon character, and generating a cartoon face contour figure sequence for the target cartoon character based on the cartoon face image sequence for the target cartoon character;

generating a face image sequence for a real face based on the cartoon face contour figure sequence for the target cartoon character and a received initial face image of the real face, wherein a face expression in the face image sequence for the real face matches a face expression in the cartoon face image sequence for the target cartoon character;

generating a cartoon-style face image sequence for the real face according to the face image sequence for the real face; and

replacing face images of the target cartoon character in the cartoon-style video with cartoon-style face images in the cartoon-style face image sequence for the real face, to generate a cartoon-style video corresponding to the real face;

wherein the generating of the cartoon-style face image sequence for the real face according to the face image sequence comprises:

inputting a face image in the face image sequence into a pre-established cartoon-style image generative model to generate the cartoon-style face image sequence for the real face, wherein the cartoon-style image generative model is a model trained and obtained based on a machine learning algorithm, or a generative model included in a generative adversarial network (GAN), and the cartoon-style image generative model is used to generate a cartoon-style face image according to the face image of the real face;

wherein the generating a face image sequence for a real face based on the cartoon face contour figure sequence for the target cartoon character and a received initial face image of the real face comprises:

for a cartoon face contour figure in the cartoon face contour figure sequence, performing sequentially following operations of generating a face image: generating a first face image based on a current cartoon face contour figure and face feature information of the initial face image;

determining a face image for the real face based on the first face image by: generating an optical flow diagram based on at least two current face images finally determined; generating a second face image based on a current face image finally determined and the optical flow diagram; and generating the face image for the real face based on the first face image and the second face image; and

generating the face image sequence for the real face using the determined face image.

9. The device according to claim 8 , wherein the generating a cartoon face contour figure sequence based on the cartoon face image sequence comprises:

for each cartoon face image in the cartoon face image sequence, performing a face keypoint detection on the cartoon face image, and generating each cartoon face contour figure based on detected face keypoints.

10. A non-transitory computer readable medium, storing computer programs, wherein the programs, when executed by a processor, cause the processor to perform operations, the operations comprising:

determining a target cartoon character from a received cartoon-style video according to an operation of a user, performing screen capturing on face images of the target cartoon character in the cartoon-style video to form a cartoon face image sequence for the target cartoon character, and generating a cartoon face contour figure sequence for the target cartoon character based on the cartoon face image sequence for the target cartoon character;

generating a face image sequence for a real face based on the cartoon face contour figure sequence for the target cartoon character and a received initial face image of the real face, wherein a face expression in the face image sequence for the real face matches a face expression in the cartoon face image sequence for the target cartoon character;

generating a cartoon-style face image sequence for the real face according to the face image sequence for the real face; and

replacing face images of the target cartoon character in the cartoon-style video with cartoon-style face images in the cartoon-style face image sequence for the real face, to generate a cartoon-style video corresponding to the real face;

wherein the generating of the cartoon-style face image sequence for the real face according to the face image sequence comprises:

inputting a face image in the face image sequence into a pre-established cartoon-style image generative model to generate the cartoon-style face image sequence for the real face, wherein the cartoon-style image generative model is a model trained and obtained based on a machine learning algorithm, or a generative model included in a generative adversarial network (GAN), and the cartoon-style image generative model is used to generate a cartoon-style face image according to the face image of the real face;

wherein the generating a face image sequence for a real face based on the cartoon face contour figure sequence for the target cartoon character and a received initial face image of the real face comprises:

for a cartoon face contour figure in the cartoon face contour figure sequence, performing sequentially following operations of generating a face image: generating a first face image based on a current cartoon face contour figure and face feature information of the initial face image;

determining a face image for the real face based on the first face image by: generating an optical flow diagram based on at least two current face images finally determined; generating a second face image based on a current face image finally determined and the optical flow diagram; and generating the face image for the real face based on the first face image and the second face image; and

generating the face image sequence for the real face using the determined face image.

11. The non-transitory computer readable medium according to claim 10 , wherein the generating a cartoon face contour figure sequence based on the cartoon face image sequence comprises:

for each cartoon face image in the cartoon face image sequence, performing a face keypoint detection on the cartoon face image, and generating each cartoon face contour figure based on detected face keypoints.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 4, 2020
From: LIU, YUNFENG; WANG, CHAO; LI, YUANHANG; YUN, TING; CHEN, GUOQING
To: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
Reel/Frame 054550/0432 →
Priority Claims (1)
CN 202010256117.1 · Apr 2, 2020 · national
Continuity (1)
Related Publication 20210312671A1 · Oct 7, 2021
Cited By (1)
US 12,444,058