tf-reed: Demo test image for model

PHOTO EMBED

Thu Jan 27 2022 13:13:37 GMT+0000 (Coordinated Universal Time)

Saved by @somuSan #python #pytorch

images, boxes = torch.rand(2, 3, 400, 400).to(device), torch.rand(2, 11, 4).to(device)
boxes[:, :, 2:4] = boxes[:, :, 0:2] + boxes[:, :, 2:4]
labels = torch.randint(0, 2, (4, 11)).to(device)
images = list(image for image in images)
targets = []
for i in range(len(images)):
    d = {}
    d['boxes'] = boxes[i]
    d['labels'] = labels[i]
    targets.append(d)

model = model.to(device)
output = model(images, targets)
content_copyCOPY

https://www.kaggle.com/mrinath/hacking-fasterrcnn/notebook