Skip to content

Instantly share code, notes, and snippets.

@arunm8489
Created June 5, 2020 05:44
Show Gist options
  • Save arunm8489/9241a1a5bff51b8faace978ebe3336da to your computer and use it in GitHub Desktop.
Save arunm8489/9241a1a5bff51b8faace978ebe3336da to your computer and use it in GitHub Desktop.
#Concatenate the batch_id of the image to the detection#this helps us identify which image does the detection correspond to
#We use a linear straucture to hold ALL the detections from the batch
#the batch_dim is flattened
#batch is identified by extra batch column
#creating a row with index of images
batch_ind = image_pred_class.new(image_pred_class.size(0), 1).fill_(ind)
seq = batch_ind, image_pred_class
if not write:
output = torch.cat(seq,1)
write = True
else:
out = torch.cat(seq,1)
output = torch.cat((output,out))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment