diff --git a/imgutils/generic/yolo.py b/imgutils/generic/yolo.py index 1c850fdd0c1..85ce667424c 100644 --- a/imgutils/generic/yolo.py +++ b/imgutils/generic/yolo.py @@ -465,13 +465,13 @@ def _safe_eval_names_str(names_str): result = {} # noinspection PyUnresolvedReferences for key, value in zip(node.body.keys, node.body.values): - if isinstance(key, (ast.Str, ast.Num)): + if isinstance(key, (ast.Constant)) and isinstance(key.value, int): key = ast.literal_eval(key) else: raise RuntimeError(f"Invalid key type: {key!r}, this should be a bug, " f"please open an issue to dghs-imgutils.") # pragma: no cover - if isinstance(value, (ast.Str, ast.Num)): + if isinstance(value, (ast.Constant)) and isinstance(value.value, str): value = ast.literal_eval(value) else: raise RuntimeError(f"Invalid value type: {value!r}, this should be a bug, " diff --git a/requirements.txt b/requirements.txt index 0019abdab43..5b02596308f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ hbutils>=0.9.0 pillow -numpy<2 +numpy<3 scikit-learn huggingface_hub tqdm