Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change yolox preprocessing name #1747

Merged
merged 1 commit into from
Nov 20, 2024
Merged
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 boxmot/utils/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down
6 changes: 3 additions & 3 deletions examples/det/yolox_boxmot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -128,7 +128,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions tracking/detectors/yolox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading