Skip to content

Commit

Permalink
testing lime.py
Browse files Browse the repository at this point in the history
  • Loading branch information
martcaro authored Jun 5, 2024
1 parent 60bab2d commit efed229
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion resources/explainers/tabular/lime.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,17 @@ def predict(X):
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)
hti.screenshot(html_str=explanation.as_html(),css_str=css, save_as="temp.png", size=size)
print("1")
print(explanation.as_html())
hti.screenshot(html_str=explanation.as_html(),css_str=css, save_as="temp.png", size=size)
print("2")
print(explanation.as_html())
else:
print("3")
print(explanation.as_html())
hti.screenshot(html_str=explanation.as_html(),css_str=css, save_as="temp.png",size=(1300,350))
print("4")
print(explanation.as_html())

im=Image.open("/tmp/temp.png")
b64Image=PIL_to_base64(im)
Expand Down

0 comments on commit efed229

Please sign in to comment.