ResNet
Serverless Hosted API を通じて ResNet image classification を使用します
最終更新
役に立ちましたか?
役に立ちましたか?
export ROBOFLOW_API_KEY="your-key-here"pip install inference-sdkimport os
import cv2
import numpy as np
import requests
from inference_sdk import InferenceHTTPClient
content = requests.get("https://media.roboflow.com/notebooks/examples/dog.jpeg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
results = client.infer(image, model_id="resnet50")
print(results)