I am generating Lime plots and saving them into .html format which are later converted into .png for further processing. Saving Lime plots directly into .png format are saving the blank png files. I finally need output of LIME plot in png format so either suggest a way a to do it directly so that images saved in png files are not blank or convert the HTML image generated into png format. Please suggest the solution which do not uses imgkit or wkhtmltoimage. I tried the code below:
exp = explainer.explain_instance(
X_test.values[value_index], model.predict_proba, top_labels=1
)
exp.show_in_notebook(show_table=True)
exp.save_to_file(
f"{output_path}//graphics/lime_plot_high_{j}.html",
labels=None,
predict_proba=True,
show_predicted_value=True,
)
hti.screenshot(
html_file=f"{output_path}//graphics/lime_plot_high_{j}.html",
save_as=f"lime_plot_high_{j}.png",
)
im = Image.open(f"{output_path}//graphics/lime_plot_high_{j}.png")
im = im.crop((0, 0, im.size[0] / 2, im.size[1] / 2.5))
im.save(f"{output_path}//graphics/lime_plot_high_{j}.png")