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

Fix YOLOX #1739

Merged
merged 9 commits into from
Nov 15, 2024
Merged

Fix YOLOX #1739

merged 9 commits into from
Nov 15, 2024

Conversation

Fleyderer
Copy link
Contributor

This PR fixes known problems with YOLOX.

  1. YOLOX can be used for tracking and evaluation
  2. Metrics are almost the same as in original repo. ByteTrack yolox_m model (MOTA, IDF1) is (87.0, 80.1), reproduced results are (87.1, 79.9).
    Command for reproduce:
python tracking/val.py --benchmark MOT17 --yolo-model yolox_m.pth --tracking-method bytetrack --reid-model osnet_x0_25_msmt17.pt --source tracking/val_utils/data/MOT17/train
  1. Also provided new example for tracking
  2. Added imgsz assignment for Ultralytics/YOLOX if parameter is not passed
  3. Added is_ultralytics_model function to make it simple and without creating ul_models duplicates, which could lead to errors in future.

This PR can solve the following Issues:
#1600
#1663
#1422

@Fleyderer Fleyderer changed the title Fix yolox Fix YOLOX Nov 15, 2024
@Fleyderer
Copy link
Contributor Author

Fleyderer commented Nov 15, 2024

Strange thing, if I run this code, everything is just working without fails

UPD: Somehow syntax error has been ignored, no problem...

@Fleyderer
Copy link
Contributor Author

@mikel-brostrom I think now we need to add YOLOX module to requirements 😶

@mikel-brostrom
Copy link
Owner

mikel-brostrom commented Nov 15, 2024

You have to call this:

def get_yolo_inferer(yolo_model):

For the correct pkg installation

@Fleyderer
Copy link
Contributor Author

Ok, I'll try to find workaround. IMO it is better to add required packages to requirements instead of installing it on the fly after installing everything else, but no problem 🙂

@mikel-brostrom
Copy link
Owner

Ok, I'll try to find workaround. IMO it is better to add required packages to requirements instead of installing it on the fly after installing everything else, but no problem 🙂

I agree, but the right strategy has to be imported anyways. So the pkg install I can fix after this merge 🚀

@mikel-brostrom
Copy link
Owner

mikel-brostrom commented Nov 15, 2024

You can use this for reference:

boxmot/tracking/track.py

Lines 90 to 98 in 755cb4d

if not any(yolo in str(args.yolo_model) for yolo in ul_models):
# replace yolov8 model
m = get_yolo_inferer(args.yolo_model)
model = m(
model=args.yolo_model,
device=yolo.predictor.device,
args=yolo.predictor.args
)
yolo.predictor.model = model

This is how it worked previously with get_yolo_inferer

@Fleyderer
Copy link
Contributor Author

Yeah, it was not hard to change, but harder to find a way how to change it better to avoid problems in future.

Since is_yolox_model is now used in package installing and model selection, it will be fine 🙂

@Fleyderer
Copy link
Contributor Author

This PR should also close #1740
I have decided that this issue didn't deserve independent PR

@mikel-brostrom mikel-brostrom merged commit 7ebb7a3 into mikel-brostrom:master Nov 15, 2024
12 checks passed
@mikel-brostrom
Copy link
Owner

Looks good! 😄

@Fleyderer Fleyderer deleted the fix-yolox branch November 15, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants