Instructions to use facebook/detr-resnet-101 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/detr-resnet-101 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("object-detection", model="facebook/detr-resnet-101")# Load model directly from transformers import AutoImageProcessor, AutoModelForObjectDetection processor = AutoImageProcessor.from_pretrained("facebook/detr-resnet-101") model = AutoModelForObjectDetection.from_pretrained("facebook/detr-resnet-101") - Inference
- Notebooks
- Google Colab
- Kaggle
The key is connected fine, but the token is invalid? Is it related to billing?
#4
by BrightCLASS - opened
The key is connected fine, but the token is invalid?
{'error': 'Authorization header is correct, but the token seems invalid'}
Is it related to billing?
-------------- CODE ------------------
import requests
API_URL = "https://api-inference.huggingface.co/models/facebook/detr-resnet-101"
headers = {"Authorization": "Bearer YOUR_API_KEY_HERE"}
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")
print(output)