Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import tensorflow as tf
|
2 |
-
from tensorflow.keras.applications.resnet_v2 import ResNet50V2
|
3 |
from tensorflow.keras.preprocessing import image
|
4 |
-
from tensorflow.keras.applications.
|
|
|
5 |
import matplotlib.pyplot as plt
|
6 |
from alibi.explainers import IntegratedGradients
|
7 |
from alibi.datasets import load_cats
|
@@ -26,7 +26,7 @@ url = "https://upload.wikimedia.org/wikipedia/commons/4/43/Cute_dog.jpg"
|
|
26 |
path_input = "./dog.jpg"
|
27 |
urllib.request.urlretrieve(url, filename=path_input)
|
28 |
|
29 |
-
model =
|
30 |
|
31 |
n_steps = 50
|
32 |
method = "gausslegendre"
|
|
|
1 |
import tensorflow as tf
|
|
|
2 |
from tensorflow.keras.preprocessing import image
|
3 |
+
from tensorflow.keras.applications.mobilenet_v2 import MobileNetV2 as keras_model
|
4 |
+
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input, decode_predictions
|
5 |
import matplotlib.pyplot as plt
|
6 |
from alibi.explainers import IntegratedGradients
|
7 |
from alibi.datasets import load_cats
|
|
|
26 |
path_input = "./dog.jpg"
|
27 |
urllib.request.urlretrieve(url, filename=path_input)
|
28 |
|
29 |
+
model = keras_model(weights='imagenet')
|
30 |
|
31 |
n_steps = 50
|
32 |
method = "gausslegendre"
|