Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correction in data_labels function #752

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lime/lime_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import sklearn
from sklearn.utils import check_random_state
from skimage.color import gray2rgb
from skimage.color import gray2rgb, rgb2gray
from tqdm.auto import tqdm


Expand Down Expand Up @@ -261,7 +261,7 @@ def data_labels(self,
for z in zeros:
mask[segments == z] = True
temp[mask] = fudged_image[mask]
imgs.append(temp)
imgs.append(rgb2gray(temp).reshape(temp.shape[0], temp.shape[1], 1))
if len(imgs) == batch_size:
preds = classifier_fn(np.array(imgs))
labels.extend(preds)
Expand Down