Predicted Image id and box from SSD

醉酒当歌 提交于 2020-03-05 01:40:47

问题


How to find predicted image id and Box from SSD, I am using this GitHub link here is the test function which I want to save the image id and box

def test(loader, net, criterion, device):
net.eval()
running_loss = 0.0
running_regression_loss = 0.0
running_classification_loss = 0.0
num = 0
for _, data in enumerate(loader):
images, boxes, labels = data
images = images.to(device)
boxes = boxes.to(device)
labels = labels.to(device)
num += 1

    with torch.no_grad():
        confidence, locations = net(images)
        regression_loss, classification_loss = criterion(confidence, locations, labels, boxes)
        loss = regression_loss + classification_loss

    running_loss += loss.item()
    running_regression_loss += regression_loss.item()
    running_classification_loss += classification_loss.item()
return running_loss / num, running_regression_loss / num, run

来源:https://stackoverflow.com/questions/60398211/predicted-image-id-and-box-from-ssd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!