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

Add python API for diart.stream and diart.benchmark #54

Closed
juanmc2005 opened this issue May 12, 2022 · 1 comment
Closed

Add python API for diart.stream and diart.benchmark #54

juanmc2005 opened this issue May 12, 2022 · 1 comment
Labels
API Improvements to the API
Milestone

Comments

@juanmc2005
Copy link
Owner

Problem

Having these scripts is nice but it requires a lot of work to swap pipeline components. For example, how do I benchmark a pipeline with an embedding model from an external library like speechbrain? This currently requires to implement the embedding model, build a new pipeline from scratch and then change diart.benchmark's code, which is not very practical.

Idea

It would be great to have a generic pipeline where components can be swapped easily. Getting there takes a lot of development though, so in the meantime let's at least provide a python API to run streaming and benchmarking out-of-the-box.

This should also facilitate #53.

Example

import torch
from diart.benchmark import Benchmark

gpu = torch.device("cuda:0")
pipeline = SomeCustomPipeline()

benchmark = Benchmark("/path/to/speech", "/path/to/rttm", "/path/to/output", batch_size=32, device=gpu)

benchmark(pipeline)
@juanmc2005 juanmc2005 added the API Improvements to the API label May 12, 2022
@juanmc2005 juanmc2005 added this to the Version 0.3 milestone May 12, 2022
@juanmc2005
Copy link
Owner Author

Implemented in #55.
See docstrings for RealTimeInference and Benchmark for the final API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Improvements to the API
Projects
None yet
Development

No branches or pull requests

1 participant