neverlib 0.2.8__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- neverlib/Docs/audio_aug/test_volume.ipynb +8 -8
- neverlib/Docs/filter/biquad.ipynb +1 -1
- neverlib/Docs/filter/filter_family.ipynb +4 -4
- neverlib/Docs/vad/VAD_WebRTC.ipynb +4 -4
- neverlib/Docs/vad/VAD_whisper.ipynb +2 -2
- neverlib/LLM/__init__.py +37 -0
- neverlib/LLM/bailian.py +342 -0
- neverlib/LLM/image.py +73 -0
- neverlib/LLM/text.py +32 -0
- neverlib/QA/ImpactNoiseRejection.py +119 -0
- neverlib/QA/gen_init.py +13 -16
- neverlib/__init__.py +5 -5
- neverlib/audio_aug/HarmonicDistortion.py +11 -11
- neverlib/audio_aug/README.md +3 -0
- neverlib/audio_aug/__init__.py +2 -2
- neverlib/audio_aug/audio_aug.py +18 -18
- neverlib/audio_aug/coder_aug.py +25 -25
- neverlib/audio_aug/coder_aug2.py +10 -10
- neverlib/audio_aug/loss_packet_aug.py +16 -16
- neverlib/audio_aug/quant_aug.py +7 -7
- neverlib/data_analyze/README.md +1 -1
- neverlib/data_analyze/__init__.py +2 -2
- neverlib/data_analyze/dataset_analyzer.py +2 -2
- neverlib/data_analyze/quality_metrics.py +12 -12
- neverlib/data_analyze/statistics.py +1 -1
- neverlib/data_analyze/visualization.py +1 -1
- neverlib/filter/README.md +3 -3
- neverlib/filter/__init__.py +2 -2
- neverlib/filter/auto_eq/README.md +2 -2
- neverlib/filter/auto_eq/__init__.py +2 -2
- neverlib/filter/auto_eq/de_eq.py +1 -1
- neverlib/filter/auto_eq/ga_eq_advanced.py +2 -2
- neverlib/filter/auto_eq/ga_eq_basic.py +1 -1
- neverlib/filter/biquad.py +1 -1
- neverlib/filter/core.py +8 -5
- neverlib/metrics/README.md +35 -0
- neverlib/metrics/__init__.py +2 -2
- neverlib/metrics/dnsmos.py +2 -2
- neverlib/metrics/lpc_lsp.py +8 -8
- neverlib/metrics/pesq_c/PESQ +0 -0
- neverlib/metrics/snr.py +5 -5
- neverlib/metrics/spec.py +23 -23
- neverlib/metrics/test_pesq.py +3 -3
- neverlib/signal_gen/babble_noise_generate.py +113 -0
- neverlib/tests/__init__.py +2 -2
- neverlib/tests/test_imports.py +1 -1
- neverlib/utils/README.md +29 -0
- neverlib/utils/__init__.py +24 -16
- neverlib/utils/audio_split.py +21 -21
- neverlib/utils/checkGPU.py +52 -79
- neverlib/utils/floder.py +115 -0
- neverlib/utils/lazy_expose.py +1 -1
- neverlib/utils/lazy_module.py +6 -6
- neverlib/utils/message.py +2 -3
- neverlib/utils/pcm.py +42 -0
- neverlib/utils/utils.py +108 -91
- neverlib/vad/README.md +5 -5
- neverlib/vad/__init__.py +2 -2
- neverlib/vad/utils.py +1 -1
- {neverlib-0.2.8.dist-info → neverlib-0.3.0.dist-info}/METADATA +17 -3
- neverlib-0.3.0.dist-info/RECORD +120 -0
- neverlib/.claude/settings.local.json +0 -9
- neverlib/.history/Docs/audio_aug/del_20250827162530.py +0 -0
- neverlib/.history/Docs/audio_aug/del_20250827162540.py +0 -2
- neverlib/.history/Docs/audio_aug/del_20250827162541.py +0 -7
- neverlib/.history/Docs/audio_aug/del_20250827162606.py +0 -7
- neverlib/.history/Docs/audio_aug/del_20250827162637.py +0 -8
- neverlib/.history/Docs/audio_aug/del_20250827162645.py +0 -8
- neverlib/.history/Docs/audio_aug/del_20250827162723.py +0 -9
- neverlib/.history/Docs/audio_aug/del_20250827162739.py +0 -9
- neverlib/.history/Docs/audio_aug/test_snr_20250806011311.py +0 -0
- neverlib/.history/Docs/audio_aug/test_snr_20250806011331.py +0 -75
- neverlib/.history/Docs/audio_aug/test_snr_20250806011342.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250806011352.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250806011403.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250806011413.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250806011435.py +0 -55
- neverlib/.history/Docs/audio_aug/test_snr_20250827161751.py +0 -55
- neverlib/.history/Docs/audio_aug/test_snr_20250827161754.py +0 -55
- neverlib/.history/Docs/audio_aug/test_snr_20250827161833.py +0 -54
- neverlib/.history/Docs/audio_aug/test_snr_20250827162017.py +0 -56
- neverlib/.history/Docs/audio_aug/test_snr_20250827162021.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250827162028.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250827162033.py +0 -55
- neverlib/.history/Docs/audio_aug_test/del_20250827162738.py +0 -9
- neverlib/.history/Docs/audio_aug_test/del_20250827162819.py +0 -9
- neverlib/.history/Docs/audio_aug_test/del_20250827162830.py +0 -9
- neverlib/.history/Docs/audio_aug_test/del_20250827162846.py +0 -9
- neverlib/.history/Docs/audio_aug_test/del_20250827162851.py +0 -9
- neverlib/.history/Docs/audio_aug_test/del_20250827162903.py +0 -10
- neverlib/.history/Docs/audio_aug_test/del_20250827162921.py +0 -10
- neverlib/.history/Docs/audio_aug_test/del_20250827162926.py +0 -10
- neverlib/.history/Docs/audio_aug_test/del_20250827163030.py +0 -10
- neverlib/.history/Docs/audio_aug_test/del_20250827163032.py +0 -10
- neverlib/.history/Docs/vad/1_20250810032405.py +0 -0
- neverlib/.history/Docs/vad/1_20250810032417.py +0 -39
- neverlib/.history/QA/html2markdown_20250822234112.md +0 -0
- neverlib/.history/QA/html2markdown_20250822234140.py +0 -9
- neverlib/.history/QA/html2markdown_20250822234141.md +0 -9
- neverlib/.history/QA/html2markdown_20250822234159.py +0 -12
- neverlib/.history/QA/html2markdown_20250822234200.py +0 -17
- neverlib/.history/QA/html2markdown_20250822234236.py +0 -17
- neverlib/.history/QA/html2markdown_20250822234340.py +0 -14
- neverlib/.history/QA/html2markdown_20250822234522.py +0 -18
- neverlib/.history/QA/html2markdown_20250822234601.py +0 -20
- neverlib/.history/QA/html2markdown_20250822234615.py +0 -22
- neverlib/.history/QA/html2markdown_20250822234715.py +0 -28
- neverlib/.history/QA/html2markdown_20250822234720.py +0 -27
- neverlib/.history/QA/html2markdown_20250822234903.py +0 -27
- neverlib/.history/__init___20250805234212.py +0 -41
- neverlib/.history/__init___20250904102635.py +0 -39
- neverlib/.history/__init___20250904102836.py +0 -34
- neverlib/.history/__init___20250904102838.py +0 -39
- neverlib/.history/__init___20250904102851.py +0 -33
- neverlib/.history/audio_aug/audio_aug_20250806010451.py +0 -125
- neverlib/.history/audio_aug/audio_aug_20250806010750.py +0 -138
- neverlib/.history/audio_aug/audio_aug_20250806010759.py +0 -140
- neverlib/.history/audio_aug/audio_aug_20250806010803.py +0 -140
- neverlib/.history/audio_aug/audio_aug_20250806010809.py +0 -140
- neverlib/.history/audio_aug/audio_aug_20250806011108.py +0 -140
- neverlib/.history/audio_aug/audio_aug_20250826155913.py +0 -158
- neverlib/.history/audio_aug/audio_aug_20250826164159.py +0 -159
- neverlib/.history/audio_aug/audio_aug_20250826164217.py +0 -160
- neverlib/.history/audio_aug/audio_aug_20250826164408.py +0 -161
- neverlib/.history/audio_aug/audio_aug_20250826164423.py +0 -161
- neverlib/.history/audio_aug/audio_aug_20250826164529.py +0 -161
- neverlib/.history/audio_aug/audio_aug_20250826164824.py +0 -161
- neverlib/.history/audio_aug/audio_aug_20250826164932.py +0 -162
- neverlib/.history/audio_aug/audio_aug_20250826164947.py +0 -162
- neverlib/.history/audio_aug/audio_aug_20250826165403.py +0 -162
- neverlib/.history/audio_aug/audio_aug_20250826165421.py +0 -162
- neverlib/.history/audio_aug/audio_aug_20250826165509.py +0 -163
- neverlib/.history/audio_aug/audio_aug_20250826165702.py +0 -163
- neverlib/.history/audio_aug/audio_aug_20250826165732.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826170041.py +0 -163
- neverlib/.history/audio_aug/audio_aug_20250826170105.py +0 -164
- neverlib/.history/audio_aug/audio_aug_20250826170154.py +0 -164
- neverlib/.history/audio_aug/audio_aug_20250826170220.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826170221.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826170228.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826170231.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826212001.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220038.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220133.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220148.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220154.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220156.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220314.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220343.py +0 -184
- neverlib/.history/audio_aug/audio_aug_20250826220345.py +0 -184
- neverlib/.history/audio_aug/audio_aug_20250826220349.py +0 -184
- neverlib/.history/audio_aug/audio_aug_20250826220429.py +0 -184
- neverlib/.history/audio_aug/audio_aug_20250826220447.py +0 -184
- neverlib/.history/audio_aug/audio_aug_20250826220601.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220638.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220641.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220647.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220653.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220655.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220731.py +0 -185
- neverlib/.history/audio_aug/audio_aug_20250826220739.py +0 -185
- neverlib/.history/audio_aug/audio_aug_20250826220747.py +0 -185
- neverlib/.history/audio_aug/audio_aug_20250826220801.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220822.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220901.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826221107.py +0 -187
- neverlib/.history/audio_aug/audio_aug_20250826221310.py +0 -188
- neverlib/.history/audio_aug/audio_aug_20250826221353.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221821.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221838.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221906.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221930.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221939.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221955.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826222008.py +0 -197
- neverlib/.history/audio_aug/audio_aug_20250826222017.py +0 -200
- neverlib/.history/audio_aug/audio_aug_20250826222046.py +0 -203
- neverlib/.history/audio_aug/audio_aug_20250826222105.py +0 -203
- neverlib/.history/audio_aug/audio_aug_20250826222206.py +0 -203
- neverlib/.history/audio_aug/audio_aug_20250826222302.py +0 -203
- neverlib/.history/audio_aug/audio_aug_20250826222336.py +0 -203
- neverlib/.history/audio_aug/audio_aug_20250826222455.py +0 -204
- neverlib/.history/audio_aug/audio_aug_20250826222526.py +0 -204
- neverlib/.history/audio_aug/audio_aug_20250826222541.py +0 -204
- neverlib/.history/audio_aug/audio_aug_20250826222624.py +0 -202
- neverlib/.history/audio_aug/audio_aug_20250826222714.py +0 -205
- neverlib/.history/audio_aug/audio_aug_20250826222820.py +0 -205
- neverlib/.history/audio_aug/audio_aug_20250826222827.py +0 -205
- neverlib/.history/audio_aug/audio_aug_20250826222927.py +0 -232
- neverlib/.history/audio_aug/audio_aug_20250826223009.py +0 -232
- neverlib/.history/audio_aug/audio_aug_20250826223054.py +0 -232
- neverlib/.history/audio_aug/audio_aug_20250826223225.py +0 -233
- neverlib/.history/audio_aug/audio_aug_20250826223344.py +0 -236
- neverlib/.history/audio_aug/audio_aug_20250826223356.py +0 -236
- neverlib/.history/audio_aug/audio_aug_20250826223955.py +0 -242
- neverlib/.history/audio_aug/audio_aug_20250826224210.py +0 -240
- neverlib/.history/audio_aug/audio_aug_20250826224250.py +0 -242
- neverlib/.history/audio_aug/audio_aug_20250826224323.py +0 -280
- neverlib/.history/audio_aug/audio_aug_20250826224452.py +0 -263
- neverlib/.history/audio_aug/audio_aug_20250826224455.py +0 -263
- neverlib/.history/audio_aug/audio_aug_20250826224502.py +0 -263
- neverlib/.history/audio_aug/audio_aug_20250826224528.py +0 -263
- neverlib/.history/audio_aug/audio_aug_20250826224658.py +0 -263
- neverlib/.history/audio_aug/audio_aug_20250826224833.py +0 -264
- neverlib/.history/audio_aug/audio_aug_20250826225013.py +0 -269
- neverlib/.history/audio_aug/audio_aug_20250826225050.py +0 -269
- neverlib/.history/audio_aug/audio_aug_20250826225241.py +0 -268
- neverlib/.history/audio_aug/audio_aug_20250826225315.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826225404.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826225502.py +0 -265
- neverlib/.history/audio_aug/audio_aug_20250826225950.py +0 -267
- neverlib/.history/audio_aug/audio_aug_20250826225959.py +0 -268
- neverlib/.history/audio_aug/audio_aug_20250826230222.py +0 -271
- neverlib/.history/audio_aug/audio_aug_20250826230248.py +0 -270
- neverlib/.history/audio_aug/audio_aug_20250826230638.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826230755.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826230941.py +0 -265
- neverlib/.history/audio_aug/audio_aug_20250826231054.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826231117.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826231219.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826232330.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826232352.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250827152748.py +0 -268
- neverlib/.history/audio_aug/audio_aug_20250827152806.py +0 -268
- neverlib/.history/audio_aug/audio_aug_20250827152808.py +0 -268
- neverlib/.history/audio_aug/audio_aug_20250827152917.py +0 -283
- neverlib/.history/audio_aug/audio_aug_20250827152929.py +0 -281
- neverlib/.history/audio_aug/audio_aug_20250827153100.py +0 -286
- neverlib/.history/audio_aug/audio_aug_20250827153102.py +0 -286
- neverlib/.history/audio_aug/audio_aug_20250827153301.py +0 -295
- neverlib/.history/audio_aug/audio_aug_20250827153331.py +0 -298
- neverlib/.history/audio_aug/audio_aug_20250827153525.py +0 -303
- neverlib/.history/audio_aug/audio_aug_20250827153533.py +0 -304
- neverlib/.history/audio_aug/audio_aug_20250827153541.py +0 -321
- neverlib/.history/audio_aug/audio_aug_20250827153805.py +0 -322
- neverlib/.history/audio_aug/audio_aug_20250827153832.py +0 -323
- neverlib/.history/audio_aug/audio_aug_20250827153836.py +0 -324
- neverlib/.history/audio_aug/audio_aug_20250827153846.py +0 -324
- neverlib/.history/audio_aug/audio_aug_20250827153859.py +0 -325
- neverlib/.history/audio_aug/audio_aug_20250827154453.py +0 -337
- neverlib/.history/audio_aug/audio_aug_20250827154513.py +0 -355
- neverlib/.history/audio_aug/audio_aug_20250827154538.py +0 -356
- neverlib/.history/audio_aug/audio_aug_20250827154541.py +0 -357
- neverlib/.history/audio_aug/audio_aug_20250827154612.py +0 -357
- neverlib/.history/audio_aug/audio_aug_20250827154657.py +0 -360
- neverlib/.history/audio_aug/audio_aug_20250827154708.py +0 -360
- neverlib/.history/audio_aug/audio_aug_20250827154728.py +0 -366
- neverlib/.history/audio_aug/audio_aug_20250827154755.py +0 -367
- neverlib/.history/audio_aug/audio_aug_20250827154800.py +0 -367
- neverlib/.history/audio_aug/audio_aug_20250827154917.py +0 -368
- neverlib/.history/audio_aug/audio_aug_20250827154928.py +0 -369
- neverlib/.history/audio_aug/audio_aug_20250827154932.py +0 -370
- neverlib/.history/audio_aug/audio_aug_20250827154947.py +0 -372
- neverlib/.history/audio_aug/audio_aug_20250827155015.py +0 -375
- neverlib/.history/audio_aug/audio_aug_20250827155106.py +0 -375
- neverlib/.history/audio_aug/audio_aug_20250827155114.py +0 -393
- neverlib/.history/audio_aug/audio_aug_20250827155207.py +0 -415
- neverlib/.history/audio_aug/audio_aug_20250827155300.py +0 -415
- neverlib/.history/audio_aug/audio_aug_20250827155321.py +0 -471
- neverlib/.history/audio_aug/audio_aug_20250827164703.py +0 -471
- neverlib/.history/audio_aug/audio_aug_20250827164749.py +0 -471
- neverlib/.history/audio_aug/audio_aug_20250827165252.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827165334.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827165404.py +0 -473
- neverlib/.history/audio_aug/audio_aug_20250827165610.py +0 -473
- neverlib/.history/audio_aug/audio_aug_20250827165805.py +0 -473
- neverlib/.history/audio_aug/audio_aug_20250827170056.py +0 -473
- neverlib/.history/audio_aug/audio_aug_20250827170106.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827170143.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827170216.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827170218.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827170314.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827171500.py +0 -471
- neverlib/.history/audio_aug/audio_aug_20250827172347.py +0 -471
- neverlib/.history/audio_aug/audio_aug_20250827172558.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827172559.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827172801.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827182522.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827182526.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827182626.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827182715.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250904185444.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250904185538.py +0 -445
- neverlib/.history/dataAnalyze/__init___20250805234204.py +0 -87
- neverlib/.history/dataAnalyze/__init___20250806204125.py +0 -14
- neverlib/.history/dataAnalyze/__init___20250806204139.py +0 -14
- neverlib/.history/dataAnalyze/__init___20250806204159.py +0 -14
- neverlib/.history/data_analyze/__init___20250806204158.py +0 -14
- neverlib/.history/data_analyze/__init___20250827163248.py +0 -14
- neverlib/.history/filter/__init___20250820103351.py +0 -70
- neverlib/.history/filter/__init___20250821102348.py +0 -70
- neverlib/.history/filter/__init___20250821102405.py +0 -14
- neverlib/.history/filter/auto_eq/__init___20250819213121.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102241.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102259.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102307.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102310.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102318.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102507.py +0 -36
- neverlib/.history/filter/auto_eq/de_eq_20250820103848.py +0 -361
- neverlib/.history/filter/auto_eq/de_eq_20250821102422.py +0 -360
- neverlib/.history/filter/auto_eq/freq_eq_20250805234206.py +0 -75
- neverlib/.history/filter/auto_eq/freq_eq_20250820140732.py +0 -75
- neverlib/.history/filter/auto_eq/freq_eq_20250820140745.py +0 -75
- neverlib/.history/filter/auto_eq/freq_eq_20250820140816.py +0 -75
- neverlib/.history/filter/auto_eq/freq_eq_20250820140938.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141003.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141006.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141019.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141049.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141211.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141227.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141311.py +0 -78
- neverlib/.history/filter/auto_eq/freq_eq_20250820141340.py +0 -78
- neverlib/.history/filter/auto_eq/freq_eq_20250820141712.py +0 -78
- neverlib/.history/filter/auto_eq/freq_eq_20250820141733.py +0 -78
- neverlib/.history/filter/auto_eq/freq_eq_20250820141755.py +0 -78
- neverlib/.history/filter/auto_eq/freq_eq_20250821102434.py +0 -76
- neverlib/.history/filter/auto_eq/freq_eq_20250821102500.py +0 -76
- neverlib/.history/filter/auto_eq/freq_eq_20250821102502.py +0 -76
- neverlib/.history/filter/auto_eq/freq_eq_20250821143140.py +0 -76
- neverlib/.history/filter/auto_eq/freq_eq_20250821153208.py +0 -76
- neverlib/.history/filter/auto_eq/freq_eq_20250821153214.py +0 -76
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250820102957.py +0 -380
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250820113054.py +0 -380
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250820113150.py +0 -380
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250820113520.py +0 -385
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250820113525.py +0 -385
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250821102212.py +0 -385
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250901110521.py +0 -385
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250901110652.py +0 -385
- neverlib/.history/filter/common_20250806002134.py +0 -37
- neverlib/.history/filter/common_20250821120448.py +0 -49
- neverlib/.history/filter/common_20250821120453.py +0 -49
- neverlib/.history/metrics/dnsmos_20250806001612.py +0 -160
- neverlib/.history/metrics/dnsmos_20250815180659.py +0 -160
- neverlib/.history/metrics/dnsmos_20250815180701.py +0 -158
- neverlib/.history/metrics/dnsmos_20250815181321.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181327.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181331.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181620.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181631.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181742.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181824.py +0 -153
- neverlib/.history/metrics/dnsmos_20250815181834.py +0 -153
- neverlib/.history/metrics/dnsmos_20250815181922.py +0 -153
- neverlib/.history/metrics/dnsmos_20250815182011.py +0 -147
- neverlib/.history/metrics/dnsmos_20250815182036.py +0 -144
- neverlib/.history/metrics/dnsmos_20250815182936.py +0 -143
- neverlib/.history/metrics/dnsmos_20250815182942.py +0 -143
- neverlib/.history/metrics/dnsmos_20250815183032.py +0 -137
- neverlib/.history/metrics/dnsmos_20250815183101.py +0 -144
- neverlib/.history/metrics/dnsmos_20250815183121.py +0 -144
- neverlib/.history/metrics/dnsmos_20250815183123.py +0 -143
- neverlib/.history/metrics/dnsmos_20250815183214.py +0 -143
- neverlib/.history/metrics/dnsmos_20250815183240.py +0 -143
- neverlib/.history/metrics/dnsmos_20250815183248.py +0 -144
- neverlib/.history/metrics/dnsmos_20250815183407.py +0 -142
- neverlib/.history/metrics/dnsmos_20250815183409.py +0 -142
- neverlib/.history/metrics/dnsmos_20250815183431.py +0 -142
- neverlib/.history/metrics/dnsmos_20250815183507.py +0 -140
- neverlib/.history/metrics/dnsmos_20250815183513.py +0 -139
- neverlib/.history/metrics/dnsmos_20250815183618.py +0 -139
- neverlib/.history/metrics/dnsmos_20250815183709.py +0 -140
- neverlib/.history/metrics/dnsmos_20250815183756.py +0 -137
- neverlib/.history/metrics/dnsmos_20250815183815.py +0 -128
- neverlib/.history/metrics/dnsmos_20250815183827.py +0 -129
- neverlib/.history/metrics/dnsmos_20250815183913.py +0 -117
- neverlib/.history/metrics/dnsmos_20250815183914.py +0 -117
- neverlib/.history/metrics/dnsmos_20250815184003.py +0 -118
- neverlib/.history/metrics/dnsmos_20250815184040.py +0 -118
- neverlib/.history/metrics/dnsmos_20250815184049.py +0 -118
- neverlib/.history/metrics/dnsmos_20250815184104.py +0 -117
- neverlib/.history/metrics/dnsmos_20250815184200.py +0 -117
- neverlib/.history/metrics/lpc_lsp_metric_20250816015944.py +0 -128
- neverlib/.history/metrics/lpc_lsp_metric_20250816020142.py +0 -128
- neverlib/.history/metrics/lpc_lsp_metric_20250816020156.py +0 -128
- neverlib/.history/metrics/lpc_lsp_metric_20250816020554.py +0 -130
- neverlib/.history/metrics/lpc_lsp_metric_20250816020600.py +0 -125
- neverlib/.history/metrics/lpc_lsp_metric_20250816020631.py +0 -120
- neverlib/.history/metrics/lpc_lsp_metric_20250816020746.py +0 -118
- neverlib/.history/metrics/lpc_me_20250816013111.py +0 -0
- neverlib/.history/metrics/lpc_me_20250816013129.py +0 -121
- neverlib/.history/metrics/lpc_me_20250816015430.py +0 -103
- neverlib/.history/metrics/lpc_me_20250816015535.py +0 -96
- neverlib/.history/metrics/lpc_me_20250816015542.py +0 -96
- neverlib/.history/metrics/lpc_me_20250816015636.py +0 -97
- neverlib/.history/metrics/lpc_me_20250816015658.py +0 -104
- neverlib/.history/metrics/lpc_me_20250816015703.py +0 -100
- neverlib/.history/metrics/lpc_me_20250816015945.py +0 -128
- neverlib/.history/metrics/snr_20250806010538.py +0 -177
- neverlib/.history/metrics/snr_20250806211634.py +0 -184
- neverlib/.history/metrics/snr_20250827224201.py +0 -182
- neverlib/.history/metrics/snr_20250827234019.py +0 -186
- neverlib/.history/metrics/snr_20250827234028.py +0 -186
- neverlib/.history/metrics/snr_20250827234030.py +0 -186
- neverlib/.history/metrics/spec_20250805234209.py +0 -45
- neverlib/.history/metrics/spec_20250816135530.py +0 -11
- neverlib/.history/metrics/spec_20250816135654.py +0 -16
- neverlib/.history/metrics/spec_20250816135736.py +0 -68
- neverlib/.history/metrics/spec_20250816135904.py +0 -75
- neverlib/.history/metrics/spec_20250816135921.py +0 -82
- neverlib/.history/metrics/spec_20250816140111.py +0 -82
- neverlib/.history/metrics/spec_20250816140543.py +0 -136
- neverlib/.history/metrics/spec_20250816140559.py +0 -172
- neverlib/.history/metrics/spec_20250816140602.py +0 -172
- neverlib/.history/metrics/spec_20250816140608.py +0 -172
- neverlib/.history/metrics/spec_20250816140654.py +0 -148
- neverlib/.history/metrics/spec_20250816140705.py +0 -144
- neverlib/.history/metrics/spec_20250816140755.py +0 -138
- neverlib/.history/metrics/spec_20250816140823.py +0 -170
- neverlib/.history/metrics/spec_20250816140832.py +0 -170
- neverlib/.history/metrics/spec_20250816140833.py +0 -170
- neverlib/.history/metrics/spec_20250816140922.py +0 -147
- neverlib/.history/metrics/spec_20250816141148.py +0 -107
- neverlib/.history/metrics/spec_20250816141219.py +0 -123
- neverlib/.history/metrics/spec_20250816141732.py +0 -178
- neverlib/.history/metrics/spec_20250816141740.py +0 -178
- neverlib/.history/metrics/spec_20250816142030.py +0 -178
- neverlib/.history/metrics/spec_20250816142107.py +0 -135
- neverlib/.history/metrics/spec_20250816142126.py +0 -135
- neverlib/.history/metrics/spec_20250816142410.py +0 -135
- neverlib/.history/metrics/spec_20250816142415.py +0 -136
- neverlib/.history/metrics/spec_metric_20250816135156.py +0 -0
- neverlib/.history/metrics/spec_metric_20250816135226.py +0 -5
- neverlib/.history/metrics/spec_metric_20250816135227.py +0 -10
- neverlib/.history/metrics/spec_metric_20250816135306.py +0 -15
- neverlib/.history/metrics/spec_metric_20250816135442.py +0 -31
- neverlib/.history/metrics/spec_metric_20250816135448.py +0 -31
- neverlib/.history/metrics/spec_metric_20250816135520.py +0 -29
- neverlib/.history/metrics/spec_metric_20250816135537.py +0 -63
- neverlib/.history/metrics/spec_metric_20250816135653.py +0 -65
- neverlib/.history/utils/audio_split_20250805234209.py +0 -268
- neverlib/.history/utils/audio_split_20250904185309.py +0 -268
- neverlib/.history/utils/utils_20250813165516.py +0 -330
- neverlib/.history/utils/utils_20250904181341.py +0 -328
- neverlib/.history/utils/utils_20250904185546.py +0 -352
- neverlib/.history/utils/utils_20250904185548.py +0 -353
- neverlib/.history/utils/utils_20250904185603.py +0 -353
- neverlib/.history/utils/utils_20250904185636.py +0 -353
- neverlib/.history/utils/utils_20250904185658.py +0 -358
- neverlib/.history/utils/utils_20250904190053.py +0 -359
- neverlib/.history/vad/PreProcess_20250805234211.py +0 -63
- neverlib/.history/vad/PreProcess_20250809232455.py +0 -63
- neverlib/.history/vad/PreProcess_20250816020725.py +0 -66
- neverlib/.history/vad/VAD_Silero_20250805234211.py +0 -50
- neverlib/.history/vad/VAD_Silero_20250809232456.py +0 -50
- neverlib/.history/vad/VAD_WebRTC_20250805234211.py +0 -61
- neverlib/.history/vad/VAD_WebRTC_20250809232456.py +0 -61
- neverlib/.history/vad/VAD_funasr_20250805234211.py +0 -54
- neverlib/.history/vad/VAD_funasr_20250809232456.py +0 -54
- neverlib/.history/vad/VAD_vadlib_20250805234211.py +0 -70
- neverlib/.history/vad/VAD_vadlib_20250809232455.py +0 -70
- neverlib/.history/vad/VAD_whisper_20250805234211.py +0 -55
- neverlib/.history/vad/VAD_whisper_20250809232456.py +0 -55
- neverlib/.specstory/.what-is-this.md +0 -69
- neverlib/.specstory/history/2025-08-05_17-06Z-/350/277/231/344/270/200/346/255/245/347/232/204/347/233/256/347/232/204/346/230/257/344/273/200/344/271/210.md +0 -424
- neverlib/.specstory/history/2025-08-22_02-10Z-/345/256/214/345/226/204/345/207/275/346/225/260/347/232/204/345/212/237/350/203/275/345/222/214/345/217/230/351/207/217/345/220/215/345/273/272/350/256/256.md +0 -247
- neverlib/.specstory/history/2025-08-26_11-54Z-oserror-missing-shared-object-file.md +0 -87
- neverlib/.specstory/history/2025-08-27_08-07Z-/345/256/214/345/226/204/346/265/213/350/257/225/346/226/207/346/241/243/347/232/204/350/256/250/350/256/272.md +0 -296
- neverlib/.specstory/history/2025-08-27_08-29Z-delete-python-file-command.md +0 -211
- neverlib/.specstory/history/2025-08-27_09-05Z-/345/234/250jupyter/344/270/255/346/222/255/346/224/276/351/237/263/351/242/221/347/232/204/344/273/243/347/240/201/344/277/256/346/224/271.md +0 -357
- neverlib-0.2.8.dist-info/RECORD +0 -510
- {neverlib-0.2.8.dist-info → neverlib-0.3.0.dist-info}/WHEEL +0 -0
- {neverlib-0.2.8.dist-info → neverlib-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {neverlib-0.2.8.dist-info → neverlib-0.3.0.dist-info}/top_level.txt +0 -0
neverlib/utils/utils.py
CHANGED
|
@@ -16,14 +16,14 @@ import numpy as np
|
|
|
16
16
|
EPS = np.finfo(float).eps
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
def get_path_list(
|
|
19
|
+
def get_path_list(source_dir, end="*.wav", shuffle=False):
|
|
20
20
|
wav_list = []
|
|
21
|
-
for root, dirnames, filenames in os.walk(
|
|
21
|
+
for root, dirnames, filenames in os.walk(source_dir):
|
|
22
22
|
# 实现列表特殊字符的过滤或筛选,返回符合匹配“.wav”字符列表
|
|
23
23
|
for filename in fnmatch.filter(filenames, end):
|
|
24
24
|
wav_list.append(os.path.join(root, filename))
|
|
25
25
|
if os.environ.get("LOCAL_RANK", "0") == "0":
|
|
26
|
-
print(
|
|
26
|
+
print(source_dir, len(wav_list))
|
|
27
27
|
if shuffle:
|
|
28
28
|
random.shuffle(wav_list)
|
|
29
29
|
return wav_list
|
|
@@ -63,26 +63,6 @@ def get_audio_segments(sentence_len,
|
|
|
63
63
|
return wav
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
def rename_files_and_folders(directory, replace='_-', replacement='_'):
|
|
67
|
-
# 将路径的指定字符替换为指定字符
|
|
68
|
-
for root, dirs, files in os.walk(directory):
|
|
69
|
-
for filename in files:
|
|
70
|
-
if replace in filename:
|
|
71
|
-
new_filename = filename.replace(replace, replacement)
|
|
72
|
-
old_path = os.path.join(root, filename)
|
|
73
|
-
new_path = os.path.join(root, new_filename)
|
|
74
|
-
os.rename(old_path, new_path)
|
|
75
|
-
print(f'Renamed file: {old_path} -> {new_path}')
|
|
76
|
-
|
|
77
|
-
for folder in dirs:
|
|
78
|
-
if replace in folder:
|
|
79
|
-
new_folder = folder.replace(replace, replacement)
|
|
80
|
-
old_path = os.path.join(root, folder)
|
|
81
|
-
new_path = os.path.join(root, new_folder)
|
|
82
|
-
os.rename(old_path, new_path)
|
|
83
|
-
print(f'Renamed folder: {old_path} -> {new_path}')
|
|
84
|
-
|
|
85
|
-
|
|
86
66
|
def get_file_time(file_path):
|
|
87
67
|
# 获取最后修改时间
|
|
88
68
|
mod_time = os.path.getmtime(file_path)
|
|
@@ -174,43 +154,13 @@ def TrainValTestSplit(dataset_dir,
|
|
|
174
154
|
)
|
|
175
155
|
|
|
176
156
|
|
|
177
|
-
def get_leaf_folders(directory):
|
|
178
|
-
# 获取最底层的文件夹路径
|
|
179
|
-
leaf_folders = []
|
|
180
|
-
for root, dirs, _ in os.walk(directory):
|
|
181
|
-
if not dirs: # 如果当前文件夹没有子文件夹
|
|
182
|
-
leaf_folders.append(root)
|
|
183
|
-
return leaf_folders
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
def del_empty_folders(path):
|
|
187
|
-
"""递归删除空文件夹(先删除子文件夹, 再删除父文件夹)"""
|
|
188
|
-
if not os.path.isdir(path):
|
|
189
|
-
return
|
|
190
|
-
|
|
191
|
-
# 获取子文件夹
|
|
192
|
-
subfolders = [
|
|
193
|
-
os.path.join(path, d) for d in os.listdir(path)
|
|
194
|
-
if os.path.isdir(os.path.join(path, d))
|
|
195
|
-
]
|
|
196
|
-
|
|
197
|
-
# 递归处理子文件夹
|
|
198
|
-
for subfolder in subfolders:
|
|
199
|
-
del_empty_folders(subfolder)
|
|
200
|
-
|
|
201
|
-
# 如果文件夹为空,则删除
|
|
202
|
-
if not os.listdir(path):
|
|
203
|
-
os.rmdir(path)
|
|
204
|
-
print(f"删除空文件夹: {path}")
|
|
205
|
-
|
|
206
|
-
|
|
207
157
|
def DatasetSubfloderSplit(source_dir, split_dirs, percentage=None):
|
|
208
158
|
"""
|
|
209
159
|
将一个数据集按照子文件夹数量分割成train/val/test数据集
|
|
210
160
|
Args:
|
|
211
161
|
source_dir (str): 源数据集目录
|
|
212
162
|
split_dirs (list): 目标目录列表, 如 [train_dir, val_dir] 或 [train_dir, val_dir, test_dir]
|
|
213
|
-
percentage (list, optional): 分割比例, 如 [0.9, 0.1] 或 [0.8, 0.1, 0.1]
|
|
163
|
+
percentage (list, optional): 分割比例, 如 [0.9, 0.1] 或 [0.8, 0.1, 0.1]. 默认为 None, 此时:
|
|
214
164
|
- 如果是两路分割, 默认为 [0.9, 0.1]
|
|
215
165
|
- 如果是三路分割, 默认为 [0.8, 0.1, 0.1]
|
|
216
166
|
Example:
|
|
@@ -239,7 +189,7 @@ def DatasetSubfloderSplit(source_dir, split_dirs, percentage=None):
|
|
|
239
189
|
|
|
240
190
|
# 验证输入参数
|
|
241
191
|
if len(split_dirs) not in [2, 3]:
|
|
242
|
-
raise ValueError("只支持2路或3
|
|
192
|
+
raise ValueError("只支持2路或3路分割(训练集/验证集 或 训练集/验证集/测试集)")
|
|
243
193
|
if len(percentage) != len(split_dirs):
|
|
244
194
|
raise ValueError("分割比例数量必须与目标目录数量相同")
|
|
245
195
|
if sum(percentage) != 1.0:
|
|
@@ -282,30 +232,6 @@ def DatasetSubfloderSplit(source_dir, split_dirs, percentage=None):
|
|
|
282
232
|
print(f"{split_name.capitalize()} folders: {len(folders)}")
|
|
283
233
|
|
|
284
234
|
|
|
285
|
-
def pcm2wav(pcm_path, wav_path, sr=16000, channels=1, subtype='PCM_16'):
|
|
286
|
-
"""
|
|
287
|
-
将pcm文件转换为wav文件
|
|
288
|
-
:param pcm_path: pcm文件路径
|
|
289
|
-
:param wav_path: wav文件路径
|
|
290
|
-
:param sr: 采样率
|
|
291
|
-
:param channels: 声道数
|
|
292
|
-
:param subtype: 子类型
|
|
293
|
-
"""
|
|
294
|
-
pcm_data = np.fromfile(pcm_path, dtype=np.int16)
|
|
295
|
-
pcm_data = pcm_data.reshape(-1, channels) # 支持多通道
|
|
296
|
-
sf.write(wav_path, pcm_data, sr, subtype=subtype)
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
def wav2pcm(wav_path, pcm_path):
|
|
300
|
-
"""
|
|
301
|
-
将wav文件转换为pcm文件
|
|
302
|
-
:param wav_path: wav文件路径
|
|
303
|
-
:param pcm_path: pcm文件路径
|
|
304
|
-
"""
|
|
305
|
-
data, _ = sf.read(wav_path, dtype='int16')
|
|
306
|
-
data.tofile(pcm_path)
|
|
307
|
-
|
|
308
|
-
|
|
309
235
|
def save_weight_histogram(model,
|
|
310
236
|
save_dir,
|
|
311
237
|
mode=["params", "buffers"],
|
|
@@ -387,16 +313,107 @@ def save_weight_histogram(model,
|
|
|
387
313
|
plt.close()
|
|
388
314
|
|
|
389
315
|
|
|
390
|
-
def
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
316
|
+
def merge_tensorboard(event_dir, start_step: int = None, skip_item: str = None):
|
|
317
|
+
try:
|
|
318
|
+
from torch.utils.tensorboard import SummaryWriter
|
|
319
|
+
from tensorboard.backend.event_processing import event_accumulator
|
|
320
|
+
from collections import defaultdict
|
|
321
|
+
except ImportError:
|
|
322
|
+
raise ImportError("请安装torch和tensorboard")
|
|
323
|
+
|
|
324
|
+
event_path_list = get_path_list(event_dir, "*events.out.tfevents.*")
|
|
325
|
+
|
|
326
|
+
# 1. 汇总所有数据
|
|
327
|
+
all_data = defaultdict(list)
|
|
328
|
+
for event_path in event_path_list:
|
|
329
|
+
print(f"Loading {os.path.basename(event_path)}")
|
|
330
|
+
ea = event_accumulator.EventAccumulator(event_path)
|
|
331
|
+
ea.Reload()
|
|
332
|
+
tags = ea.scalars.Keys()
|
|
333
|
+
for tag in tags:
|
|
334
|
+
all_data[tag].extend(ea.scalars.Items(tag))
|
|
335
|
+
|
|
336
|
+
# 2. 写入数据
|
|
337
|
+
writer = SummaryWriter(log_dir=event_dir)
|
|
338
|
+
for tag, items in all_data.items():
|
|
339
|
+
unique_items = {item.step: item for item in sorted(items, key=lambda x: x.wall_time)} # 按wall_time排序
|
|
340
|
+
sorted_items = sorted(unique_items.values(), key=lambda x: x.step) # 按step排序
|
|
341
|
+
|
|
342
|
+
if skip_item is not None and skip_item in tag:
|
|
343
|
+
continue
|
|
344
|
+
for item in sorted_items:
|
|
345
|
+
if start_step is not None and item.step < start_step:
|
|
346
|
+
continue
|
|
347
|
+
writer.add_scalar(tag, item.value, item.step, walltime=item.wall_time)
|
|
348
|
+
|
|
349
|
+
# 确保数据写入磁盘
|
|
350
|
+
writer.flush()
|
|
351
|
+
writer.close()
|
|
352
|
+
print("所有数据已写入TensorBoard, 请刷新TensorBoard页面查看")
|
|
353
|
+
for event_path in event_path_list:
|
|
354
|
+
os.remove(event_path)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def log_time(log_path):
|
|
358
|
+
import re
|
|
359
|
+
from datetime import datetime, timedelta
|
|
360
|
+
|
|
361
|
+
with open(log_path, "r", encoding="utf-8") as f:
|
|
362
|
+
log_data = f.read()
|
|
363
|
+
|
|
364
|
+
# 使用正则表达式提取 "train" 前面的时间戳
|
|
365
|
+
train_times = re.findall(r'(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}) - train', log_data)
|
|
366
|
+
|
|
367
|
+
# 将字符串转换为 datetime 对象
|
|
368
|
+
train_times_dt = [datetime.strptime(time, '%Y-%m-%d %H:%M:%S,%f') for time in train_times]
|
|
369
|
+
# train_times_dt = train_times_dt[10:]
|
|
370
|
+
|
|
371
|
+
# 计算每段时间之间的时间差
|
|
372
|
+
for i in range(1, len(train_times_dt)):
|
|
373
|
+
time_diff = train_times_dt[i] - train_times_dt[i - 1]
|
|
374
|
+
print(f"时间间隔 {i}: {time_diff}")
|
|
375
|
+
# train_times_dt= train_times_dt[-10:]
|
|
376
|
+
# 计算每段时间之间的时间差, 并存储在列表中
|
|
377
|
+
time_diffs = [train_times_dt[i] - train_times_dt[i - 1] for i in range(1, len(train_times_dt))]
|
|
378
|
+
|
|
379
|
+
# 计算时间间隔的总和
|
|
380
|
+
total_time_diff = sum(time_diffs, timedelta())
|
|
381
|
+
|
|
382
|
+
# 计算平均时间间隔
|
|
383
|
+
average_time_diff = total_time_diff / len(time_diffs)
|
|
384
|
+
|
|
385
|
+
# 输出平均时间间隔
|
|
386
|
+
print(f"平均时间间隔: {average_time_diff}")
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
# 删除重复的路径
|
|
390
|
+
def del_duplicate_path(file_path_list):
|
|
391
|
+
for file_path in file_path_list:
|
|
392
|
+
file_dir, file_name = os.path.dirname(file_path), os.path.basename(file_path)
|
|
393
|
+
itemID = file_dir.split("/")[-1]
|
|
394
|
+
if itemID in file_name:
|
|
395
|
+
file_name_new = file_name.replace(itemID + "_", "")
|
|
396
|
+
os.rename(file_path, os.path.join(file_dir, file_name_new))
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
def remove_parent_dir_prefix(wav_path_list):
|
|
400
|
+
for wav_path in wav_path_list:
|
|
401
|
+
path = Path(wav_path)
|
|
402
|
+
|
|
403
|
+
if not path.exists():
|
|
404
|
+
continue
|
|
405
|
+
|
|
406
|
+
# path.parent.name 自动获取父目录名
|
|
407
|
+
parent_name = path.parent.name
|
|
408
|
+
prefix = parent_name + "_"
|
|
409
|
+
|
|
410
|
+
if path.name.startswith(prefix):
|
|
411
|
+
# 移除前缀
|
|
412
|
+
new_name = path.name.replace(prefix, "", 1) # 只替换第一个匹配项
|
|
413
|
+
target_path = path.with_name(new_name)
|
|
414
|
+
|
|
415
|
+
if not target_path.exists():
|
|
416
|
+
path.rename(target_path)
|
|
417
|
+
else:
|
|
418
|
+
print(f"Target exists: {target_path}")
|
|
401
419
|
|
|
402
|
-
return audio_data
|
neverlib/vad/README.md
CHANGED
|
@@ -40,16 +40,16 @@ mode 0~3
|
|
|
40
40
|
|
|
41
41
|
0: 最低的语音检测敏感度,
|
|
42
42
|
|
|
43
|
-
- 认为背景噪声不是语音, 适合环境较安静,
|
|
44
|
-
- 适合环境较安静,
|
|
43
|
+
- 认为背景噪声不是语音, 适合环境较安静, 背景噪声少的情况.
|
|
44
|
+
- 适合环境较安静, 背景噪声少的情况.
|
|
45
45
|
|
|
46
46
|
3: 最高的语音检测敏感度,
|
|
47
47
|
|
|
48
|
-
- VAD 会非常积极地尝试将任何噪声过滤掉,
|
|
49
|
-
- 适合环境较吵,
|
|
48
|
+
- VAD 会非常积极地尝试将任何噪声过滤掉, 只有明确的语音才会被认为是语音.
|
|
49
|
+
- 适合环境较吵, 背景噪声多的情况.
|
|
50
50
|
|
|
51
51
|
## whisper
|
|
52
52
|
|
|
53
|
-
whisper 检测的 词与词之间的VAD
|
|
53
|
+
whisper 检测的 词与词之间的VAD 都是连着的. 但其实音频不是
|
|
54
54
|
|
|
55
55
|
而且Whisper的VAD并没有直接提供调参接口, 所以无法调整VAD的参数
|
neverlib/vad/__init__.py
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
from typing import TYPE_CHECKING, Any
|
|
5
5
|
|
|
6
6
|
if TYPE_CHECKING:
|
|
7
|
-
#
|
|
7
|
+
# 仅在类型检查时导入, 提供IDE补全支持
|
|
8
8
|
from .PreProcess import NS, NS_test, pre_emphasis
|
|
9
9
|
from .VAD_Energy import EnergyVad_C
|
|
10
10
|
from .VAD_Silero import Silero_VAD_C
|
|
@@ -68,4 +68,4 @@ if TYPE_CHECKING:
|
|
|
68
68
|
'from_vadArray_to_vadEndpoint',
|
|
69
69
|
'vad2nad',
|
|
70
70
|
'vad_smooth',
|
|
71
|
-
]
|
|
71
|
+
]
|
neverlib/vad/utils.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: neverlib
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: A successful sign for python setup
|
|
5
5
|
Author-email: "Never.Ling" <1786088386@qq.com>
|
|
6
6
|
License: MIT
|
|
@@ -47,9 +47,17 @@ Requires-Dist: neverlib[vad]; extra == "all"
|
|
|
47
47
|
Requires-Dist: neverlib[gpu]; extra == "all"
|
|
48
48
|
Dynamic: license-file
|
|
49
49
|
|
|
50
|
+
<!--
|
|
51
|
+
* @Author: never.ling never.ling@anker-in.com
|
|
52
|
+
* @Date: 2025-11-04 17:10:57
|
|
53
|
+
* @LastEditors: never.ling never.ling@anker-in.com
|
|
54
|
+
* @LastEditTime: 2025-12-15 11:47:03
|
|
55
|
+
* @FilePath: /neverlib/README.md
|
|
56
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
57
|
+
-->
|
|
50
58
|
# NeverLib
|
|
51
59
|
|
|
52
|
-
一个用于音频处理和VAD
|
|
60
|
+
一个用于音频处理和VAD(语音活动检测)的Python工具库.
|
|
53
61
|
|
|
54
62
|
## 安装
|
|
55
63
|
|
|
@@ -113,9 +121,15 @@ from neverlib import utils
|
|
|
113
121
|
from neverlib.message import seed_QQEmail
|
|
114
122
|
```
|
|
115
123
|
|
|
124
|
+
## TODO List
|
|
125
|
+
- [ ] 客观指标添加 [DNSMOSPro ](https://github.com/fcumlin/DNSMOSPro)
|
|
126
|
+
- [ ] github界面的自我介绍
|
|
127
|
+
- [ ] https://github.com/nathanhaigh/parallel-rsync
|
|
128
|
+
|
|
129
|
+
|
|
116
130
|
## 许可证
|
|
117
131
|
|
|
118
|
-
本项目采用MIT
|
|
132
|
+
本项目采用MIT许可证. 详情请参阅LICENSE文件.
|
|
119
133
|
|
|
120
134
|
## 作者
|
|
121
135
|
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
neverlib/__init__.py,sha256=hPhtK8OM3gp9Jlu8VRP1etTi4-iOCCf3jlmQ4gS85wE,2041
|
|
2
|
+
neverlib/Docs/audio_aug/test_volume.ipynb,sha256=mSTB_1R2b8t5IEiifpTuyV-HKOmW4Q2Z7QMgeRkp2B8,18366
|
|
3
|
+
neverlib/Docs/audio_aug_test/test_snr.py,sha256=1BRUzTYL37pblvhHNB0ORtrbNyxTFWytAxlJ8CDSwfM,1317
|
|
4
|
+
neverlib/Docs/audio_aug_test/test_volume.ipynb,sha256=ZKDPm7Dr8ooZvO6nItshiVIY7jkh2a5AcmUw4wqsB0k,1843460
|
|
5
|
+
neverlib/Docs/audio_aug_test/test_volume.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
neverlib/Docs/filter/biquad.ipynb,sha256=vSAbUSvPUuCEtrO1tHzEyrtuRW0s_bCG38ZUornOVck,3087
|
|
7
|
+
neverlib/Docs/filter/filter_family.ipynb,sha256=cisPF1iMUAArSpUxuzzqsuCywCslLMozFeZtDb5VUfI,1135210
|
|
8
|
+
neverlib/Docs/filter/highpass.ipynb,sha256=-sT6-xH9zV7mR6wWZ9Jnqt9lbUEajGafbhGvUVY98IY,40181
|
|
9
|
+
neverlib/Docs/filter/scipy_filter_family.ipynb,sha256=dLhf4BG3KF6jlfiPKeq6Rl5DrUnx0jDx74an4J7ktGk,79092
|
|
10
|
+
neverlib/Docs/vad/VAD_Energy.ipynb,sha256=qqw6_YwRGAbMcU2_F-1XXomU-y42HDY9WYCMxQVvD58,317091
|
|
11
|
+
neverlib/Docs/vad/VAD_Silero.ipynb,sha256=LREAdVkgdKW_XB5N6SFkHHCRqTkkQxigWOFH9Vhxops,303837
|
|
12
|
+
neverlib/Docs/vad/VAD_WebRTC.ipynb,sha256=jK_L2_JuKGoVX0xQL5UKJzxHnc9ndLYwA6DHJSO-egs,324759
|
|
13
|
+
neverlib/Docs/vad/VAD_funasr.ipynb,sha256=-4KVReX7IqKfufBHk0oTEYNfzaqlJE5mDuYC8TGhv7U,251035
|
|
14
|
+
neverlib/Docs/vad/VAD_rvADfast.ipynb,sha256=YszYIEG_qVUU2hzvbraY4y5fdMToT--50Za1A3IBozc,252432
|
|
15
|
+
neverlib/Docs/vad/VAD_statistics.ipynb,sha256=wT0k_91YUpLLIt6LZMKrjvJLk4kz8g-fZdBvVH07O2k,346246
|
|
16
|
+
neverlib/Docs/vad/VAD_tenVAD.ipynb,sha256=w8oOBVeabW44Fw7TF6CSxIqa3u1gGydoMuWSxE7slaA,351893
|
|
17
|
+
neverlib/Docs/vad/VAD_vadlib.ipynb,sha256=m55oKqOGeMOSgmQlbMkOR6zVh5_Hn6SIocHi6mOtg1k,300998
|
|
18
|
+
neverlib/Docs/vad/VAD_whisper.ipynb,sha256=MsHzjFiD6sLGiyOQeVM4ec9HHfUwdMN-HP4c08-Q7xo,364205
|
|
19
|
+
neverlib/LLM/__init__.py,sha256=jXxWbqG9AXcBaSMj1m29FkDgfzMX55JcJD2xsiCMXe0,909
|
|
20
|
+
neverlib/LLM/bailian.py,sha256=GrUix-OyM1HqVQOQx4HMYuXwEdEd8znUucXJROwQSms,11673
|
|
21
|
+
neverlib/LLM/image.py,sha256=kI1hzGBToLygbsfWnMJjSnrEEONKjV_qU-WBswZHoFk,2501
|
|
22
|
+
neverlib/LLM/text.py,sha256=2G4NT4sbbcwyVCyHQ7jvAy9EbToDZUaUlpogvX5Kd7c,1003
|
|
23
|
+
neverlib/QA/ImpactNoiseRejection.py,sha256=8kCNR-O8_2YtLBAAuh01SFfoptJtHFuliHxhcTBe73Q,3877
|
|
24
|
+
neverlib/QA/gen_init.py,sha256=pVXJoThVMIygijkPIYg6wHcDiCwWAkoioFP7qzY7Flc,7993
|
|
25
|
+
neverlib/QA/get_fun.py,sha256=-UP2FOm3jB_138ntpbsW0eG1S0tJ0d90NqI6f95ryYg,541
|
|
26
|
+
neverlib/QA/html2markdown.py,sha256=ZiXvpwcJ_QBhIR6aetaMOmktWHtd_F7Ed07Deo3qM4c,669
|
|
27
|
+
neverlib/audio_aug/HarmonicDistortion.py,sha256=6VlM7YHwM-Bg-f6bNLsuIIXELRrbbfu3TEySorM5KPo,2684
|
|
28
|
+
neverlib/audio_aug/README.md,sha256=hoYtGNUSMXrPA3GUs1TZVwELxTf7nuQRyt_bpW6F95I,130
|
|
29
|
+
neverlib/audio_aug/TFDrop.py,sha256=HDLf5qfqMT73-dxKder0v0AT7b0FYsSlexbbh3sL2iM,987
|
|
30
|
+
neverlib/audio_aug/TFMask.py,sha256=Fakx5YTj88bZEdj_w3aH9Z9AhEGzGq01TZcnjF4v4BU,1769
|
|
31
|
+
neverlib/audio_aug/__init__.py,sha256=t-m5D4u7gZMEE7xNGDi4hZMi7HINCk7DQ23c2JRToNY,3311
|
|
32
|
+
neverlib/audio_aug/audio_aug.py,sha256=h_UjBnTvX7hVeRMDsQbyAIOyMLft-GWMRenGPfjFmdU,16607
|
|
33
|
+
neverlib/audio_aug/clip_aug.py,sha256=xZi89AtdOgUpX7W4x4_UiZFeK-oCWktueoWSEAY19hU,1041
|
|
34
|
+
neverlib/audio_aug/coder_aug.py,sha256=BPoEg96EDRMzK6cvkYrWTL6dOyX6YKpjbx5nURZcOWg,8314
|
|
35
|
+
neverlib/audio_aug/coder_aug2.py,sha256=EVhzzYPSEUq-XYiu_jGaDLK2PtxgK0jFXsPPSzk2-ac,4713
|
|
36
|
+
neverlib/audio_aug/loss_packet_aug.py,sha256=pQu3PIJVpFJVyyxs7dmLG0N3GBMiQDAAtjmIdl7CaTw,4824
|
|
37
|
+
neverlib/audio_aug/quant_aug.py,sha256=q9BehCXz7HZhiZFW35iZ0fPChEdo-dE8ArJ-DJMDtA8,2601
|
|
38
|
+
neverlib/data/000_short_enhance.wav,sha256=TUZSjHareIY3BFlgZiDuffzirpxnEKagnQDVwDYLdgk,216356
|
|
39
|
+
neverlib/data/3956_speech.wav,sha256=wehCr85ITMOmkQWi1DnjRzb2ggC-XJUftZ3_9sARvS8,2977476
|
|
40
|
+
neverlib/data/3956_sweep.wav,sha256=DoLnlIkYGSuraIE7nWK4nAvmgGWWW4VuhI7xDoMrLys,813832
|
|
41
|
+
neverlib/data/vad_example.wav,sha256=xvcEvjmdjeZO-1fT7u0m0EuiJAqeXUWjBWewDWd8guY,216812
|
|
42
|
+
neverlib/data/white.wav,sha256=JJ3aaPx8v7WakYU7U--m0kO1qUkDSMOrOrPKi6RqAA0,325086
|
|
43
|
+
neverlib/data/white_EQ.wav,sha256=UN1W0hH_4JInnye9vIsQlagVXM-rnJPd1j7A_RIia8c,325086
|
|
44
|
+
neverlib/data/white_matched.wav,sha256=h9vD-2q1eKw9s8pVUoIeXXjeKEC-VRiNABCY-CYcUQ0,115514
|
|
45
|
+
neverlib/data_analyze/README.md,sha256=UoqrTIaMQiPQvAYrOk7Trw53YQNQXn2Vl6DSTEp3mos,6050
|
|
46
|
+
neverlib/data_analyze/__init__.py,sha256=f992HttF5K3CActULLsJPlEIQKkzEOWnCllOIhHezw0,2779
|
|
47
|
+
neverlib/data_analyze/dataset_analyzer.py,sha256=spB6zWru0oW8qP_zDGxkuj43cdf12izfN_BCSTS5CmU,21894
|
|
48
|
+
neverlib/data_analyze/quality_metrics.py,sha256=Rv4xmxdQZDc0oUAPg8ec8a2RoobPa7DcqHnad7PdcFc,11678
|
|
49
|
+
neverlib/data_analyze/rms_distrubution.py,sha256=EpK9s7WJLtJHXd1xD8SvuiyPVTguouYVHyS7Lha2Qag,1526
|
|
50
|
+
neverlib/data_analyze/spectral_analysis.py,sha256=-QZGSvopovLaSh7OcJLYKFH9YLIp_THXUEV3uOreHz0,5894
|
|
51
|
+
neverlib/data_analyze/statistics.py,sha256=2yCUZ5-B1vzocl-X3NYC5lBk3kshNp9jHyRrktYaIls,12953
|
|
52
|
+
neverlib/data_analyze/temporal_features.py,sha256=qrxA0Uh-DxRPbuILQle66AAgv4SgwiLoPTIR9Q2_Jz4,3065
|
|
53
|
+
neverlib/data_analyze/visualization.py,sha256=uvHO_PnzlaKtSFoUhDhRZyqR9uxSBM71PnBqBBPcGCA,16435
|
|
54
|
+
neverlib/filter/README.md,sha256=AYbW2v5Z4WVA6CFwQ11EuR9GYjzoentQPWGh48htK7M,3792
|
|
55
|
+
neverlib/filter/__init__.py,sha256=5vVwbjUitVG9aBZ13qWsXVt7QcG8d0k4uWz6fmUPdvc,1017
|
|
56
|
+
neverlib/filter/biquad.py,sha256=_9hJWI3TY9zEdMkkOWAFJlbyJ4Rm46teezVt90o9fGM,1434
|
|
57
|
+
neverlib/filter/common.py,sha256=9FD3VKwRpe_IdQujt2AJjlMJ_WR-YNEY8OmhOQUDDO8,1953
|
|
58
|
+
neverlib/filter/core.py,sha256=JGNZugcMu9y1VLt5o3a7E-UDiI4PMUi9-NikNHR7i1s,13152
|
|
59
|
+
neverlib/filter/auto_eq/README.md,sha256=Bhu9QthugB-RvEFZKYnv2C6_BYg43o1t1Yp_WBBWmg8,4966
|
|
60
|
+
neverlib/filter/auto_eq/__init__.py,sha256=KOaiZjGti3SQsS0ogKqlxNR4jNACHICeFBVT_8ZBIU0,2188
|
|
61
|
+
neverlib/filter/auto_eq/de_eq.py,sha256=AhAvSb8mMy2IyYDquERkphTzGRVvPv8bNluybTN427Y,16410
|
|
62
|
+
neverlib/filter/auto_eq/freq_eq.py,sha256=1b5hnoqUy1zxVd2WSNqhpokAgJo0xTRwR5AyVPaMr3E,3494
|
|
63
|
+
neverlib/filter/auto_eq/ga_eq_advanced.py,sha256=MCEujrRwPXn9Heu6RYTUBJuEYFDYNrkarvBJTo_WHiw,23450
|
|
64
|
+
neverlib/filter/auto_eq/ga_eq_basic.py,sha256=QiA0Tp_rjD3hgA8oaUh2u8o8Co1FobKs_5ojgEuL2BE,15427
|
|
65
|
+
neverlib/metrics/README.md,sha256=n6Z4AgrRVOhQfxz8wT1i-oHWFuSvUCwzCcZI6FXO4HI,621
|
|
66
|
+
neverlib/metrics/__init__.py,sha256=-547hL2cr5d-EyLhbKBom0fH_ONdfKOF8XGMOaAoiwA,1626
|
|
67
|
+
neverlib/metrics/dnsmos.py,sha256=BGCNoWI3gCNPPPyMWSVyWqqGYQk-6agJA7CVnWyZJ_k,4582
|
|
68
|
+
neverlib/metrics/lpc_lsp.py,sha256=Bd8ngYbdiPekkSnuc57wRF8bPZLRFhvzsxXdsQshyT0,3686
|
|
69
|
+
neverlib/metrics/snr.py,sha256=Oopu9jKEAeoBL7v0ClAPD20XTnAoM8UG9ey33NVhjkk,6355
|
|
70
|
+
neverlib/metrics/spec.py,sha256=rvr7zXi5JnU0rKZn49Pa_M84atIaYlDLSzTgZOQ7YsA,5415
|
|
71
|
+
neverlib/metrics/test_pesq.py,sha256=NldkQ_s99L-p747046gMtIUqc8fdYYhhH8jmvLmRFus,1207
|
|
72
|
+
neverlib/metrics/time.py,sha256=MSUdaT3WvFRnL_wvjZEGjwcVrsy7KwArz3hLkYcXF7s,1292
|
|
73
|
+
neverlib/metrics/DNSMOS/bak_ovr.onnx,sha256=XzNckJlGGBUBkqZWpHS8-KnLztvEeWVJS6jaeWBdEwg,742375
|
|
74
|
+
neverlib/metrics/DNSMOS/model_v8.onnx,sha256=kkZIDFhWe8av_UIAk4537vSUaMi8ftN3bRCcB0VvbpE,224860
|
|
75
|
+
neverlib/metrics/DNSMOS/sig.onnx,sha256=0vvbKTvCNm37rit0d8SQ-YHSSotEBe_TwReHVpxlSdc,742203
|
|
76
|
+
neverlib/metrics/DNSMOS/sig_bak_ovr.onnx,sha256=Jp--vbUTqiPN37tZNULsxUAoSpGEmsUFFocOGsePbt0,1157965
|
|
77
|
+
neverlib/metrics/pDNSMOS/sig_bak_ovr.onnx,sha256=njoZdEnKIXfwmXr-w71riQEXzi8XuJ1u6n-g1HJyyBw,1157962
|
|
78
|
+
neverlib/metrics/pesq_c/PESQ,sha256=f8qbES1y_94XvHgddOpVqOu0aJBym0z2FXvwq1egBGQ,89400
|
|
79
|
+
neverlib/metrics/pesq_c/dsp.c,sha256=N81r8Hdt-xCUW69ALvECknZHThEhah4okjnxIi1T8Ug,15233
|
|
80
|
+
neverlib/metrics/pesq_c/dsp.h,sha256=I1mOP3JsTNqyEdhI3W3FRBAOltDJnJpXG0ShXbVXM2E,5457
|
|
81
|
+
neverlib/metrics/pesq_c/pesq.h,sha256=wkqE2Vf6EB4QnP16c8jXM-cTBO2SVvmc9JiRNvbHLNs,9430
|
|
82
|
+
neverlib/metrics/pesq_c/pesqdsp.c,sha256=YlGSRes0qJgCyPwe1Zb5bShjGQnDzRE08Ecpv5y0A1E,33879
|
|
83
|
+
neverlib/metrics/pesq_c/pesqio.c,sha256=S8PLwBfx0oHHVLfZ1jUsGbwwMniFhHNNV8X6bcUxFYU,12930
|
|
84
|
+
neverlib/metrics/pesq_c/pesqmain.c,sha256=NaANjEDJrCFwJBbXErX51ZKtE86SHKdrXLhS0P3TbT0,27322
|
|
85
|
+
neverlib/metrics/pesq_c/pesqmod.c,sha256=9stYhCLUShFAd6Zc85nQn57RUKDbS2Q8MrhQFB_-ySA,52999
|
|
86
|
+
neverlib/metrics/pesq_c/pesqpar.h,sha256=XZkwXcwycL8ekK6LQy_PT9Ih2K0zirSPHCMhGKyJExs,20986
|
|
87
|
+
neverlib/signal_gen/babble_noise_generate.py,sha256=GFPAFyGHRAZiXzIvWEVlbPJZHfdbQBt1wg6dX7cPYzM,4077
|
|
88
|
+
neverlib/tests/__init__.py,sha256=dQb_TDs8wv81tk9Xctx6V8a9QPRVdBPjgz3aDjD1Za4,809
|
|
89
|
+
neverlib/tests/test_imports.py,sha256=Pqkywv553AdpVDPbtNZAZhdW0GyaZgLo54xtE2XGNGQ,546
|
|
90
|
+
neverlib/tests/test_preprocess.py,sha256=GHj2PvlG8chJlV-zpRfy8IYlTXzGkn5heO9ipy6Xe20,1003
|
|
91
|
+
neverlib/tests/test_vad.py,sha256=TjBuB_qPooflrjkkvoy19HySdBo-MiVeb5yTmLGBJvM,415
|
|
92
|
+
neverlib/utils/README.md,sha256=dQWGObpcfC4cDpM0b4zpTY8dC1JwUJQ06VSr-CRrFuI,934
|
|
93
|
+
neverlib/utils/__init__.py,sha256=Gr4WQip3tXuMz9ePEp6C3ug3AWntP2h-GDcIBFHOQ24,3134
|
|
94
|
+
neverlib/utils/audio_split.py,sha256=ww_xpHagTO3vBVgHqTYGwBVWLnOl_4tP--2w97uFXXI,12339
|
|
95
|
+
neverlib/utils/checkGPU.py,sha256=zwROBGeVFrnsXQTcX9iYgd-Zbj0XbRwVqTZei8oznzY,3790
|
|
96
|
+
neverlib/utils/floder.py,sha256=vF44wOfWvGK8-NDCs-CCnzgASCHcxksToIN5K0HDdjo,3805
|
|
97
|
+
neverlib/utils/lazy_expose.py,sha256=IZmexcrg6Bu0RvzZREj-al7TXVl6qEvLDYS4A2NX6sg,1026
|
|
98
|
+
neverlib/utils/lazy_module.py,sha256=RmaBa5dzUsGOQWushSDHtPUZ2IyWXeXi5RsESiFRZXM,3987
|
|
99
|
+
neverlib/utils/message.py,sha256=0pjThmNA8gDnMFf-viGboiSwE-2p5XBZxM3tkmoOxE0,4072
|
|
100
|
+
neverlib/utils/pcm.py,sha256=N50JboAKJK7hIRW7SiXK0MLDsfTun8Xpee7JPJO9BEQ,1240
|
|
101
|
+
neverlib/utils/utils.py,sha256=-EuEHlNHK_IIlXidbzy3Giz7AbD2xfvkJ3CxQXPy1TU,16136
|
|
102
|
+
neverlib/vad/PreProcess.py,sha256=oib4iRfsUXp5U67pKzJF8k53rqjo8NopK_9LW4O8Mqk,2045
|
|
103
|
+
neverlib/vad/README.md,sha256=rhEyxiuM-i78_eTfsbCZGOEoIltWE7TcempePHfp7oQ,1485
|
|
104
|
+
neverlib/vad/VAD_Energy.py,sha256=ErsiDxn4mH_EOiFBRcoBBRqTUsFfEsvEvRELrdZflkw,2135
|
|
105
|
+
neverlib/vad/VAD_Silero.py,sha256=L9_eO94VQcO3TBdOWypJxnjMl5ZZBYTkL5DR_6APfs4,2324
|
|
106
|
+
neverlib/vad/VAD_WebRTC.py,sha256=3A2GY6AoJhdPeXKrYXFpDXF3Ln__CK0yYFKDtMTU6ps,1919
|
|
107
|
+
neverlib/vad/VAD_funasr.py,sha256=oJqU3VOFT-KXmFV2g8kvT64nHIo5-PxcB4tdb-Ap3Bw,1599
|
|
108
|
+
neverlib/vad/VAD_statistics.py,sha256=o310LKoMECBHO6LcqU3vb-uirF6PM2fHbaRautT2w-w,16663
|
|
109
|
+
neverlib/vad/VAD_vadlib.py,sha256=5reZ7blu0BsqqO9WJn8YPIvPQVn8VcFPcJnH1scgEzQ,2228
|
|
110
|
+
neverlib/vad/VAD_whisper.py,sha256=GhBFV-EIS865c-rj2RvM4IUKKG8ZsoD9LCTwrx1Fx2c,1792
|
|
111
|
+
neverlib/vad/__init__.py,sha256=H2Kn5HDwAv4A4QwmOsvQzhOFvcMP3XBGU4OuCBGcGDU,2033
|
|
112
|
+
neverlib/vad/class_get_speech.py,sha256=s1n24I4P4aTFaQSiyXrh_xAmOChuFZ-wWgrYEE6eCHs,2074
|
|
113
|
+
neverlib/vad/class_vad.py,sha256=ao_20-vyzcI8CxEcvcA_-HoRPTiPEtfuKor2_YWEbz0,5212
|
|
114
|
+
neverlib/vad/img.png,sha256=eLlaUgDnJNyleWZwW8sNv3eXaeaGoXwhFUZCCDJh9u8,179778
|
|
115
|
+
neverlib/vad/utils.py,sha256=sEwZtl2Q9sR1FajumpL4XOPAR6A5KT9qH_9F-tnzpYE,3045
|
|
116
|
+
neverlib-0.3.0.dist-info/licenses/LICENSE,sha256=h-U7vhFdQhieyaNCiA_utrRNMk1rjfrBAUJVodgkfsw,1096
|
|
117
|
+
neverlib-0.3.0.dist-info/METADATA,sha256=QkWsOJuRGJAopvbjc3MG1MesXTeDTMlmu1jDPH2Ssag,3367
|
|
118
|
+
neverlib-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
119
|
+
neverlib-0.3.0.dist-info/top_level.txt,sha256=QqwYFuDiY_iFTz0Kx8av6zKCP_s4M5NiMTNsIXOy8Po,9
|
|
120
|
+
neverlib-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'''
|
|
2
|
-
Author: 凌逆战 | Never
|
|
3
|
-
Date: 2025-08-27 16:25:31
|
|
4
|
-
Description:
|
|
5
|
-
'''
|
|
6
|
-
|
|
7
|
-
from audio_aug import volume_norm
|
|
8
|
-
# volume_aug_linmax, volume_aug_dbrms, volume_aug_lufs, measure_loudness
|
|
9
|
-
from audio_aug import volume_aug_linmax, volume_aug_dbrms, volume_aug_lufs, measure_loudness
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'''
|
|
2
|
-
Author: 凌逆战 | Never
|
|
3
|
-
Date: 2025-08-27 16:25:31
|
|
4
|
-
Description:
|
|
5
|
-
'''
|
|
6
|
-
|
|
7
|
-
from audio_aug import volume_norm
|
|
8
|
-
# volume_aug_linmax, volume_aug_dbrms, volume_aug_lufs, measure_loudness
|
|
9
|
-
# from audio_aug import volume_aug_linmax, volume_aug_dbrms, volume_aug_lufs, measure_loudness
|
|
File without changes
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
'''
|
|
2
|
-
Author: 凌逆战 | Never
|
|
3
|
-
Date: 2025-03-24 10:00:14
|
|
4
|
-
Description:
|
|
5
|
-
'''
|
|
6
|
-
# -*- coding:utf-8 -*-
|
|
7
|
-
# Author:凌逆战 | Never
|
|
8
|
-
# Date: 2024/1/29
|
|
9
|
-
"""
|
|
10
|
-
snr增强, 对安静的测试集加指定snr的白噪
|
|
11
|
-
"""
|
|
12
|
-
import numpy as np
|
|
13
|
-
import random
|
|
14
|
-
import soundfile as sf
|
|
15
|
-
from neverlib.metrics.snr import get_snr
|
|
16
|
-
from neverlib.audio_aug import snr_aug_changeNoise, snr_aug_changeNoise_v2
|
|
17
|
-
from neverlib.utils import EPS
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def add_noise(clean, snr_range, snr_aug_rate):
|
|
21
|
-
"""
|
|
22
|
-
Args:
|
|
23
|
-
clean: (*, C)
|
|
24
|
-
snr_range: snr范围 [min, max]
|
|
25
|
-
snr_aug_rate: snr增强率
|
|
26
|
-
Returns:
|
|
27
|
-
"""
|
|
28
|
-
if random.random() < snr_aug_rate:
|
|
29
|
-
snr = random.uniform(snr_range[0], snr_range[1])
|
|
30
|
-
noise = np.random.randn(*clean.shape) # 生成和clean等长的白噪
|
|
31
|
-
noisy = snr_aug_changeNoise(clean, noise, snr)
|
|
32
|
-
else:
|
|
33
|
-
noisy = clean
|
|
34
|
-
snr = 100
|
|
35
|
-
return noisy, snr
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def snr_aug1(clean, snr):
|
|
39
|
-
""" 白噪
|
|
40
|
-
Args:
|
|
41
|
-
clean: (*, C)
|
|
42
|
-
snr: snr值
|
|
43
|
-
Returns:
|
|
44
|
-
"""
|
|
45
|
-
noise = np.random.randn(*clean.shape) # 生成和clean等长的白噪
|
|
46
|
-
|
|
47
|
-
noisy, _ = snr_aug_changeNoise(clean, noise, snr)
|
|
48
|
-
|
|
49
|
-
return noisy
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def snr_aug2(clean, snr):
|
|
53
|
-
"""
|
|
54
|
-
Args:
|
|
55
|
-
clean: (*, C)
|
|
56
|
-
snr_range: snr范围 [min, max]
|
|
57
|
-
snr_aug_rate: snr增强率
|
|
58
|
-
Returns:
|
|
59
|
-
"""
|
|
60
|
-
noise = np.random.randn(*clean.shape) # 生成和clean等长的白噪
|
|
61
|
-
noisy, _ = snr_aug_changeNoise_v2(clean, noise, snr)
|
|
62
|
-
return noisy
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if __name__ == "__main__":
|
|
66
|
-
clean_path = "../wav_data/TIMIT.wav"
|
|
67
|
-
clean, fs = sf.read(clean_path, always_2d=True, dtype="float32")
|
|
68
|
-
|
|
69
|
-
noisy1 = snr_aug1(clean, 10)
|
|
70
|
-
noisy2 = snr_aug2(clean, 10)
|
|
71
|
-
print(clean.shape)
|
|
72
|
-
print(noisy1.shape, noisy2.shape)
|
|
73
|
-
|
|
74
|
-
print(get_snr(clean, noisy1 - clean)) # 10.000000000480982
|
|
75
|
-
print(get_snr(clean, noisy2 - clean)) # 9.999870642663442
|