|
import os |
|
import yaml |
|
import numpy as np |
|
from matplotlib import cm |
|
import gradio as gr |
|
import deeplabcut |
|
import dlclibrary |
|
import transformers |
|
|
|
from PIL import Image |
|
import requests |
|
|
|
|
|
url = "http://images.cocodataset.org/val2017/000000039769.jpg" |
|
image = Image.open(requests.get(url, stream=True).raw) |
|
|
|
|
|
|
|
model = transformers.AutoModel.from_pretrained("mwmathis/DeepLabCutModelZoo-SuperAnimal-Quadruped") |
|
|
|
|
|
inference_api = transformers.InferenceAPI(model) |
|
|
|
|
|
prediction = inference_api.predict(inputs=image) |
|
|
|
|
|
print(prediction) |
|
|
|
|
|
|
|
|
|
|