未验证 提交 050eb06a 编写于 作者: J JiaQi Xu 提交者: GitHub

Update ssd.py

上级 20bd5095
......@@ -79,8 +79,8 @@ class SSD(object):
crop_img = np.array(letterbox_image(image, (self.model_image_size[0],self.model_image_size[1])))
photo = np.array(crop_img,dtype = np.float64)
# 图片预处理,归一化
photo = Variable(torch.from_numpy(np.expand_dims(np.transpose(crop_img-MEANS,(2,0,1)),0)).type(torch.FloatTensor))
with torch.no_grad():
photo = Variable(torch.from_numpy(np.expand_dims(np.transpose(crop_img-MEANS,(2,0,1)),0)).type(torch.FloatTensor))
if self.cuda:
photo = photo.cuda()
preds = self.net(photo)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册