generated from dopt-python/py311
add docstring
This commit is contained in:
parent
d87e8d4d9c
commit
bdf6456111
@ -35,7 +35,27 @@ def get_model_folder() -> Path:
|
|||||||
return model_folder
|
return model_folder
|
||||||
|
|
||||||
|
|
||||||
def get_detection_models(model_folder: Path) -> t.DetectionModels:
|
def get_detection_models(
|
||||||
|
model_folder: Path,
|
||||||
|
) -> t.DetectionModels:
|
||||||
|
"""retrieve the model paths both for the left and the right side as a TypedDict
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
model_folder : Path
|
||||||
|
the found path to the folder containing the models
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
t.DetectionModels
|
||||||
|
TypedDict with key "left" and "right" with the corresponding paths to each model
|
||||||
|
|
||||||
|
Raises
|
||||||
|
------
|
||||||
|
ValueError
|
||||||
|
raised if there are no or too many model files are found for one side
|
||||||
|
"""
|
||||||
|
|
||||||
left_model_search = tuple(model_folder.glob("*left_hand_side*.pth"))
|
left_model_search = tuple(model_folder.glob("*left_hand_side*.pth"))
|
||||||
if len(left_model_search) == 0:
|
if len(left_model_search) == 0:
|
||||||
raise ValueError("No model for the left hand side found.")
|
raise ValueError("No model for the left hand side found.")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user