Summary of the invention
The embodiment of the present application provides a kind of method, apparatus that image is changed face, system, equipment and storage medium, can make
The image that image obtains after processing of changing face is more life-like.The technical solution is as follows:
On the one hand, a kind of method that image is changed face is provided, the method is used for server, which comprises
Receive the second account of correspondence that the first terminal of the first Account Logon is sent first is changed face request, wherein described
It changes face and carries the face-image set of the first personage in requesting;
Receive the first account of correspondence that the second terminal of the second Account Logon is sent second is changed face request, wherein described
It changes face and carries the face-image set of the second personage in requesting;
The face-image set of face-image set and second personage based on first personage carries out model instruction
Practice, first after train change face model and it is trained after second change face model, wherein first after the training changes face mould
Type is changed for changing face the face-image of first personage for the face-image of second personage, second after the training
Face model is for changing face the face-image of second personage for the face-image of first personage;
First after sending the training to the first terminal changes face model, and Xiang Suoshu second terminal sends the training
Second afterwards is changed face model.
Optionally, the face-image set of face-image set and second personage based on first personage, into
Row model training, first after being trained changes face second changing face model after model and training, comprising:
Alternating obtains the face in the face-image set of first personage and the face-image set of second personage
Portion's image;
Every face-image for obtaining first personage, distorts the face-image of first personage, is turned round
The face-image input feature vector of the first personage after distortion is extracted model by the face-image of the first personage after song, obtains the
Fisrt feature image input second is gone back master mould, the first output image is obtained, based on what is currently obtained by one characteristic image
The face-image of first personage and the first output image, go back master mould to the Feature Selection Model and described second, into
Row parameter updates;
Every face-image for obtaining second personage, distorts the face-image of second personage, is turned round
The face-image input feature vector of the second personage after distortion is extracted model by the face-image of the second personage after song, obtains the
Second feature image input first is gone back master mould, the second output image is obtained, based on what is currently obtained by two characteristic images
The face-image of second personage and the second output image, go back master mould to the Feature Selection Model and described first, into
Row parameter updates;
Face-image and all second personages based on all first personages face-image to the feature extraction mould
Type, described first go back master mould and described second go back master mould carry out parameter update after, be based on the updated feature extraction of parameter
Model and parameter updated first go back master mould, and first after determining training is changed face model, are based on the updated feature of parameter
It extracts model and parameter updated second and goes back master mould, second after determining training is changed face model.
Optionally, it is described send the training to the first terminal after first change face model, comprising:
If first account is currently at presence, first after sending the training to the first terminal
It changes face model;
If first account is currently at off-line state, the model of changing face after storing the training, when detecting
When first account is switched to presence, what Xiang Suoshu first terminal sent after the training first changes face model;
It is described send the training to the second terminal after second change face model, comprising:
If second account is currently at presence, second after sending the training to the second terminal
It changes face model;
If second account is currently at off-line state, the model of changing face after storing the training, when detecting
When second account is switched to presence, what Xiang Suoshu second terminal sent after the training second changes face model.
Optionally, it is described send the training to the first terminal after first change face after model, the method is also
Include:
When the termination of changing face for receiving correspondence first account that the second terminal is sent is requested, Xiang Suoshu first
The first deletion for changing face model that terminal sends after the corresponding training notifies.
On the other hand, it provides a kind of image to change face method, the method is used for terminal, which comprises
The request of changing face of corresponding second account is sent to server, wherein carry the first personage in the request of changing face
Face-image set;
First after receiving the training that the server is sent changes face model, wherein first after the training changes face mould
Type is for changing face the face-image of first personage for the face-image of second personage;
When receive corresponding second account change face instruct when, after the first image wait change face is inputted the training
First change face model, the second image after being changed face.
Optionally, before the request of changing face that corresponding second account is sent to the server, institute's delivery method further include:
Play tutorial message and/or display tutorial message, wherein the tutorial message is used to indicate first personage and does
Different movement out;
During playing tutorial message and/or display tutorial message, the set of face images of first personage is shot
It closes.
Optionally, the face-image set of shooting first personage, comprising:
In the state of closing Image Adjusting function, the face-image set of first personage is shot.
On the other hand, a kind of device that image is changed face is provided, described device is applied to server, and described device includes:
Receiving module, receive the second account of correspondence that the first terminal of the first Account Logon is sent first are changed face request,
Wherein, the face-image set of the first personage is carried in the request of changing face;Receive the second terminal hair of the second Account Logon
The second of the first account of correspondence sent is changed face request, wherein the set of face images of the second personage is carried in the request of changing face
It closes;
Training module, the face-image set of face-image set and second personage based on first personage,
Carry out model training, first after train change face model and it is trained after second change face model, wherein after the training
First changes face model for changing face the face-image of first personage for the face-image of second personage, the training
Second afterwards changes face model for changing face the face-image of second personage for the face-image of first personage;
Sending module, what Xiang Suoshu first terminal sent after the training first changes face model, Xiang Suoshu second terminal hair
Second after sending the training changes face model.
Optionally, the training module, is used for:
Alternating obtains the face in the face-image set of first personage and the face-image set of second personage
Portion's image;
Every face-image for obtaining first personage, distorts the face-image of first personage, is turned round
The face-image input feature vector of the first personage after distortion is extracted model by the face-image of the first personage after song, obtains the
Fisrt feature image input second is gone back master mould, the first output image is obtained, based on what is currently obtained by one characteristic image
The face-image of first personage and the first output image, go back master mould to the Feature Selection Model and described second, into
Row parameter updates;
Every face-image for obtaining second personage, distorts the face-image of second personage, is turned round
The face-image input feature vector of the second personage after distortion is extracted model by the face-image of the second personage after song, obtains the
Second feature image input first is gone back master mould, the second output image is obtained, based on what is currently obtained by two characteristic images
The face-image of second personage and the second output image, go back master mould to the Feature Selection Model and described first, into
Row parameter updates;
Face-image and all second personages based on all first personages face-image to the feature extraction mould
Type, described first go back master mould and described second go back master mould carry out parameter update after, be based on the updated feature extraction of parameter
Model and parameter updated first go back master mould, and first after determining training is changed face model, are based on the updated feature of parameter
It extracts model and parameter updated second and goes back master mould, second after determining training is changed face model.
Optionally, the sending module, is used for:
If first account is currently at presence, first after sending the training to the first terminal
It changes face model;
If first account is currently at off-line state, the model of changing face after storing the training, when detecting
When first account is switched to presence, what Xiang Suoshu first terminal sent after the training first changes face model;
If second account is currently at presence, second after sending the training to the second terminal
It changes face model;
If second account is currently at off-line state, the model of changing face after storing the training, when detecting
When second account is switched to presence, what Xiang Suoshu second terminal sent after the training second changes face model.
Optionally, described device further include:
Removing module, when the termination of changing face for receiving correspondence first account that the second terminal is sent is requested,
The first deletion for changing face model after sending the corresponding training to the first terminal notifies.
In another aspect, providing a kind of device that image is changed face, described device is applied to terminal, and described device includes:
Sending module sends the request of changing face of corresponding second account to server, wherein carries in the request of changing face
The face-image set of first personage;
Receiving module, first after receiving the training that the server is sent changes face model, wherein the after the training
One changes face model for changing face the face-image of first personage for the face-image of second personage;
Change face module, when receive corresponding second account change face instruct when, the first image to be changed face is inputted
First after the training changes face model, the second image after being changed face.
Optionally, described device further include:
Module is instructed, plays tutorial message and/or display tutorial message, wherein the tutorial message is used to indicate described
First personage makes different movements;
Shooting module shoots the face of first personage during playing tutorial message and/or display tutorial message
Portion's image collection.
Optionally, the shooting module, is used for:
In the state of closing Image Adjusting function, the face-image set of first personage is shot.
In another aspect, providing a kind of system that image is changed face, the system comprises first terminal, second terminal and services
Device, in which:
The server, receive the second account of correspondence of the first terminal transmission of the first Account Logon first are changed face
Request, wherein the face-image set of the first personage is carried in the request of changing face;Receive described the of the second Account Logon
The second of the first account of correspondence that two terminals are sent is changed face request, wherein it is described change face request in carry the face of the second personage
Portion's image collection;The face-image set of face-image set and second personage based on first personage carries out mould
Type training, first after being trained changes face second changing face model after model and training, wherein first after the training changes
Face model is used to change face the face-image of first personage for the face-image of second personage, and the after the training
Two change face model for changing face the face-image of second personage for the face-image of first personage;To described first
What terminal sent after the training first changes face model, and what Xiang Suoshu second terminal sent after the training second changes face model.
The first terminal, Xiang Suoshu server send the request of changing face of corresponding second account;Receive the server hair
First after the training sent changes face model;When receive corresponding second account change face instruct when, by be changed face first
What image inputted after the training first changes face model, the second image after being changed face.
The second terminal, Xiang Suoshu server send the request of changing face of corresponding first account;Receive the server hair
Second after the training sent changes face model;When receive corresponding first account change face instruct when, by be changed face second
What image inputted after the training second changes face model, the first image after being changed face.
In another aspect, providing a kind of computer equipment, the computer equipment includes one or more processors and one
A or multiple memories, are stored at least one instruction in one or more of memories, described instruction by one or
Multiple processors are loaded and are executed to realize that described image is changed face operation performed by method.
In another aspect, providing a kind of computer readable storage medium, it is stored in the computer readable storage medium
At least one instruction, described instruction are loaded as processor and are executed to realize that described image is changed face operation performed by method.
Technical solution provided by the embodiments of the present application has the benefit that
The embodiment of the present application generation changes face model for processing of changing face, and can be obtained after the first image is inputted model of changing face
The second image after changing face, without using the protoplast's object prestored face-image to the face-image of target person, carry out part
Image replacement, so not also being related to carrying out deformation process to face-image, it is thus possible to reduce image fault.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
Fig. 1, Fig. 2, Fig. 3, Fig. 4 are that a kind of image provided in an embodiment of the present invention is changed face the implementation environment of method, the application
There is provided the method that image is changed face can be realized jointly by terminal and server.Terminal can be run with picture recording function
Application program, such as live streaming application program, short video application, terminal can have the portions such as microphone, camera, loudspeaker
Part, terminal have communication function, can access internet, and terminal can be mobile phone, tablet computer, intelligent wearable device, desk-top
Computer, laptop etc..Server can be the background server of above-mentioned application program, and server can be established with terminal
Communication.The server can be an individual server and be also possible to a server group, should if it is individual server
Server can be responsible in following proposal it is in need by server carry out processing, if it is server group, server group
In different server can be responsible for the different disposal in following proposal respectively, it is specific handle distribution condition can be by technology people
Member's any setting according to actual needs, details are not described herein again.
Face-image in video image can be replaced with it by the method that the image provided in the embodiment of the present application is changed face
The face-image of his personage, the function are properly termed as function of changing face.It is carried out for application program is broadcast live in the embodiment of the present application
The detailed description of scheme, other situations are similar therewith, repeat no more.Live streaming application program is installed in terminal.Journey is applied in live streaming
Sequence during recording, can also can add in video various with recorded video and will be that video is uploaded to network
Special efficacy, or carry out some filter processing.
When main broadcaster is using live streaming application program, an account, the account created can be registered in live streaming application program
Other accounts can be paid close attention to, can also be of interest by other accounts, live streaming application program have multiple pages, as live page,
Original list etc. is broadcast live, personage's page of main broadcaster oneself is as shown in Figure 1, have the personal letter such as account pet name of oneself in personage's page
Breath, at the same also change face comprising one apply the page jump control and one terminate change face apply for the page jump control.In
It changes face and applies in the page, as shown in Fig. 2, user can input the target account for wanting to change face, user can fill in target manually
Account can also concern account list or good friend's account list in selection target account.It fills in or selects to change face pair of application
As rear, into the face image capture page, as shown in figure 3, main broadcaster can carry out facial figure according to the prompt in live streaming application program
As shooting.Before the live streaming that change face, wanting for two to link up between the main broadcaster to change face, both sides agree to after changing face, two
The face-image set respectively shot can be sent to server, the face that server can be uploaded based on two main broadcasters by main broadcaster
Image collection trains model of changing face, and is then sent respectively to main broadcaster, subsequent main broadcaster can open live streaming of changing face.
When main broadcaster wants change face and be broadcast live, main broadcaster can click unlatching live streaming control, as shown in figure 4, in live streaming page
It is clicked in face and changes face control to trigger live streaming of changing face.Each spectators in direct broadcasting room are it is seen that the live streaming after the main broadcaster changes face regards
Frequently.
Fig. 5 is the flow chart of server side in method that a kind of image provided by the embodiments of the present application is changed face.Referring to fig. 2,
The process includes:
Step 501, receive the second account of correspondence that the first terminal of the first Account Logon is sent first is changed face request,
In, the face-image set of the first personage is carried in request of changing face.
Step 502, receive the first account of correspondence that the second terminal of the second Account Logon is sent second is changed face request,
In, the face-image set of the second personage is carried in request of changing face.
Step 503, the face-image set of the face-image set based on the first personage and the second personage carries out model instruction
Practice, first after train changes face second changing face model after model and training, wherein the after training first model of changing face is used
It changes face in by the face-image of the first personage as the face-image of the second personage, second after training changes face model for by second
The face-image of personage is changed face as the face-image of the first personage.
Step 504, first after sending training to first terminal changes face model, second after sending training to second terminal
It changes face model.
Fig. 6 is the flow chart of terminal side in method that a kind of image provided by the embodiments of the present application is changed face.It, should referring to Fig. 3
Process includes:
Step 601, the request of changing face of corresponding second account is sent to server, wherein carry first in request of changing face
The face-image set of personage.
Step 602, first after receiving the training that server is sent changes face model, wherein first after training changes face mould
Type is for changing face the face-image of the first personage for the face-image of the second personage.
Step 603, when receive corresponding second account change face instruct when, after the first image input training wait change face
First change face model, the second image after being changed face.
Fig. 7 is the process interacted between server and terminal in method that a kind of image provided by the embodiments of the present application is changed face
Figure.Referring to Fig. 7, which includes:
Step 701, first terminal sends the first of corresponding second account to server and changes face request.
Wherein, it changes face and carries the face-image set of the first personage in requesting, face-image set may include first
Multiple facial pictures of personage, these facial pictures can be through what is taken pictures, are also possible to extract from video more
A video frame.
In an implementation, the first main broadcaster (i.e. above-mentioned first personage) wants change face when being broadcast live, can be straight in terminal operating
Application program is broadcast, logs in the first account in live streaming application program, is then operated into personage's page in live streaming application program,
Click change face apply for the page jump control, jump to change face and apply for the page, apply for that the page carries out application of changing face changing face.First
First main broadcaster can apply for inputting the account mark for the one or more accounts (i.e. the second account) for wanting to change face in the page changing face
Know, can fill in manually, can also be selected in concern account list or good friend's account list, the point after having executed aforesaid operations
Confirmation control is hit, the face image capture page is jumped to and carries out face image capture.In the face image capture page, first is main
Photo can be shot by terminal by broadcasting, and can also shoot video by terminal, the video frame in photo or video is formed face
Image collection.After the completion of face image capture, terminal can be generated first and change face request, changes face to add in request first and clap
Then first request of changing face is sent to server by the account identification of the face-image set and the second account taken the photograph.Above-mentioned
In the shooting of the face-image set carried out in one terminal, Image Adjusting function is closed, such as closes whitening, mill skin, filter function
Energy.
Server is changed face after request receiving first from first terminal, can be there are many processing mode.
A kind of possible processing mode, server can according to first change face request in carrying the second account account
It identifies the second terminal logged in the second account and sends notice, the account identification of the first account is carried in the notice, is used for
Informing the second account currently has the first account just requesting to carry out live streaming of changing face with it.Second terminal can be straight after receiving notice
It broadcasts to user's display reminding information in application program, to prompt user to have other users to request live streaming of changing face, which clicks true
After recognizing, the second of the first account of correspondence that second terminal can be sent to server be changed face request, and second changes face request carrying the
The face-image set of two personages, can be used as the confirmation message to above-mentioned notice.Then server carries out subsequent processing again.
Alternatively possible processing mode, server do not send any notice to second terminal, simply wait for second terminal
The second of the first account of correspondence sent to server is changed face request, when receive second change face request when, then carry out subsequent place
Reason.It under this mode, ditch can have friendly relations privately between user, then send request respectively, to realize live streaming of changing face, alternatively, with
It can also be exactly to be directed to the user for oneself wanting to change face respectively to send request of changing face, if by chance having two without linking up between family
A user has sent the request of changing face changed face with other side respectively, then live streaming of changing face may be implemented.
Optionally, before the request of changing face that corresponding second account is sent to server, terminal can play tutorial message and/
Or display tutorial message shoots the face-image of the first personage during playing tutorial message and/or display tutorial message
Set.
Wherein, tutorial message is used to indicate the first personage and makes different movements.
In an implementation, when carrying out the shooting of face-image set, live streaming application program can indicate image taking.Example
Such as, display passage in side's indicates that the first personage makes different movements on the screen, such as nods, shakes the head, opening one's mouth, shutting up, is micro-
It laughs at, terminal can also carry out above-mentioned instruction by way of broadcasting voice.
Step 702, the second of the first account of correspondence that second terminal is sent to server is changed face request.
Wherein, it changes face and carries the face-image set of the second personage in requesting.
In an implementation, before second terminal sends the request of changing face of corresponding first account to server, if two change face
The negotiated agreement of main broadcaster is changed face, and the main broadcaster of second terminal opens live streaming application program, and the second account of initial landing enters application
Program, subsequently into personage's page, click, which is changed face, applies for page redirected link, jumps to change face and applies for the page, in application of changing face
The page carries out application of changing face, and the first main broadcaster first can apply for that the one or more accounts changed face are wanted in input in the page changing face
The account identification of (i.e. the second account), can fill in manually, can also select in concern account list or good friend's account list,
Confirmation control is clicked after having executed aforesaid operations, is jumped to the face image capture page and is carried out face image capture, in face
After the completion of image taking, by the main broadcaster of the account identification of the first account of main broadcaster's input/selection of second terminal and second terminal
The set of face images of second personage of shooting is unified and is sent to server.The set of face images carried out in above-mentioned second terminal
In the shooting of conjunction, Image Adjusting function is closed, such as closes whitening, mill skin, filter function.
Optionally, before the request of changing face that corresponding first account is sent to server, terminal can play tutorial message and/
Or display tutorial message shoots the face-image of the second personage during playing tutorial message and/or display tutorial message
Set.
Wherein, tutorial message is used to indicate the second personage and makes different movements.
In an implementation, when carrying out the shooting of face-image set, live streaming application program can indicate image taking.Example
Such as, display passage in side's indicates that the first personage makes different movements on the screen, such as nods, shakes the head, opening one's mouth, shutting up, is micro-
It laughs at, terminal can also carry out above-mentioned instruction by way of broadcasting voice.
Step 703, the face-image set of face-image set and second personage of the server based on the first personage carries out
Model training, first after being trained changes face second changing face model after model and training.
Wherein, first after training changes face model for changing face the face-image of the first personage for the face of the second personage
Image, second after training changes face model for changing face the face-image of the second personage for the face-image of the first personage.
In an implementation, server, which changes face the first account received, requests request storage of changing face with the second account, and root
The account identification for including in requesting of changing face according to the first account finds corresponding second account, detects second account and changes face request,
Include the account identification of the first account in request if second account is changed face, determines that the first account and the second account are paired into
The face-image set of the two accounts is inputted model of changing face by function.
Optionally, the face-image set of the face-image set based on the first personage and the second personage carries out model instruction
Practice, first after train change face model and it is trained after second change face model, comprising:
Step 1 alternately obtains the face in the face-image set of the first personage and the face-image set of the second personage
Image.
Step 2, every face-image for obtaining first personage, distorts the face-image of the first personage, obtains
The face-image input feature vector of the first personage after distortion is extracted model, obtained by the face-image of the first personage after distortion
The input of fisrt feature image second is gone back master mould, obtains the first output image by fisrt feature image, based on the currently obtained
The face-image of one personage and the first output image, go back master mould to Feature Selection Model and second, carry out parameter update.
Step 3, every face-image for obtaining second personage, distorts the face-image of the second personage, obtains
The face-image input feature vector of the second personage after distortion is extracted model, obtained by the face-image of the second personage after distortion
The input of second feature image first is gone back master mould, obtains the second output image by second feature image, based on the currently obtained
The face-image of two personages and the second output image, go back master mould to Feature Selection Model and first, carry out parameter update.
Step 4, face-image and all second personages based on all first personages face-image to feature extraction
Model, first go back master mould and second and go back after master mould carries out parameter update, based on the updated Feature Selection Model of parameter and
Parameter updated first goes back master mould, and first after determining training is changed face model, is based on the updated feature extraction mould of parameter
Type and parameter updated second go back master mould, and second after determining training is changed face model.
Wherein, the face-image of the first personage and the face-image of the second personage are subjected to distortion processing, are in order to
Two, which go back master mould and first, goes back master mould and is trained, by the face-image after the face-image output reduction of input distortion,
Master mould is gone back in training on the basis of former face-image again, while training characteristics extract the ability in feature extraction of model.
In an implementation, first by the face of the face-image of the first personage of equal angular, identical expression and the second personage
Image is matched, and the face-image of the first personage after pairing is then carried out distortion processing, the first after being distorted
The face-image input feature vector of the first personage after distortion is extracted model by the face-image of object, and Feature Selection Model is to the torsion
The face-image of the first bent personage carries out feature extraction, obtains fisrt feature image, also by fisrt feature image input second
Master mould, second, which goes back master mould, restores fisrt feature image, the first output image is obtained, based on first currently obtained
The face-image of personage and the first output image, go back master mould to Feature Selection Model and second, carry out parameter update.
After completing a Feature Selection Model and the second reduction model training, the face of the second personage after pairing is schemed
As carrying out distortion processing, the face-image of the second personage after being distorted is defeated by the face-image of the second personage after distortion
Enter Feature Selection Model, Feature Selection Model carries out feature extraction to the face-image of the second personage of the distortion, obtains second
Second feature image input first is gone back master mould by characteristic image, and first, which goes back master mould, restores second feature image, obtains
To the second output image, face-image and the second output image based on the second personage currently obtained, to Feature Selection Model
Master mould is gone back with first, carries out parameter update.
Above-mentioned training circulation is carried out, is all input in model of changing face until by all face-image set, is stopped this and follow
Ring, it is first to change face model that Feature Selection Model and first after training, which go back master mould, Feature Selection Model after training and the
Two to go back master mould be second to change face model.
Step 704, first after server sends training to first terminal changes face model, after sending training to second terminal
Second change face model.
In an implementation, when change face model training complete when, the model that will change face storage, generate storage address, server according to
The account identification carried in the request of changing face of first terminal and second terminal transmission, by the storage address and training of the model of changing face
The message of completion is sent to second terminal.First after sending training to first terminal change face model process therewith it is similar just not
It repeats one by one again.
Optionally, to first terminal send training after change face model when, if the first account is currently at presence,
First after then sending training to first terminal changes face model;If the first account is currently at off-line state, training is stored
Model of changing face afterwards, when detecting that the first account is switched to presence, first after sending training to first terminal changes face
Model.
In an implementation, when the first account is currently at presence, server, which will change face, requests the message passed through and changes
The storage address of face model is sent to the exclusive network storage space of the first account, and first terminal is according to certain period to first
The exclusive network storage space of account detects, when detecting the message that the request of changing face passes through, the automatic root of first terminal
It is downloaded according to the storage address for model of changing face.
When the first account is currently at off-line state, it is special that the message that passes through of face request is sent to the first account by server
The storage address of message and model of changing face that face request passes through is stored in the exclusive net of the first account by the network storage space of category
Network memory space.When the first account is switched to presence, first terminal is exclusive to the first account according to certain periodicity
Network storage space detected, when detect this change face message when, storage of the first terminal automatically according to model of changing face
Location is downloaded.
Optionally, first after sending training to first terminal changes face after model, when receiving second terminal transmission
Corresponding first account change face termination request when, first after sending corresponding training to first terminal change face model deletion it is logical
Know.
In an implementation, after model of changing face downloads to first terminal, the main broadcaster of second terminal, which enters termination and changes face, applies for the page
It fills in or selects the main broadcaster in concern list as the object for terminating request of changing face, click after determining, second terminal is to clothes
Business device transmission, which is changed face, terminates request.Server is stored up when the termination of changing face for receiving second terminal is requested according to server memory
The account identification of the first account the deletion of the model of changing face notice is sent to the exclusive network storage space of the first account.The
One terminal is detected according to the network storage space exclusive to the first account of certain period, when detecting model of changing face
Notice is deleted, first be stored in first terminal is directly deleted and changes face model.
Step 705, when receive corresponding second account change face instruct when, after the first image input training wait change face
First change face model, the second image after being changed face.
In an implementation, after first terminal receives the model of changing face of transmission, the personage of first terminal is when being broadcast live, point
Effect of changing face is hit, the selection page for the model that occurs changing face selects corresponding second account to change face the button of changing face of model.Camera is not
Disconnected the first image for obtaining the first personage improves the accuracy for processing of changing face when obtaining, can close Image Adjusting function
Can, by the model of changing face after the input training of the first image, the first image input feature vector is extracted into model first, it will be in the first image
The facial image information of the first personage be substituted for the facial image information of the second personage, then the facial image information is inputted
Second, which goes back master mould, is restored, and the second image is obtained, and model of changing face persistently exports the second image after changing face, then to the second figure
As addition Image Adjusting function beautifies the task image showed.The spectators for watching live streaming are watching the straight of the first personage
Sowing time, it is seen that be the second personage face.
Step 706, when receive corresponding first account change face instruct when, after the second image input training wait change face
Second change face model, the first image after being changed face.
In an implementation, after second terminal receives the model of changing face of transmission, the personage of second terminal is when being broadcast live, point
Effect of changing face is hit, the selection page for the model that occurs changing face selects corresponding first account to change face the button of changing face of model.Camera is not
Disconnected the second image for obtaining the second personage improves the accuracy for processing of changing face when obtaining, can close Image Adjusting function
Can, by the model of changing face after the input training of the second image, model of changing face is by knowing the encoded device of the face-image of the second personage
The facial image information of the second personage is not substituted for first character face's image information, facial image information input decoding will be changed
Device is restored to obtain the first image, and model of changing face persistently exports the second image after changing face, then adds image to the first image
Adjustment function beautifies the task image showed.The spectators of live streaming are watched when watching the live streaming of the second personage, it is seen that
Be the first personage face.
Fig. 8 is a kind of specific implementation schematic diagram provided by the embodiments of the present application, user's recorded material of two terminals, to clothes
Business device sends application, and server carries out application to bring pairing together after receiving application, and task queue is added in the task of changing face,
Then model training, the time that two terminals need to wait days when client server carries out aforesaid operations, in training are carried out
After the completion of model training, the notice that model training is completed is issued to two interrupt sources, two terminals are downloaded after receiving notice
There is the control of changing face, that is, functional entrance of changing face in the live streaming interface of user after the download is complete in the training pattern.
The embodiment of the present application generation changes face model for processing of changing face, and can be obtained after the first image is inputted model of changing face
The second image after changing face, without using the protoplast's object prestored face-image to the face-image of target person, carry out part
Image replacement, so not also being related to carrying out deformation process to face-image, it is thus possible to reduce image fault.
The embodiment of the present application provides a kind of device that image is changed face, which can be the server in above-described embodiment,
As shown in figure 9, described device includes:
Receiving module 910, the first of the second account of correspondence that the first terminal of the first Account Logon of reception is sent, which is changed face, asks
It asks, wherein the face-image set of the first personage is carried in the request of changing face;Receive the second terminal of the second Account Logon
The second of the first account of correspondence of transmission is changed face request, wherein the face-image of the second personage is carried in the request of changing face
Set.
Training module 920, the set of face images of face-image set and second personage based on first personage
Close, carry out model training, first after train change face model and it is trained after second change face model, wherein the training
First afterwards changes face model for changing face the face-image of first personage for the face-image of second personage, described
Second after training changes face model for changing face the face-image of second personage for the face-image of first personage.
Sending module 930, what Xiang Suoshu first terminal sent after the training first changes face model, Xiang Suoshu second terminal
Second after sending the training changes face model.
Optionally, the face-image set of face-image set and second personage based on first personage, into
Row model training, first after being trained changes face second changing face model after model and training, the training module 920, quilt
For:
Alternating obtains the face in the face-image set of first personage and the face-image set of second personage
Portion's image.
Every face-image for obtaining first personage, distorts the face-image of first personage, is turned round
The face-image input feature vector of the first personage after distortion is extracted model by the face-image of the first personage after song, obtains the
Fisrt feature image input second is gone back master mould, the first output image is obtained, based on what is currently obtained by one characteristic image
The face-image of first personage and the first output image, go back master mould to the Feature Selection Model and described second, into
Row parameter updates.
Every face-image for obtaining second personage, distorts the face-image of second personage, is turned round
The face-image input feature vector of the second personage after distortion is extracted model by the face-image of the second personage after song, obtains the
Second feature image input first is gone back master mould, the second output image is obtained, based on what is currently obtained by two characteristic images
The face-image of second personage and the second output image, go back master mould to the Feature Selection Model and described first, into
Row parameter updates.
Face-image and all second personages based on all first personages face-image to the feature extraction mould
Type, described first go back master mould and described second go back master mould carry out parameter update after, be based on the updated feature extraction of parameter
Model and parameter updated first go back master mould, and first after determining training is changed face model, are based on the updated feature of parameter
It extracts model and parameter updated second and goes back master mould, second after determining training is changed face model.
Optionally, it is described send the training to the first terminal after first change face model, the sending module
930, it is used for:
If first account is currently at presence, first after sending the training to the first terminal
It changes face model.
If first account is currently at off-line state, the model of changing face after storing the training, when detecting
When first account is switched to presence, what Xiang Suoshu first terminal sent after the training first changes face model.
If second account is currently at presence, second after sending the training to the second terminal
It changes face model.
If second account is currently at off-line state, the model of changing face after storing the training, when detecting
When second account is switched to presence, what Xiang Suoshu second terminal sent after the training second changes face model.
Optionally, it is described send the training to the first terminal after first change face after model, described device is also
Include:
Removing module, when the termination of changing face for receiving correspondence first account that the second terminal is sent is requested,
The first deletion for changing face model after sending the corresponding training to the first terminal notifies.
The embodiment of the present application provides a kind of device that image is changed face, which can be the terminal in above-described embodiment, such as
Shown in Figure 10, described device includes:
Sending module 1010 sends the request of changing face of corresponding second account to server, wherein takes in the request of changing face
Face-image set with the first personage.
Receiving module 1020, first after receiving the training that the server is sent changes face model, wherein after the training
First change face model for changing face the face-image of first personage for the face-image of second personage.
Module of changing face 1030, when receive corresponding second account change face instruct when, by the first image to be changed face
First after inputting the training changes face model, the second image after being changed face.
Optionally, before the request of changing face that corresponding second account is sent to server, described device further include:
Module is instructed, plays tutorial message and/or display tutorial message, wherein the tutorial message is used to indicate described
First personage makes different movements.
Shooting module shoots the face of first personage during playing tutorial message and/or display tutorial message
Portion's image collection.
Optionally, the face-image set of shooting first personage, the shooting module are used for:
In the state of closing Image Adjusting function, the face-image set of first personage is shot.
The embodiment of the present application generation changes face model for processing of changing face, and can be obtained after the first image is inputted model of changing face
The second image after changing face, without using the protoplast's object prestored face-image to the face-image of target person, carry out part
Image replacement, so not also being related to carrying out deformation process to face-image, it is thus possible to reduce image fault.
It should be understood that the device changed face of image provided by the above embodiment is when carrying out image and changing face, only with above-mentioned
The division progress of each functional module can according to need and for example, in practical application by above-mentioned function distribution by different
Functional module is completed, i.e., the internal structure of device is divided into different functional modules, with complete it is described above whole or
Partial function.In addition, the embodiment of the method that image provided by the above embodiment is changed face belongs to same design, process is implemented
It is detailed in embodiment of the method, which is not described herein again.
The embodiment of the present application also provides a kind of system that image is changed face, the system comprises first terminal, second terminal and
Server, in which:
The server, the first of the second account of correspondence that the first terminal of the first Account Logon of reception is sent, which is changed face, asks
It asks, wherein the face-image set of the first personage is carried in the request of changing face;Receive the second terminal of the second Account Logon
The second of the first account of correspondence of transmission is changed face request, wherein the face-image of the second personage is carried in the request of changing face
Set;The face-image set of face-image set and second personage based on first personage carries out model training,
First after being trained changes face second changing face model after model and training, wherein first after the training changes face model
It changes face for changing face the face-image of first personage for the face-image of second personage, second after the training
Model is for changing face the face-image of second personage for the face-image of first personage;It is sent out to the first terminal
First after sending the training changes face model, and what Xiang Suoshu second terminal sent after the training second changes face model.
The first terminal, Xiang Suoshu server send the request of changing face of corresponding second account;Receive the server hair
First after the training sent changes face model;When receive corresponding second account change face instruct when, by be changed face first
What image inputted after the training first changes face model, the second image after being changed face.
The second terminal, Xiang Suoshu server send the request of changing face of corresponding first account;Receive the server hair
Second after the training sent changes face model;When receive corresponding first account change face instruct when, by be changed face second
What image inputted after the training second changes face model, the first image after being changed face.
The embodiment of the present application generation changes face model for processing of changing face, and can be obtained after the first image is inputted model of changing face
The second image after changing face, without using the protoplast's object prestored face-image to the face-image of target person, carry out part
Image replacement, so not also being related to carrying out deformation process to face-image, it is thus possible to reduce image fault.
Figure 11 is a kind of structural schematic diagram of terminal provided by the embodiments of the present application.The terminal can be in above-described embodiment
First terminal or second terminal.The terminal 1100 may is that smart phone, tablet computer, MP3 player (Moving
Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio level 3), MP4
(Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) is broadcast
Put device, laptop or desktop computer.Terminal 1100 be also possible to referred to as user equipment, portable terminal, laptop terminal,
Other titles such as terminal console.
In general, terminal 1100 includes: one or more processors 1101 and one or more memories 1102.
Processor 1101 may include one or more processing cores, such as 4 core processors, 8 core processors etc..Place
Reason device 1101 can use DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field-
Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed
Logic array) at least one of example, in hardware realize.Processor 1101 also may include primary processor and coprocessor, master
Processor is the processor for being handled data in the awake state, also referred to as CPU (Central Processing
Unit, central processing unit);Coprocessor is the low power processor for being handled data in the standby state.In
In some embodiments, processor 1101 can be integrated with GPU (Graphics Processing Unit, image processor),
GPU is used to be responsible for the rendering and drafting of content to be shown needed for display screen.In some embodiments, processor 1101 can also be wrapped
AI (Artificial Intelligence, artificial intelligence) processor is included, the AI processor is for handling related machine learning
Calculating operation.
Memory 1102 may include one or more computer readable storage mediums, which can
To be non-transient.Memory 1102 may also include high-speed random access memory and nonvolatile memory, such as one
Or multiple disk storage equipments, flash memory device.In some embodiments, the non-transient computer in memory 1102 can
Storage medium is read for storing at least one instruction, at least one instruction performed by processor 1101 for realizing this Shen
Please in the image that provides of embodiment of the method change face method.
In some embodiments, terminal 1100 is also optional includes: peripheral device interface 1103 and at least one periphery are set
It is standby.It can be connected by bus or signal wire between processor 1101, memory 1102 and peripheral device interface 1103.It is each outer
Peripheral equipment can be connected by bus, signal wire or circuit board with peripheral device interface 1103.Specifically, peripheral equipment includes:
In radio circuit 1104, display screen 1105, camera 1106, voicefrequency circuit 1107, positioning component 1108 and power supply 1109 extremely
Few one kind.
Peripheral device interface 1103 can be used for I/O (Input/Output, input/output) is relevant outside at least one
Peripheral equipment is connected to processor 1101 and memory 1102.In some embodiments, processor 1101, memory 1102 and periphery
Equipment interface 1103 is integrated on same chip or circuit board;In some other embodiments, processor 1101, memory
1102 and peripheral device interface 1103 in any one or two can be realized on individual chip or circuit board, this implementation
Example is not limited this.
Radio circuit 1104 is for receiving and emitting RF (Radio Frequency, radio frequency) signal, also referred to as electromagnetic signal.
Radio circuit 1104 is communicated by electromagnetic signal with communication network and other communication equipments.Radio circuit 1104 is by telecommunications
Number being converted to electromagnetic signal is sent, alternatively, the electromagnetic signal received is converted to electric signal.Optionally, radio circuit
1104 include: antenna system, RF transceiver, one or more amplifiers, tuner, oscillator, digital signal processor, volume solution
Code chipset, user identity module card etc..Radio circuit 1104 can by least one wireless communication protocol come with it is other
Terminal is communicated.The wireless communication protocol includes but is not limited to: Metropolitan Area Network (MAN), each third generation mobile communication network (2G, 3G, 4G and
5G), WLAN and/or WiFi (Wireless Fidelity, Wireless Fidelity) network.In some embodiments, radio frequency electrical
Road 1104 can also include NFC (Near Field Communication, wireless near field communication) related circuit, the application
This is not limited.
Display screen 1105 is for showing UI (User Interface, user interface).The UI may include figure, text,
Icon, video and its their any combination.When display screen 1105 is touch display screen, display screen 1105 also there is acquisition to exist
The ability of the touch signal on the surface or surface of display screen 1105.The touch signal can be used as control signal and be input to place
Reason device 1101 is handled.At this point, display screen 1105 can be also used for providing virtual push button and/or dummy keyboard, it is also referred to as soft to press
Button and/or soft keyboard.In some embodiments, display screen 1105 can be one, and the front panel of terminal 1100 is arranged;Another
In a little embodiments, display screen 1105 can be at least two, be separately positioned on the different surfaces of terminal 1100 or in foldover design;
In still other embodiments, display screen 1105 can be flexible display screen, is arranged on the curved surface of terminal 1100 or folds
On face.Even, display screen 1105 can also be arranged to non-rectangle irregular figure, namely abnormity screen.Display screen 1105 can be with
Using LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode,
Organic Light Emitting Diode) etc. materials preparation.
CCD camera assembly 1106 is for acquiring image or video.Optionally, CCD camera assembly 1106 includes front camera
And rear camera.In general, the front panel of terminal is arranged in front camera, the back side of terminal is arranged in rear camera.In
In some embodiments, rear camera at least two is that main camera, depth of field camera, wide-angle camera, focal length are taken the photograph respectively
As any one in head, to realize that main camera and the fusion of depth of field camera realize background blurring function, main camera and wide
Pan-shot and VR (Virtual Reality, virtual reality) shooting function or other fusions are realized in camera fusion in angle
Shooting function.In some embodiments, CCD camera assembly 1106 can also include flash lamp.Flash lamp can be monochromatic temperature flash of light
Lamp is also possible to double-colored temperature flash lamp.Double-colored temperature flash lamp refers to the combination of warm light flash lamp and cold light flash lamp, can be used for
Light compensation under different-colour.
Voicefrequency circuit 1107 may include microphone and loudspeaker.Microphone is used to acquire the sound wave of user and environment, and
It converts sound waves into electric signal and is input to processor 1101 and handled, or be input to radio circuit 1104 to realize that voice is logical
Letter.For stereo acquisition or the purpose of noise reduction, microphone can be separately positioned on the different parts of terminal 1100 to be multiple.
Microphone can also be array microphone or omnidirectional's acquisition type microphone.Loudspeaker is then used to that processor 1101 or radio frequency will to be come from
The electric signal of circuit 1104 is converted to sound wave.Loudspeaker can be traditional wafer speaker, be also possible to piezoelectric ceramics loudspeaking
Device.When loudspeaker is piezoelectric ceramic loudspeaker, the audible sound wave of the mankind can be not only converted electrical signals to, can also be incited somebody to action
Electric signal is converted to the sound wave that the mankind do not hear to carry out the purposes such as ranging.In some embodiments, voicefrequency circuit 1107 may be used also
To include earphone jack.
Positioning component 1108 is used for the current geographic position of positioning terminal 1100, to realize navigation or LBS (Location
Based Service, location based service).Positioning component 1108 can be the GPS (Global based on the U.S.
Positioning System, global positioning system), the dipper system of China, Russia Gray receive this system or European Union
The positioning component of Galileo system.
Power supply 1109 is used to be powered for the various components in terminal 1100.Power supply 1109 can be alternating current, direct current
Electricity, disposable battery or rechargeable battery.When power supply 1109 includes rechargeable battery, which can support wired
Charging or wireless charging.The rechargeable battery can be also used for supporting fast charge technology.
In some embodiments, terminal 1100 further includes having one or more sensors 1110.One or more sensing
Device 1110 includes but is not limited to: acceleration transducer 1111, gyro sensor 1112, pressure sensor 1113, fingerprint sensing
Device 1114, optical sensor 1115 and proximity sensor 1116.
Acceleration transducer 1111 can detecte the acceleration in three reference axis of the coordinate system established with terminal 1100
Size.For example, acceleration transducer 1111 can be used for detecting component of the acceleration of gravity in three reference axis.Processor
The 1101 acceleration of gravity signals that can be acquired according to acceleration transducer 1111, control display screen 1105 with transverse views or indulge
The display of direction view progress user interface.Acceleration transducer 1111 can be also used for adopting for game or the exercise data of user
Collection.
Gyro sensor 1112 can detecte body direction and the rotational angle of terminal 1100, gyro sensor 1112
Acquisition user can be cooperateed with to act the 3D of terminal 1100 with acceleration transducer 1111.Processor 1101 is according to gyro sensors
The data that device 1112 acquires, following function may be implemented: action induction (for example changing UI according to the tilt operation of user) is clapped
Image stabilization, game control and inertial navigation when taking the photograph.
The lower layer of side frame and/or display screen 1105 in terminal 1100 can be set in pressure sensor 1113.Work as pressure
When the side frame of terminal 1100 is arranged in sensor 1113, user can detecte to the gripping signal of terminal 1100, by processor
1101 carry out right-hand man's identification or prompt operation according to the gripping signal that pressure sensor 1113 acquires.When pressure sensor 1113
When the lower layer of display screen 1105 is set, the pressure operation of display screen 1105 is realized to UI according to user by processor 1101
Operability control on interface is controlled.Operability control includes button control, scroll bar control, icon control, dish
At least one of single control part.
Fingerprint sensor 1114 is used to acquire the fingerprint of user, is collected by processor 1101 according to fingerprint sensor 1114
Fingerprint recognition user identity, alternatively, by fingerprint sensor 1114 according to the identity of collected fingerprint recognition user.Knowing
Not Chu the identity of user when being trusted identity, authorize the user to execute relevant sensitive operation by processor 1101, which grasps
Make to include solving lock screen, checking encryption information, downloading software, payment and change setting etc..Fingerprint sensor 1114 can be set
Set the front, the back side or side of terminal 1100.When being provided with physical button or manufacturer Logo in terminal 1100, fingerprint sensor
1114 can integrate with physical button or manufacturer Logo.
Optical sensor 1115 is for acquiring ambient light intensity.In one embodiment, processor 1101 can be according to light
The ambient light intensity that sensor 1115 acquires is learned, the display brightness of display screen 1105 is controlled.Specifically, when ambient light intensity is higher
When, the display brightness of display screen 1105 is turned up;When ambient light intensity is lower, the display brightness of display screen 1105 is turned down.Another
In one embodiment, the ambient light intensity that processor 1101 can also be acquired according to optical sensor 1115, dynamic adjustment camera shooting
The acquisition parameters of head assembly 1106.
Proximity sensor 1116, also referred to as range sensor are generally arranged at the front panel of terminal 1100.Proximity sensor
1116 for acquiring the distance between the front of user Yu terminal 1100.In one embodiment, when proximity sensor 1116 is examined
When measuring the distance between the front of user and terminal 1100 and gradually becoming smaller, display screen 1105 is controlled from bright screen by processor 1101
State is switched to breath screen state;When proximity sensor 1116 detects that the distance between user and the front of terminal 1100 gradually become
When big, display screen 1105 is controlled by processor 1101 and is switched to bright screen state from breath screen state.
It, can be with it will be understood by those skilled in the art that the restriction of the not structure paired terminal 1100 of structure shown in Figure 11
Including than illustrating more or fewer components, perhaps combining certain components or being arranged using different components.
Figure 12 is a kind of structural schematic diagram of server provided by the embodiments of the present application, the server 1200 can because of configuration or
Performance is different and generates bigger difference, may include one or more processors (central processing units,
CPU) 1201 and one or more memories 1202, wherein be stored at least one in one or more of memories 1202
Item instruction, at least one instruction are loaded by one or more of processors 1201 and are executed to realize above-mentioned each method
The method that embodiment provides.Certainly, which can also have wired or wireless network interface, keyboard and input defeated
The components such as outgoing interface, to carry out input and output, which can also include other portions for realizing functions of the equipments
Part, this will not be repeated here.
In the exemplary embodiment, a kind of computer readable storage medium is additionally provided, the memory for example including instruction,
Above-metioned instruction can be executed by processor is changed face method with the image completed in above-described embodiment.For example, the computer-readable storage
Medium can be read-only memory (Read-Only Memory, ROM), random access memory (Random Access
Memory, RAM), CD-ROM (Compact Disc Read-Only Memory, CD-ROM), tape, floppy disk and light data
Store equipment etc..
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware
It completes, relevant hardware can also be instructed to complete by program, which can store in a kind of computer-readable storage
In medium, storage medium mentioned above can be read-only memory, disk or CD etc..
It above are only the preferred embodiment of the application, it is all in spirit herein and principle not to limit the application
Within, any modification, equivalent replacement, improvement and so on should be included within the scope of protection of this application.