Skip to content

Commit

Permalink
potential fixes for matlab bridge?
Browse files Browse the repository at this point in the history
  • Loading branch information
jabooth committed Aug 2, 2015
1 parent dbc5dcf commit 7ac74af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions menpobench/method/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def images_to_mat(images, out_path, attach_ground_truth=False):
for im in images:
bbox = im.landmarks['bbox'].lms.bounds()
i_dict = {'pixels': as_fortran(im.rolled_channels()),
'bbox': as_fortran(np.array(bbox).ravel())}
'bbox': as_fortran(1 + np.array(bbox)[:, ::-1].ravel())}
if attach_ground_truth:
i_dict['gt'] = as_fortran(im.landmarks['gt'].lms.points)
i_dict['gt'] = as_fortran(1 + im.landmarks['gt'].lms.points[:, ::-1])
image_dicts.append(i_dict)

if not out_path.exists():
Expand Down
3 changes: 2 additions & 1 deletion menpobench/method/matlab/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def load_matlab_results(results_path):
from menpo.shape import PointCloud
from scipy.io import loadmat
results = loadmat(str(results_path / 'menpobench_test_results.mat'))
return [BenchResult(PointCloud(r[0])) for r in results['results']]
return [BenchResult(PointCloud((r[0] - 1)[:, ::-1]))
for r in results['results']]


class MatlabWrapper(object):
Expand Down
2 changes: 2 additions & 0 deletions menpobench/predefined/trainable_method/yzt_iccv_2013.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@

%% Fit
function result = fit(image_data, bbox, model_data)
% Convert the image to float greyscale
image_data = double(rgb2gray(image_data)) / 255;
cAAM = model_data;

%% initialization
Expand Down

0 comments on commit 7ac74af

Please sign in to comment.