Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,12 @@ import deeplabcut
|
|
| 7 |
import dlclibrary
|
| 8 |
import transformers
|
| 9 |
|
|
|
|
|
|
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
# Load the model
|
|
@@ -17,7 +22,7 @@ model = transformers.AutoModel.from_pretrained("mwmathis/DeepLabCutModelZoo-Supe
|
|
| 17 |
inference_api = transformers.InferenceAPI(model)
|
| 18 |
|
| 19 |
# Make a prediction with the model
|
| 20 |
-
prediction = inference_api.predict(inputs=
|
| 21 |
|
| 22 |
# Print the prediction
|
| 23 |
print(prediction)
|
|
|
|
| 7 |
import dlclibrary
|
| 8 |
import transformers
|
| 9 |
|
| 10 |
+
from PIL import Image
|
| 11 |
+
import requests
|
| 12 |
|
| 13 |
+
#demo data cooco cat:
|
| 14 |
+
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
| 15 |
+
image = Image.open(requests.get(url, stream=True).raw)
|
| 16 |
|
| 17 |
|
| 18 |
# Load the model
|
|
|
|
| 22 |
inference_api = transformers.InferenceAPI(model)
|
| 23 |
|
| 24 |
# Make a prediction with the model
|
| 25 |
+
prediction = inference_api.predict(inputs=image)
|
| 26 |
|
| 27 |
# Print the prediction
|
| 28 |
print(prediction)
|