Skip to content

Add inference lifecycle hooks #102

Open
@juanmc2005

Description

@juanmc2005

Problem

When writing custom models or pipelines, one may want to react to specific inference events, for example before/after benchmarking on a file.

Idea

Add classes RealTimeInferenceHook and BenchmarkHook to define listener interfaces. This can also be used to implement other behavior like progress bars, writing results, etc.

Example

class MyHook(BenchmarkHook):
    def on_finished(results):
        print("Finished!")

benchmark = Benchmark(..., hooks=[MyHook()])

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions