Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions imgutils/generic/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
hbutils>=0.9.0
pillow
numpy<2
numpy<3
scikit-learn
huggingface_hub
tqdm
Expand Down