Skip to content

Commit

Permalink
Image size lime fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusdarias authored Jun 12, 2024
1 parent bc6a1d9 commit c9c65e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions resources/explainers/tabular/lime.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,9 @@ def predict(X):

hti = Html2Image()
hti.output_path= os.getcwd()
size=(10, 4)
css="body {background: white;}"
if "png_height" in params_json and "png_width" in params_json:
size=(int(params_json["png_width"])/100,int(params_json["png_height"])/100)
size=(int(params_json["png_width"]),int(params_json["png_height"]))
hti.screenshot(html_str=explanation.as_html(),css_str=css, save_as="temp.png", size=size)
else:
hti.screenshot(html_str=explanation.as_html(),css_str=css, save_as="temp.png",size=(1300,350))
Expand Down

0 comments on commit c9c65e3

Please sign in to comment.