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

load model by torch.hub.load() and export polys pixel #529

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

quangdungluong
Copy link

Load model by torch.hub.load() can be used to export polys bounding box.
Example:

model = torch.hub.load()
img = "path/to/image"
pred = model(img)
print(pred.polys)

@Wu-Jian-Ting
Copy link

Hi, I use this and use Realsense D435i, but it had something error

  File "main.py", line 89, in <module>
    results = model(color_image)
  File "/home/iris/anaconda3/envs/yolov5_obb/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/iris/anaconda3/envs/yolov5_obb/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
    return func(*args, **kwargs)
  File "/home/iris/yolov5_obb/models/common.py", line 531, in forward
    return Detections(imgs, pred, files, t, self.names, x.shape)
  File "/home/iris/yolov5_obb/models/common.py", line 548, in __init__
    self.xyxy = [poly2hbb(p[:, :8]) for p in pred]
  File "/home/iris/yolov5_obb/models/common.py", line 548, in <listcomp>
    self.xyxy = [poly2hbb(p[:, :8]) for p in pred]
  File "/home/iris/yolov5_obb/utils/rboxs_utils.py", line 156, in poly2hbb
    assert polys.shape[-1] == 8
AssertionError

I print this y = non_max_suppression_obb(y, self.conf, self.iou, self.classes, self.agnostic, self.multi_label, max_det=self.max_det) and I got y: [tensor([], device='cuda:0', size=(0, 7))]

Do somebody konw how to fix it? tks

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