Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
keeleliin
word_cloud_est
Commits
e568109a
Commit
e568109a
authored
Apr 29, 2015
by
Andreas Mueller
Browse files
fix boolean mask
parent
3308a89f
Changes
1
Hide whitespace changes
Inline
Side-by-side
wordcloud/wordcloud.py
View file @
e568109a
...
...
@@ -186,8 +186,8 @@ class WordCloud(object):
if
mask
.
ndim
==
2
:
boolean_mask
=
mask
==
255
elif
mask
.
ndim
==
3
:
#
"OR" the color channels
boolean_mask
=
np
.
sum
(
mask
[:,
:,
:
3
]
==
255
,
axis
=-
1
)
#
if all channels are white, mask out
boolean_mask
=
np
.
all
(
mask
[:,
:,
:
3
]
==
255
,
axis
=-
1
)
else
:
raise
ValueError
(
"Got mask of invalid shape: %s"
%
str
(
mask
.
shape
))
# the order of the cumsum's is important for speed ?!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment