From dd62d6fa4a85f18a29de009a972f5599b19ec946 Mon Sep 17 00:00:00 2001 From: natanielruiz <nataniel777@hotmail.com> Date: 星期四, 14 九月 2017 00:51:53 +0800 Subject: [PATCH] Fixing hopenet --- code/test_on_video.py | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/test_on_video.py b/code/test_on_video.py index ca17ccd..d384b08 100644 --- a/code/test_on_video.py +++ b/code/test_on_video.py @@ -60,7 +60,8 @@ print 'Loading data.' transformations = transforms.Compose([transforms.Scale(224), - transforms.RandomCrop(224), transforms.ToTensor()]) + transforms.CenterCrop(224), transforms.ToTensor(), + transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])]) model.cuda(gpu) @@ -123,10 +124,10 @@ sys.exit(0) x_min, y_min, x_max, y_max = int(line[1]), int(line[2]), int(line[3]), int(line[4]) - x_min -= 100 - x_max += 100 - y_min -= 200 - y_max += 50 + x_min -= 150 + x_max += 150 + y_min -= 250 + y_max += 100 x_min = max(x_min, 0) y_min = max(y_min, 0) x_max = min(frame.shape[1], x_max) @@ -140,7 +141,7 @@ img_shape = img.size() img = img.view(1, img_shape[0], img_shape[1], img_shape[2]) img = Variable(img).cuda(gpu) - yaw, pitch, roll = model(img) + yaw, pitch, roll, angles = model(img) yaw_predicted = F.softmax(yaw) pitch_predicted = F.softmax(pitch) -- Gitblit v1.8.0