Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,22 +10,20 @@ import transformers
|
|
| 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
|
| 19 |
-
model = transformers.AutoModel.from_pretrained("mwmathis/DeepLabCutModelZoo-SuperAnimal-Quadruped")
|
| 20 |
-
|
| 21 |
-
# Create an instance of 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)
|
| 29 |
|
| 30 |
|
| 31 |
|
|
|
|
| 10 |
from PIL import Image
|
| 11 |
import requests
|
| 12 |
|
| 13 |
+
from deeplabcut.utils import auxiliaryfunctions
|
| 14 |
+
from dlclibrary.dlcmodelzoo.modelzoo_download import (
|
| 15 |
+
download_huggingface_model,
|
| 16 |
+
MODELOPTIONS,
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
model = 'superanimal_topviewmouse'
|
| 20 |
+
download_huggingface_model(model, train_dir)
|
| 21 |
+
|
| 22 |
#demo data cooco cat:
|
| 23 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
| 24 |
image = Image.open(requests.get(url, stream=True).raw)
|
| 25 |
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
|