MCPcopy Create free account

hub / github.com/anliyuan/Ultralight-Digital-Human / functions

Functions297 in github.com/anliyuan/Ultralight-Digital-Human

↓ 23 callersMethodlog_softmax
log_softmax of frame activations Args: Tensor hs_pad: 3d tensor (B, Tmax, eprojs) Returns: torch.Tensor: log
data_utils/wenet/transformer/ctc.py:51
↓ 19 callersFunctionlog_add
Stable log add
data_utils/wenet/utils/common.py:178
↓ 18 callersFunctionConv_Block
(in_channel, out_channel, kernel_size, stride, padding, group=1, has_bn=True, is_linear=False)
data_utils/base_module.py:12
↓ 12 callersFunctionadd_sos_eos
Add <sos> and <eos> labels. Args: ys_pad (torch.Tensor): batch of padded target sequences (B, Lmax) sos (int): index of <sos>
data_utils/wenet/utils/common.py:42
↓ 9 callersFunctionmake_pad_mask
Make mask tensor containing indices of padded part. See description of make_non_pad_mask. Args: lengths (torch.Tensor): Batch of len
data_utils/wenet/utils/mask.py:148
↓ 8 callersMethod__init__
(self, in_channels: int, out_channels: int)
unet.py:85
↓ 8 callersFunctionload_checkpoint
(model: torch.nn.Module, path: str)
data_utils/wenet/utils/checkpoint.py:12
↓ 7 callersFunctionreverse_pad_list
Reverse padding for the list of tensors. Args: ys_pad (tensor): The padded tensor (B, Tokenmax). ys_lens (tensor): The lens of to
data_utils/wenet/utils/common.py:88
↓ 6 callersMethod__init__
Construct a Squeeze and Excite Module. :param in_channels: Number of input channels. :param rd_ratio: Input channel reduction ratio.
data_utils/base_module.py:161
↓ 6 callersFunctioninit_asr_model
(configs)
data_utils/wenet/transformer/asr_model.py:680
↓ 6 callersMethodoutput_size
(self)
data_utils/wenet/transformer/encoder.py:120
↓ 5 callersMethod_extract_feature
(self, waveform_int16)
data_utils/FeaturePipeline.py:44
↓ 5 callersMethod_num2sym
(self, hyps)
data_utils/wenet_infer.py:453
↓ 5 callersFunctionhwc_to_chw_tensor
[H, W, 3] uint8 → [3, H, W] float32 tensor,并归一化到 [0, 1]。
face_utils.py:89
↓ 5 callersFunctionsubsequent_mask
Create mask for subsequent steps (size, size). This mask is used only in decoder which works in an auto-regressive mode. This means the curre
data_utils/wenet/utils/mask.py:9
↓ 4 callersMethod__init__
(self)
data_utils/wenet/transformer/subsampling.py:14
↓ 4 callersMethod_forward_encoder
( self, speech: torch.Tensor, speech_lengths: torch.Tensor, decoding_chunk_siz
data_utils/wenet/transformer/asr_model.py:154
↓ 4 callersMethodforward_chunk
Forward just one chunk Args: xs (torch.Tensor): chunk input offset (int): current offset in encoder output time stam
data_utils/wenet/transformer/encoder.py:169
↓ 4 callersMethodforward_one_step
Forward one step. This is only used for decoding. Args: memory: encoded memory, float32 (batch, maxlen_in, feat)
data_utils/wenet/transformer/decoder.py:131
↓ 4 callersFunctionoverride_config
(configs, override_list)
data_utils/wenet/utils/config.py:3
↓ 4 callersFunctionread_symbol_table
(symbol_table_file)
data_utils/wenet/utils/file_utils.py:24
↓ 4 callersMethodrecognize
Apply beam search on attention decoder Args: speech (torch.Tensor): (batch, max_len, feat_dim) speech_length (torch.
data_utils/wenet/transformer/asr_model.py:179
↓ 4 callersFunctionremove_duplicates_and_blank
(hyp: List[int])
data_utils/wenet/utils/common.py:166
↓ 4 callersFunctionsave_checkpoint
Args: infos (dict or None): any info you want to save.
data_utils/wenet/utils/checkpoint.py:28
↓ 4 callersMethodto_numpy
(self, tensor)
data_utils/wenet_infer.py:199
↓ 3 callersMethod_forward_encoder
( self, speech: torch.Tensor, speech_lengths: torch.Tensor, decoding_chunk_siz
data_utils/wenet/transformer/asr_model_streaming.py:154
↓ 3 callersMethod_fuse_bn_tensor
Method to fuse batchnorm layer with preceeding conv layer. Reference: https://github.com/DingXiaoH/RepVGG/blob/main/repvgg.py#L95 :p
data_utils/base_module.py:363
↓ 3 callersMethodargmax
argmax of frame activations Args: torch.Tensor hs_pad: 3d tensor (B, Tmax, eprojs) Returns: torch.Tensor: arg
data_utils/wenet/transformer/ctc.py:61
↓ 3 callersMethodattention_rescoring
Apply attention rescoring decoding, CTC prefix beam search is applied first to get nbest, then we resoring the nbest on atten
data_utils/wenet/transformer/asr_model.py:447
↓ 3 callersFunctionextract_inner
从 FACE_CROP_SIZE 大小的 crop 中取中心的 FACE_INNER_SIZE 部分。
face_utils.py:78
↓ 3 callersFunctionmask_finished_preds
If a sequence is finished, all of its branch should be <eos> Args: pred (torch.Tensor): A int array with shape (batch_si
data_utils/wenet/utils/mask.py:235
↓ 3 callersFunctionmask_finished_scores
If a sequence is finished, we only allow one alive branch. This function aims to give one branch a zero score and the rest -inf score. A
data_utils/wenet/utils/mask.py:205
↓ 3 callersMethodtrain
Train one epoch
data_utils/wenet/utils/executor.py:16
↓ 2 callersMethod__init__
(self, width_factor=1)
data_utils/pfld_mobileone.py:253
↓ 2 callersMethod__init__
Args: input_size (int): input dim output_size (int): dimension of attention attention_heads (int): the nu
data_utils/wenet/transformer/encoder_streaming.py:31
↓ 2 callersMethod__init__
Args: input_size (int): input dim output_size (int): dimension of attention attention_heads (int): the nu
data_utils/wenet/transformer/encoder.py:31
↓ 2 callersMethod__init__
Construct an PositionalEncoding object.
data_utils/wenet/transformer/embedding.py:24
↓ 2 callersMethod_conv_bn
Helper method to construct conv-batchnorm layers. :param kernel_size: Size of the convolution kernel. :param padding: Zero-padding s
data_utils/base_module.py:402
↓ 2 callersMethod_ctc_prefix_beam_search
CTC prefix beam search inner implementation Args: speech (torch.Tensor): (batch, max_len, feat_dim) speech_length (t
data_utils/wenet/transformer/asr_model.py:330
↓ 2 callersMethod_ctc_prefix_beam_search
CTC prefix beam search inner implementation Args: speech (torch.Tensor): (batch, max_len, feat_dim) speech_length (t
data_utils/wenet/transformer/asr_model_streaming.py:353
↓ 2 callersMethod_next_idle_img
静音状态/音频不够时返回的"占位帧"。每 5 次调用输出 1 帧图。
dihuman_run.py:166
↓ 2 callersMethod_pop_play_audio
(self)
dihuman_run.py:178
↓ 2 callersFunctionadd_optional_chunk_mask
Apply optional mask for encoder. Args: xs (torch.Tensor): padded input, (B, L, D), L for max length mask (torch.Tensor): mask fo
data_utils/wenet/utils/mask.py:80
↓ 2 callersMethodadvance
(self)
dihuman_run.py:100
↓ 2 callersFunctioncompute_face_bbox
从关键点算出包含嘴部的正方形 bbox (xmin, ymin, xmax, ymax)。 选点规则沿用原作者:横向以 #1 / #31 关键点为左右边界,纵向以 #52 为上边界, 并强制为正方形(边长等于横向宽度)。
face_utils.py:57
↓ 2 callersFunctioncrop_face
裁切 bbox 区域并 resize 到 FACE_CROP_SIZE。
face_utils.py:71
↓ 2 callersMethodctc_greedy_search
Apply CTC greedy search Args: speech (torch.Tensor): (batch, max_len, feat_dim) speech_length (torch.Tensor): (batch
data_utils/wenet/transformer/asr_model.py:285
↓ 2 callersMethodctc_prefix_beam_search
Apply CTC prefix beam search Args: speech (torch.Tensor): (batch, max_len, feat_dim) speech_length (torch.Tensor): (
data_utils/wenet/transformer/asr_model.py:415
↓ 2 callersMethodcv
Cross validation on
data_utils/wenet/utils/executor.py:109
↓ 2 callersMethoddetect
(self, img_path)
data_utils/get_landmark.py:83
↓ 2 callersMethodforward
Apply forward pass.
data_utils/base_module.py:181
↓ 2 callersMethodforward_attention
Compute attention context vector. Args: value (torch.Tensor): Transformed value, size (#batch, n_head, time2, d_k
data_utils/wenet/transformer/attention.py:66
↓ 2 callersMethodforward_chunk_by_chunk
Forward input chunk by chunk with chunk_size like a streaming fashion Here we should pay special attention to computation cache
data_utils/wenet/transformer/encoder.py:252
↓ 2 callersMethodforward_qkv
Transform query, key and value. Args: query (torch.Tensor): Query tensor (#batch, time1, size). key (torch.Tensor): K
data_utils/wenet/transformer/attention.py:37
↓ 2 callersFunctiongather_audio_window
取以 index 为中心、半径 half_window 的音频特征窗口,越界处用 0 填充。 返回 shape [2*half_window, ...] 的 tensor,dtype 跟 features 保持一致。
face_utils.py:95
↓ 2 callersFunctionget_activation
Return activation function.
data_utils/wenet/utils/common.py:138
↓ 2 callersFunctionget_hubert_from_16k_speech
(speech, device=DEFAULT_DEVICE)
data_utils/hubert.py:24
↓ 2 callersFunctionget_subsample
(config)
data_utils/wenet/utils/common.py:155
↓ 2 callersFunctioninit_asr_model
(configs)
data_utils/wenet/transformer/asr_model_streaming.py:703
↓ 2 callersFunctionload_cmvn
(cmvn_file, is_json)
data_utils/wenet/utils/cmvn.py:89
↓ 2 callersFunctionload_face_crop
便捷函数:读图 + 读关键点 + 算 bbox + 裁切,返回 FACE_CROP_SIZE 大小的 crop。
face_utils.py:129
↓ 2 callersFunctionmask_mouth
把 FACE_INNER_SIZE 大小的人脸图嘴部矩形区域涂黑(原地修改并返回)。
face_utils.py:84
↓ 2 callersFunctionpad_list
Perform padding for the list of tensors. Args: xs (List): List of Tensors [(T_1, `*`), (T_2, `*`), ..., (T_B, `*`)]. pad_value (f
data_utils/wenet/utils/common.py:12
↓ 2 callersMethodposition_encoding
(self, offset: int, size: int)
data_utils/wenet/transformer/subsampling.py:19
↓ 2 callersFunctionread_landmarks
从 .lms 文件读关键点。每行 'x y',返回 int32 ndarray [N, 2]。
face_utils.py:45
↓ 2 callersFunctionreshape_audio_feat
根据 ASR 模式 reshape 音频特征到 UNet 期望的形状。
face_utils.py:118
↓ 2 callersFunctionsave_checkpoint
(path: str, model: nn.Module, optimizer: optim.Optimizer, epoch: int)
train.py:76
↓ 2 callersMethodset_step
(self, step: int)
data_utils/wenet/utils/scheduler.py:51
↓ 2 callersFunctionsubsequent_chunk_mask
Create mask for subsequent steps (size, size) with chunk size, this is for streaming encoder Args: size (int): size of mask
data_utils/wenet/utils/mask.py:42
↓ 2 callersFunctionth_accuracy
Calculate accuracy. Args: pad_outputs (Tensor): Prediction tensors (B * Lmax, D). pad_targets (LongTensor): Target label tensors
data_utils/wenet/utils/common.py:116
↓ 1 callersMethodAcceptWaveform
(self, audio)
data_utils/FeaturePipeline.py:24
↓ 1 callersMethodReadFeats
(self)
data_utils/FeaturePipeline.py:68
↓ 1 callersMethodReset
(self)
data_utils/FeaturePipeline.py:60
↓ 1 callersMethod__init__
( self, vocab_size: int, encoder_output_size: int, attention_heads: int = 4,
data_utils/wenet/transformer/decoder.py:37
↓ 1 callersMethod__init__
( self, vocab_size: int, encoder_output_size: int, attention_heads: int = 4,
data_utils/wenet/transformer/decoder_streaming.py:37
↓ 1 callersMethod__init__
Construct an MultiHeadedAttention object.
data_utils/wenet/transformer/attention.py:24
↓ 1 callersMethod__init__
Construct an EncoderLayer object.
data_utils/wenet/transformer/encoder_layer.py:144
↓ 1 callersMethod_build_content_func
(self)
train.py:58
↓ 1 callersMethod_build_reference
随机取另一帧作为参考。
datasetsss.py:62
↓ 1 callersMethod_build_target_and_masked
加载当前帧,返回 (target_T, masked_T)。
datasetsss.py:54
↓ 1 callersFunction_build_unet_inputs
从 168x168 crop 构造 unet 的 6 通道输入和回贴用 crop_ori。
dihuman_run.py:76
↓ 1 callersMethod_calc_att_loss
( self, encoder_out: torch.Tensor, encoder_mask: torch.Tensor, ys_pad: torch.T
data_utils/wenet/transformer/asr_model.py:120
↓ 1 callersMethod_calc_att_loss
( self, encoder_out: torch.Tensor, encoder_mask: torch.Tensor, ys_pad: torch.T
data_utils/wenet/transformer/asr_model_streaming.py:120
↓ 1 callersFunction_check_fps
(video_path: str, mode: str)
data_utils/process.py:33
↓ 1 callersMethod_chunk_ctc_prefix_beam_search
#assert speech.shape[0] == speech_lengths.shape[0] #assert decoding_chunk_size != 0 #batch_size = speech.shape[0] #en
data_utils/wenet_infer.py:134
↓ 1 callersMethod_detect_silence
(self, audio_frame: np.ndarray)
dihuman_run.py:156
↓ 1 callersMethod_get_kernel_bias
Method to obtain re-parameterized kernel and bias. Reference: https://github.com/DingXiaoH/RepVGG/blob/main/repvgg.py#L83 :return: T
data_utils/base_module.py:329
↓ 1 callersFunction_load_json_cmvn
Load the json format cmvn stats file and calculate cmvn Args: json_cmvn_file: cmvn stats file in json format Returns: a num
data_utils/wenet/utils/cmvn.py:22
↓ 1 callersFunction_load_kaldi_cmvn
Load the kaldi format cmvn stats file and calculate cmvn Args: kaldi_cmvn_file: kaldi text style global cmvn file, which is
data_utils/wenet/utils/cmvn.py:47
↓ 1 callersFunction_make_fbank_opts
()
dihuman_run.py:47
↓ 1 callersFunction_paste_back
把网络预测的 inner 区域贴回原 face crop,再 resize 回原 bbox 大小,覆写 img。
inference.py:122
↓ 1 callersFunction_prepare_unet_input
返回 (img_concat_T, crop_img_ori, bbox, original_size)。
inference.py:103
↓ 1 callersFunction_read_landmarks_to_bbox
读 .lms → 返回 (xmin, ymin, xmax, ymax),与训练裁切口径一致。
dihuman_run.py:59
↓ 1 callersMethod_run_encoder
从 audio_queue 取一段做 fbank + wenet encoder,返回新增的音频特征。
dihuman_run.py:185
↓ 1 callersMethod_run_unet
对当前帧做一次 unet 推理并把结果贴回原图。
dihuman_run.py:205
↓ 1 callersFunction_select_fourcc
(path: str)
dihuman_run.py:269
↓ 1 callersFunction_sorted_jpgs
(dir_path: str)
data_utils/process.py:78
↓ 1 callersFunctioncheck_onnx
(onnx_path, torch_out, torch_in, audio)
pth2onnx.py:12
↓ 1 callersFunctioncompute_total_loss
( preds: torch.Tensor, labels: torch.Tensor, pixel_criterion: nn.Module, perceptual_loss: Perc
train.py:111
↓ 1 callersFunctioncount_jpgs
(dir_path: str)
face_utils.py:125
next →1–100 of 297, ranked by callers