Skip to content

What is the benifit of using --quad option? #4029

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

You must be logged in to vote

@imyhxy it's an experiment that allows for occasional usage of 2x larger images without requiring the extra GPU memory. It goes with collate_fcn4():

yolov5/utils/datasets.py

Lines 594 to 619 in b7e985e

@staticmethod
def collate_fn4(batch):
img, label, path, shapes = zip(*batch) # transposed
n = len(shapes) // 4
img4, label4, path4, shapes4 = [], [], path[:n], shapes[:n]
ho = torch.tensor([[0., 0, 0, 1, 0, 0]])
wo = torch.tensor([[0., 0, 1, 0, 0, 0]])
s = torch.tensor([[1, 1, .5, .5, .5, .5]]) # scale
for i in range(n): # zidane torch.zeros(16,3,720,1280) # BCHW
i *= 4
if random.random() < 0.5:
im = F.interpolate(img[i].

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by imyhxy
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