diff --git a/boxmot/utils/ops.py b/boxmot/utils/ops.py index d1d89f666..7a23a233b 100644 --- a/boxmot/utils/ops.py +++ b/boxmot/utils/ops.py @@ -190,7 +190,7 @@ def letterbox( # This preprocess differs from the current version of YOLOX preprocess, but ByteTrack uses it # https://github.com/ifzhang/ByteTrack/blob/d1bf0191adff59bc8fcfeaa0b33d3d1642552a99/yolox/data/data_augment.py#L189 -def bytetrack_preprocess(image, input_size, +def yolox_preprocess(image, input_size, mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225), swap=(2, 0, 1)): diff --git a/examples/det/yolox_boxmot.ipynb b/examples/det/yolox_boxmot.ipynb index 5c2f6431d..2d72f4d8a 100644 --- a/examples/det/yolox_boxmot.ipynb +++ b/examples/det/yolox_boxmot.ipynb @@ -27,7 +27,7 @@ "from yolox.utils import postprocess\n", "from yolox.utils.model_utils import fuse_model\n", "from boxmot import BotSort\n", - "from boxmot.utils.ops import bytetrack_preprocess\n", + "from boxmot.utils.ops import yolox_preprocess\n", "\n", "\n", "# Dictionary for YOLOX model weights URLs\n", @@ -77,7 +77,7 @@ " break\n", "\n", " # Preprocess frame\n", - " frame_img, ratio = bytetrack_preprocess(frame, input_size=input_size)\n", + " frame_img, ratio = yolox_preprocess(frame, input_size=input_size)\n", " frame_tensor = torch.Tensor(frame_img).unsqueeze(0).to(device)\n", "\n", " # Detection with YOLOX\n", @@ -128,7 +128,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.4" + "version": "3.11.5" } }, "nbformat": 4, diff --git a/tracking/detectors/yolox.py b/tracking/detectors/yolox.py index fac5a3a3f..f36c7bda4 100644 --- a/tracking/detectors/yolox.py +++ b/tracking/detectors/yolox.py @@ -10,7 +10,7 @@ from yolox.utils.model_utils import fuse_model from boxmot.utils import logger as LOGGER -from boxmot.utils.ops import bytetrack_preprocess +from boxmot.utils.ops import yolox_preprocess from tracking.detectors.yolo_interface import YoloInterface # default model weigths for these model names @@ -126,7 +126,7 @@ def preprocess(self, im) -> torch.Tensor: im_preprocessed = [] self._preproc_data = [] for i, img in enumerate(im): - img_pre, ratio = bytetrack_preprocess(img, input_size=self.imgsz) + img_pre, ratio = yolox_preprocess(img, input_size=self.imgsz) img_pre = torch.Tensor(img_pre).unsqueeze(0).to(self.device) im_preprocessed.append(img_pre)