Skip to content

Commit

Permalink
Merge pull request #554 from nontas/images_widget_hotfix
Browse files Browse the repository at this point in the history
Bugfix:visualize_images
  • Loading branch information
nontas committed Feb 12, 2015
2 parents 7286b69 + 143f459 commit 8ddf0c2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion menpo/landmark/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def has_landmarks(self):
:type: `bool`
"""
return self._landmarks is not None
return self._landmarks is not None and self.landmarks.n_groups != 0

@landmarks.setter
def landmarks(self, value):
Expand Down
4 changes: 2 additions & 2 deletions menpo/visualize/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ def plot_function(name, value):
im = image_number_wid.selected_values['index']

# update info text widget
image_has_landmarks = images[im].landmarks.n_groups != 0
image_has_landmarks = images[im].has_landmarks
image_is_masked = isinstance(images[im], MaskedImage)
update_info(images[im], image_is_masked, image_has_landmarks,
landmark_options_wid.selected_values['group'])
Expand All @@ -1148,7 +1148,7 @@ def plot_function(name, value):
renderer = _visualize(
images[im], save_figure_wid.renderer[0],
landmark_options_wid.selected_values['render_landmarks'],
channel_options_wid.selected_values['image_is_masked'],
image_is_masked,
channel_options_wid.selected_values['masked_enabled'],
channel_options_wid.selected_values['channels'],
channel_options_wid.selected_values['glyph_enabled'],
Expand Down
3 changes: 1 addition & 2 deletions menpo/visualize/widgets/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,7 @@ def update_landmark_options(landmark_options_wid, group_keys, labels_keys,
If None, then nothing is assigned.
"""
import IPython.html.widgets as ipywidgets
# check if the new group_keys and labels_keys are the same as the old
# ones
# check if the new group_keys and labels_keys are the same as the old ones
if not _compare_groups_and_labels(
group_keys, labels_keys,
landmark_options_wid.selected_values['group_keys'],
Expand Down

0 comments on commit 8ddf0c2

Please sign in to comment.