Skip to content

Options to override loggers and progress bar for run_inference #324

@tom21100227

Description

@tom21100227

Currently sleap_nn.predict:run_inference uses logger from loguru and have a built in tdqm style progress bar. It would be nice if the function accepts an external logger and/or a progress call back function. When parallelizing inference jobs having an override-able logger would make a lot of things easier for observability. The progress bar might clogs up STDOUT with how some logs handle carriage-return updates.

I am imagining something similar to this:

def run_inference(
    ...,
    logger: logger = None, # option to override the built in logger
    progress_bar: bool = True # whether to enable the progress bar or not. 
    progress_callback: func = None # a progress function that can be used to replace the progress bar in the shape of func(progress: int). 
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions