Update app.py
Browse files
app.py
CHANGED
|
@@ -6,11 +6,11 @@ from tf_bodypix.api import download_model, load_model, BodyPixModelPaths
|
|
| 6 |
import numpy as np
|
| 7 |
from PIL import Image
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
def predict(image):
|
| 10 |
-
# load model
|
| 11 |
-
modelPath = download_model(BodyPixModelPaths.RESNET50_FLOAT_STRIDE_16)
|
| 12 |
-
bodypix_model = load_model(modelPath)
|
| 13 |
-
|
| 14 |
# get prediction result
|
| 15 |
image_array = tf.keras.preprocessing.image.img_to_array(image)
|
| 16 |
result = bodypix_model.predict_single(image_array)
|
|
|
|
| 6 |
import numpy as np
|
| 7 |
from PIL import Image
|
| 8 |
|
| 9 |
+
# load model
|
| 10 |
+
modelPath = download_model(BodyPixModelPaths.RESNET50_FLOAT_STRIDE_16)
|
| 11 |
+
bodypix_model = load_model(modelPath)
|
| 12 |
+
|
| 13 |
def predict(image):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# get prediction result
|
| 15 |
image_array = tf.keras.preprocessing.image.img_to_array(image)
|
| 16 |
result = bodypix_model.predict_single(image_array)
|