Skip to content

Agnostic NMS when loading from PyTorch Hub #2370

Answered by glenn-jocher
c-axel asked this question in Q&A
Discussion options

You must be logged in to vote

@c-axel this is not available currently, but if you'd like to submit a PR you can introduce this in the autoShape() class:

yolov5/models/common.py

Lines 168 to 229 in e931b9d

class autoShape(nn.Module):
# input-robust model wrapper for passing cv2/np/PIL/torch inputs. Includes preprocessing, inference and NMS
img_size = 640 # inference size (pixels)
conf = 0.25 # NMS confidence threshold
iou = 0.45 # NMS IoU threshold
classes = None # (optional list) filter by class
def __init__(self, model):
super(autoShape, self).__init__()
self.model = model.eval()
def autoshape(self):
print('autoShape already enabled, skipping... ')

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@c-axel
Comment options

@glenn-jocher
Comment options

Answer selected by c-axel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants