typefile
{
"image": "https://replicate.delivery/pbxt/MgRH6lhJhjdL7Ac1u1Iu63sFxW8gW8GAaX2MTmlr63nqXBDd/00240005.jpg",
"return_probabilities": false,
"use_rotation_averaging": false
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_ase**********************************
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/MgRH6lhJhjdL7Ac1u1Iu63sFxW8gW8GAaX2MTmlr63nqXBDd/00240005.jpg",
return_probabilities: false,
use_rotation_averaging: false
}
}
);
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_ase**********************************
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/MgRH6lhJhjdL7Ac1u1Iu63sFxW8gW8GAaX2MTmlr63nqXBDd/00240005.jpg",
"return_probabilities": False,
"use_rotation_averaging": False
}
)
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_ase**********************************
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/MgRH6lhJhjdL7Ac1u1Iu63sFxW8gW8GAaX2MTmlr63nqXBDd/00240005.jpg",
"return_probabilities": false,
"use_rotation_averaging": false
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "kbk2nggja9rm80cnnenrh3rapg",
"model": "grace-raper/resnet-rot",
"version": "349fc7e1ff0f308ca33aecab35219b2f25ef0053565bcbe9a9cfeeed01a865bc",
"input": {
"image": "https://replicate.delivery/pbxt/MgRH6lhJhjdL7Ac1u1Iu63sFxW8gW8GAaX2MTmlr63nqXBDd/00240005.jpg",
"return_probabilities": false,
"use_rotation_averaging": false
},
"logs": "Processing image: /tmp/tmpgrnhyev800240005.jpg",
"output": {
"best_angle": 90
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-03-18T23:51:10.162Z",
"started_at": "2025-03-18T23:51:26.417816Z",
"completed_at": "2025-03-18T23:51:29.458837Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/kbk2nggja9rm80cnnenrh3rapg/cancel",
"get": "https://api.replicate.com/v1/predictions/kbk2nggja9rm80cnnenrh3rapg",
"web": "https://replicate.com/p/kbk2nggja9rm80cnnenrh3rapg"
},
"metrics": {
"predict_time": 3.041021422,
"total_time": 19.296837
}
}