Use Any type-hints for args and kwargs (#18372)

Signed-off-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-12-24 20:32:59 +01:00 committed by GitHub
parent 51026a9a4a
commit 05323919b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 25 deletions

View file

@ -2,6 +2,7 @@
import io
import time
from typing import Any
import cv2
@ -37,16 +38,16 @@ class Inference:
inference: Performs real-time object detection inference.
Examples:
>>> inf = solutions.Inference(model="path/to/model/file.pt") # Model is not necessary argument.
>>> inf = solutions.Inference(model="path/to/model.pt") # Model is not necessary argument.
>>> inf.inference()
"""
def __init__(self, **kwargs):
def __init__(self, **kwargs: Any):
"""
Initializes the Inference class, checking Streamlit requirements and setting up the model path.
Args:
**kwargs (Dict): Additional keyword arguments for model configuration.
**kwargs (Any): Additional keyword arguments for model configuration.
"""
check_requirements("streamlit>=1.29.0") # scope imports for faster ultralytics package load speeds
import streamlit as st