Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParaformerOnline::ExtractFeats #2439

Open
CaptainNeil opened this issue Mar 19, 2025 · 0 comments
Open

ParaformerOnline::ExtractFeats #2439

CaptainNeil opened this issue Mar 19, 2025 · 0 comments
Labels
question Further information is requested

Comments

@CaptainNeil
Copy link

Notice: In order to resolve issues more efficiently, please raise issue following the template.
(注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)

❓ Questions and Help

https://github.com/modelscope/FunASR/blob/main/runtime/onnxruntime/src/paraformer-online.cpp#L160-L171

在这段代码中,reserve_waveforms_的作用是什么,似乎并未参与特征的运算,是否有存在的必要

Before asking:

  1. search the issues.
  2. search the docs.

What is your question?

梳理模型输入的前后处理,这部分代码让我很疑惑

Code

if (wav_feats.size() + lfr_splice_cache_.size() >= lfr_m) {
            wav_feats.insert(wav_feats.begin(), lfr_splice_cache_.begin(), lfr_splice_cache_.end());
            int frame_from_waves = (waves.size() - frame_sample_length_) / frame_shift_sample_length_ + 1;
            int minus_frame = reserve_waveforms_.empty() ? (lfr_m - 1) / 2 : 0;
            int lfr_splice_frame_idxs = OnlineLfrCmvn(wav_feats, input_finished);
            int reserve_frame_idx = std::abs(lfr_splice_frame_idxs - minus_frame);
            reserve_waveforms_.clear();
            reserve_waveforms_.insert(reserve_waveforms_.begin(),
                                        waves.begin() + reserve_frame_idx * frame_shift_sample_length_,
                                        waves.begin() + frame_from_waves * frame_shift_sample_length_);
            int sample_length = (frame_from_waves - 1) * frame_shift_sample_length_ + frame_sample_length_;
            waves.erase(waves.begin() + sample_length, waves.end());
        } 

What have you tried?

删除了这部分代码,似乎也可以很好的运行

What's your environment?

  • OS (e.g., Linux):
  • FunASR Version (e.g., 1.0.0):
  • ModelScope Version (e.g., 1.11.0):
  • PyTorch Version (e.g., 2.0.0):
  • How you installed funasr (pip, source):
  • Python version:
  • GPU (e.g., V100M32)
  • CUDA/cuDNN version (e.g., cuda11.7):
  • Docker version (e.g., funasr-runtime-sdk-cpu-0.4.1)
  • Any other relevant information:
@CaptainNeil CaptainNeil added the question Further information is requested label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant