yuragoithf's picture
Update app.py
7d1537c
raw
history blame
389 Bytes
import requests
API_URL = "https://api-inference.huggingface.co/models/facebook/detr-resnet-50-panoptic"
headers = {"Authorization": "Bearer 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"}
def query(filename):
with open(filename, "rb") as f:
data = f.read()
response = requests.post(API_URL, headers=headers, data=data)
return response.json()
output = query("cats.jpg")