Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,7 @@ import tensorflow_hub as hub
|
|
11 |
|
12 |
|
13 |
IMAGE_DIM = 299 # required/default image dimensionality
|
|
|
14 |
|
15 |
def load_images(image_paths, image_size, verbose=True):
|
16 |
loaded_images = []
|
@@ -58,9 +59,9 @@ def classify_nd(model, nd_images, predict_args={}):
|
|
58 |
|
59 |
|
60 |
def nsfw(image):
|
61 |
-
|
62 |
-
|
63 |
-
return
|
64 |
|
65 |
|
66 |
demo = gr.Interface(fn=nsfw,
|
|
|
11 |
|
12 |
|
13 |
IMAGE_DIM = 299 # required/default image dimensionality
|
14 |
+
model = load_model("nsfw.299x299.h5")
|
15 |
|
16 |
def load_images(image_paths, image_size, verbose=True):
|
17 |
loaded_images = []
|
|
|
59 |
|
60 |
|
61 |
def nsfw(image):
|
62 |
+
|
63 |
+
image_preds = classify_nd(model, image)
|
64 |
+
return image_preds
|
65 |
|
66 |
|
67 |
demo = gr.Interface(fn=nsfw,
|