typefile
{
"image": "https://replicate.delivery/pbxt/MgROhjU1jIAHUyNtT3H3ldvVLluXIKRMQvzRdmvLm74mc2em/example_1.jpg",
"return_probabilities": true,
"use_rotation_averaging": true
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_dzT**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run grace-raper/resnet-rot using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"grace-raper/resnet-rot:349fc7e1ff0f308ca33aecab35219b2f25ef0053565bcbe9a9cfeeed01a865bc",
{
input: {
image: "https://replicate.delivery/pbxt/MgROhjU1jIAHUyNtT3H3ldvVLluXIKRMQvzRdmvLm74mc2em/example_1.jpg",
return_probabilities: true,
use_rotation_averaging: true
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_dzT**********************************
This is your API token. Keep it to yourself.
import replicate
Run grace-raper/resnet-rot using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"grace-raper/resnet-rot:349fc7e1ff0f308ca33aecab35219b2f25ef0053565bcbe9a9cfeeed01a865bc",
input={
"image": "https://replicate.delivery/pbxt/MgROhjU1jIAHUyNtT3H3ldvVLluXIKRMQvzRdmvLm74mc2em/example_1.jpg",
"return_probabilities": True,
"use_rotation_averaging": True
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_dzT**********************************
This is your API token. Keep it to yourself.
Run grace-raper/resnet-rot using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "grace-raper/resnet-rot:349fc7e1ff0f308ca33aecab35219b2f25ef0053565bcbe9a9cfeeed01a865bc",
"input": {
"image": "https://replicate.delivery/pbxt/MgROhjU1jIAHUyNtT3H3ldvVLluXIKRMQvzRdmvLm74mc2em/example_1.jpg",
"return_probabilities": true,
"use_rotation_averaging": true
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "npdsq5v6d9rme0cnnesbc91h0r",
"model": "grace-raper/resnet-rot",
"version": "349fc7e1ff0f308ca33aecab35219b2f25ef0053565bcbe9a9cfeeed01a865bc",
"input": {
"image": "https://replicate.delivery/pbxt/MgROhjU1jIAHUyNtT3H3ldvVLluXIKRMQvzRdmvLm74mc2em/example_1.jpg",
"return_probabilities": true,
"use_rotation_averaging": true
},
"logs": "Processing image: /tmp/tmp54qof03aexample_1.jpg",
"output": {
"best_angle": 90,
"probabilities": {
"0": 0.0006535034663102124,
"90": 0.998546227812767,
"180": 0.00024418315797447576,
"270": 0.0005560978393504001
}
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-03-18T23:59:10.442Z",
"started_at": "2025-03-18T23:59:10.449443Z",
"completed_at": "2025-03-18T23:59:20.082526Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/npdsq5v6d9rme0cnnesbc91h0r/cancel",
"get": "https://api.replicate.com/v1/predictions/npdsq5v6d9rme0cnnesbc91h0r",
"web": "https://replicate.com/p/npdsq5v6d9rme0cnnesbc91h0r"
},
"metrics": {
"predict_time": 9.63308324,
"total_time": 9.640526
}
}