Skip to content
Draft
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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ luxonis-ml[data,nn_archive,utils]~=0.8.0
onnx==1.17.0
numpy>=1.19.5,<2.1.0
onnxruntime>=1.20.1
onnxsim>=0.4.36
onnxsim>=0.4.36,<0.6
s3fs
tqdm
s3transfer
Expand Down
2 changes: 1 addition & 1 deletion tools/yolo/ultralytics
Submodule ultralytics updated 252 files
2 changes: 1 addition & 1 deletion tools/yolo/yolov5
Submodule yolov5 updated 153 files
5 changes: 5 additions & 0 deletions tools/yolo/yolov5_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
from tools.utils.constants import Encoding

current_dir = os.path.dirname(os.path.abspath(__file__))
# Add ultralytics submodule to sys.path so that yolov5's internal
# `import ultralytics` resolves to the local submodule
ultralytics_path = os.path.join(current_dir, "ultralytics")
if ultralytics_path not in sys.path:
sys.path.insert(0, ultralytics_path)
yolov5_path = os.path.join(current_dir, "yolov5")
# Ensure it's first in sys.path
if yolov5_path not in sys.path:
Expand All @@ -32,7 +37,7 @@

model = models.experimental.Ensemble()
for w in weights if isinstance(weights, list) else [weights]:
ckpt = torch.load(

Check failure on line 40 in tools/yolo/yolov5_exporter.py

View workflow job for this annotation

GitHub Actions / semgrep/ci

Semgrep Issue

Functions reliant on pickle can result in arbitrary code execution. Consider loading from `state_dict`, using fickling, or switching to a safer serialization method like ONNX
models.experimental.attempt_download(w),
map_location="cpu",
weights_only=False,
Expand Down
Loading