Skip to content

Commit 0ed072c

Browse files
Merge pull request #1747 from mikel-brostrom/cleanup2
change yolox preprocessing name
2 parents e9ba565 + aa62df2 commit 0ed072c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

boxmot/utils/ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def letterbox(
190190

191191
# This preprocess differs from the current version of YOLOX preprocess, but ByteTrack uses it
192192
# https://github.com/ifzhang/ByteTrack/blob/d1bf0191adff59bc8fcfeaa0b33d3d1642552a99/yolox/data/data_augment.py#L189
193-
def bytetrack_preprocess(image, input_size,
193+
def yolox_preprocess(image, input_size,
194194
mean=(0.485, 0.456, 0.406),
195195
std=(0.229, 0.224, 0.225),
196196
swap=(2, 0, 1)):

examples/det/yolox_boxmot.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"from yolox.utils import postprocess\n",
2828
"from yolox.utils.model_utils import fuse_model\n",
2929
"from boxmot import BotSort\n",
30-
"from boxmot.utils.ops import bytetrack_preprocess\n",
30+
"from boxmot.utils.ops import yolox_preprocess\n",
3131
"\n",
3232
"\n",
3333
"# Dictionary for YOLOX model weights URLs\n",
@@ -77,7 +77,7 @@
7777
" break\n",
7878
"\n",
7979
" # Preprocess frame\n",
80-
" frame_img, ratio = bytetrack_preprocess(frame, input_size=input_size)\n",
80+
" frame_img, ratio = yolox_preprocess(frame, input_size=input_size)\n",
8181
" frame_tensor = torch.Tensor(frame_img).unsqueeze(0).to(device)\n",
8282
"\n",
8383
" # Detection with YOLOX\n",
@@ -128,7 +128,7 @@
128128
"name": "python",
129129
"nbconvert_exporter": "python",
130130
"pygments_lexer": "ipython3",
131-
"version": "3.12.4"
131+
"version": "3.11.5"
132132
}
133133
},
134134
"nbformat": 4,

tracking/detectors/yolox.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from yolox.utils.model_utils import fuse_model
1111

1212
from boxmot.utils import logger as LOGGER
13-
from boxmot.utils.ops import bytetrack_preprocess
13+
from boxmot.utils.ops import yolox_preprocess
1414
from tracking.detectors.yolo_interface import YoloInterface
1515

1616
# default model weigths for these model names
@@ -126,7 +126,7 @@ def preprocess(self, im) -> torch.Tensor:
126126
im_preprocessed = []
127127
self._preproc_data = []
128128
for i, img in enumerate(im):
129-
img_pre, ratio = bytetrack_preprocess(img, input_size=self.imgsz)
129+
img_pre, ratio = yolox_preprocess(img, input_size=self.imgsz)
130130
img_pre = torch.Tensor(img_pre).unsqueeze(0).to(self.device)
131131

132132
im_preprocessed.append(img_pre)

0 commit comments

Comments
 (0)