typefile
{
"image": "https://replicate.delivery/pbxt/MgRPDBRCPGD8ydgoJf280WSnwN72LI9GluihOB7aJ0X5woHN/example_3.tif",
"return_probabilities": true,
"use_rotation_averaging": true
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Mg7**********************************
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/MgRPDBRCPGD8ydgoJf280WSnwN72LI9GluihOB7aJ0X5woHN/example_3.tif",
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_Mg7**********************************
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/MgRPDBRCPGD8ydgoJf280WSnwN72LI9GluihOB7aJ0X5woHN/example_3.tif",
"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_Mg7**********************************
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/MgRPDBRCPGD8ydgoJf280WSnwN72LI9GluihOB7aJ0X5woHN/example_3.tif",
"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": "r31vsw794drma0cnnesa3aygvg",
"model": "grace-raper/resnet-rot",
"version": "349fc7e1ff0f308ca33aecab35219b2f25ef0053565bcbe9a9cfeeed01a865bc",
"input": {
"image": "https://replicate.delivery/pbxt/MgRPDBRCPGD8ydgoJf280WSnwN72LI9GluihOB7aJ0X5woHN/example_3.tif",
"return_probabilities": true,
"use_rotation_averaging": true
},
"logs": "Processing image: /tmp/tmpbajs3py_example_3.tif",
"output": {
"best_angle": 270,
"probabilities": {
"0": 0.00008525241034362807,
"90": 0.0001347377551610407,
"180": 0.0020375955646159127,
"270": 0.9977423995733261
}
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-03-18T23:59:43.907Z",
"started_at": "2025-03-18T23:59:43.912469Z",
"completed_at": "2025-03-18T23:59:51.56071Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/r31vsw794drma0cnnesa3aygvg/cancel",
"get": "https://api.replicate.com/v1/predictions/r31vsw794drma0cnnesa3aygvg",
"web": "https://replicate.com/p/r31vsw794drma0cnnesa3aygvg"
},
"metrics": {
"predict_time": 7.648240467,
"total_time": 7.65371
}
}