Skip to content

Commit

Permalink
v0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
CNChTu authored Mar 6, 2024
1 parent f6c6749 commit 726caf5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ audio = torch.from_numpy(audio).float().unsqueeze(0).unsqueeze(-1).to(device)
model = spawn_bundled_infer_model(device=device)

# infer
'''
audio: wav, torch.Tensor
sr: sample rate
decoder_mode: [Optional] 'local_argmax' is recommended
threshold: [Optional] threshold for V/UV decision, 0.006 is recommended
f0_min: [Optional] minimum f0
f0_max: [Optional] maximum f0
interp_uv: [Optional] whether to interpolate unvoiced frames
output_interp_target_length: [Optional] If not None, the output f0 will be
interpolated to the target length
'''
f0 = model.infer(
audio,
sr=sr,
Expand All @@ -39,5 +50,12 @@ f0 = model.infer(
)

print(f0)

# the model is son class of torch.nn.Module, so you can use it as a normal pytorch model
# example: change device
model = model.to(device)
# example: compile model
model = torch.compile(model)

```

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
setup(
name='torchfcpe',
description='The official Pytorch implementation of Fast Context-based Pitch Estimation (FCPE)',
version='0.0.3',
version='0.0.4',
author='CNChTu',
author_email='[email protected]',
url='https://github.com/CNChTu/FCPE',
Expand Down

0 comments on commit 726caf5

Please sign in to comment.