-
Notifications
You must be signed in to change notification settings - Fork 152
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
Support autoenvolved anchors as ultralytics #119
Comments
I just fixed this issue today, I will make a PR for this in the next days! |
Thanks @Tomakko , we are eager for your contribution! |
FYI, Now we can attach the model = torch.hub.load('ultralytics/yolov5', 'custom', path=ultralytics_weights_path)
anchor_grids = model.model.model[-1].anchor_grid.view(3, -1).cpu().numpy().tolist() And then pass it into yolort: from yolort.models.yolo import yolov5_darknet_pan_s_r40 as yolov5s
model = yolov5s(anchor_grids=anchor_grids, num_classes=10) |
Make sure to disable autoshape in |
When converting the yolov5 custom model to yolort, the configuration of Anchors is fixed. This will cause a large gap between the two prediction results.
This is my test results for reference.
Detection results with ultralytics
Detection results with yolort
boxes:
scores:
labels:
I also converted the official model, and there is no difference between the two models. So I hope someone can provide the method to change the default configuration of Anchors.
The text was updated successfully, but these errors were encountered: