You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some code written prior to the release of the ultralytics package; this code assumes that the YOLOv5 repo is on the PYTHONPATH, and imports a few functions from the utils module. I'd like to migrate that code to depend on the ultralytics package. Most of the functions are the same and have just been moved around a little (non_max_suppression, scale_coords, xyxy2xywh), but the letterbox() function has become a LetterBox class, and I can't quite manage to wrap it in a way that's compatible with the way I was using the letterbox() function.
I was calling the YOLOv5 letterbox() function like this:
...and I'm trying to wrap up the new LetterBox class with something like this:
def letterbox(img,new_shape,stride,auto=True):
L = LetterBox(new_shape,stride=stride,auto=auto)
letterbox_result = L(image=img)
return [letterbox_result]
When I do this, I get "[some random integer] is not a valid class", suggesting that the dimensionality of the output is not the same. I confess that I've done zero investigation to compare the code, but before I do, I'm wondering whether anyone else in the community has already ported similar code and possibly already solved this problem.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have some code written prior to the release of the ultralytics package; this code assumes that the YOLOv5 repo is on the PYTHONPATH, and imports a few functions from the utils module. I'd like to migrate that code to depend on the ultralytics package. Most of the functions are the same and have just been moved around a little (non_max_suppression, scale_coords, xyxy2xywh), but the letterbox() function has become a LetterBox class, and I can't quite manage to wrap it in a way that's compatible with the way I was using the letterbox() function.
I was calling the YOLOv5 letterbox() function like this:
...and I'm trying to wrap up the new LetterBox class with something like this:
When I do this, I get "[some random integer] is not a valid class", suggesting that the dimensionality of the output is not the same. I confess that I've done zero investigation to compare the code, but before I do, I'm wondering whether anyone else in the community has already ported similar code and possibly already solved this problem.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions