How zhanglonghao1992/one-shot_free-view_neural_talking_head_synthesis works
This repository implements one-shot, free-view neural talking-head synthesis. The principal user workflow supplies a source face image and a driving video, then demo.py estimates facial motion and head pose, animates the source, and writes a result video; optional free-view angles modify the pose. A separate training workflow loads video-frame pairs, augments them, and optimizes the synthesis models. The README documents cropping guidance and face-restoration post-processing. Some subsystem links are based on README statements or SOURCE INDEX references because the relevant source was not excerpted.
Main entry points: demo.py Demo runner · train.py Training loop · util.py Network blocks · generator.py Occlusion-aware generator
Components 22
Inference and preparation
- Crop guidance
crop-video.py - Demo runner
demo.py - Frame animation
animate.py
Synthesis networks
- Keypoint detector
modules/keypoint_detector.py - Head pose estimator
modules/hopenet.py - Occlusion-aware generator
modules/generator.py - Dense motion
modules/dense_motion.py - Training loss models
modules/model.py - Network blocks
modules/util.py
Training
- Training entry
run.py - Training loop
train.py - Video-pair dataset
frames_dataset.py - Clip augmentation
augmentation.py - Training logger
logger.py
Parallel primitives
- Synchronized batch norm
sync_batchnorm/batchnorm.py - Replica communication
sync_batchnorm/comm.py - Parallel replication
sync_batchnorm/replicate.py
Other components
- User
- Source image
- Driving video
- Result video
- Face restoration
Connections 25
- User → Demo runner: runs
README.md - User → Crop guidance: requests crop
README.md - Source image → Demo runner: provides image
README.md - Driving video → Demo runner: provides video
README.md - Crop guidance → Driving video: guides cropping
README.md - Demo runner → Keypoint detector: estimates landmarks
demo.py - Demo runner → Head pose estimator: estimates pose
demo.py - Demo runner → Occlusion-aware generator: animates source
demo.py - Demo runner → Frame animation: calls animation
demo.py - Frame animation → Result video: writes video
- Result video → Face restoration: can post-process
README.md - Occlusion-aware generator → Dense motion: uses
modules/generator.py - Occlusion-aware generator → Network blocks: uses blocks
modules/generator.py - Dense motion → Network blocks: uses blocks
modules/dense_motion.py - Keypoint detector → Network blocks: uses blocks
modules/keypoint_detector.py - Training entry → Training loop: starts training
run.py - Training entry → Video-pair dataset: configures dataset
run.py - Training loop → Video-pair dataset: loads batches
train.py - Video-pair dataset → Clip augmentation: applies transforms
frames_dataset.py - Training loop → Training loss models: computes losses
train.py - Training loop → Training logger: logs training
train.py - Training loss models → Head pose estimator: uses estimator
modules/model.py - Network blocks → Synchronized batch norm: uses normalization
modules/util.py - Synchronized batch norm → Replica communication: exchanges statistics
sync_batchnorm/batchnorm.py - Parallel replication → Synchronized batch norm: registers replicas