typefile
{
"img": "https://replicate.delivery/pbxt/MMrqCfauwgRogO1enPDxkrQ4o8nzJqcP5HYUg6zh99fg7hX8/0754.jpg"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_7Lr**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run czeslov/weather-classification using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"czeslov/weather-classification:3ff244bbbe41fd9fd6558e789a29c67c993c69e6cb8429b81ac21627e1260194",
{
input: {
img: "https://replicate.delivery/pbxt/MMrqCfauwgRogO1enPDxkrQ4o8nzJqcP5HYUg6zh99fg7hX8/0754.jpg"
}
}
);
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_7Lr**********************************
This is your API token. Keep it to yourself.
import replicate
Run czeslov/weather-classification using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"czeslov/weather-classification:3ff244bbbe41fd9fd6558e789a29c67c993c69e6cb8429b81ac21627e1260194",
input={
"img": "https://replicate.delivery/pbxt/MMrqCfauwgRogO1enPDxkrQ4o8nzJqcP5HYUg6zh99fg7hX8/0754.jpg"
}
)
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_7Lr**********************************
This is your API token. Keep it to yourself.
Run czeslov/weather-classification 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": "czeslov/weather-classification:3ff244bbbe41fd9fd6558e789a29c67c993c69e6cb8429b81ac21627e1260194",
"input": {
"img": "https://replicate.delivery/pbxt/MMrqCfauwgRogO1enPDxkrQ4o8nzJqcP5HYUg6zh99fg7hX8/0754.jpg"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
rainbow
{
"id": "jt8z82ww81rge0cmhyvsnxjzm4",
"model": "czeslov/weather-classification",
"version": "3ff244bbbe41fd9fd6558e789a29c67c993c69e6cb8429b81ac21627e1260194",
"input": {
"img": "https://replicate.delivery/pbxt/MMrqCfauwgRogO1enPDxkrQ4o8nzJqcP5HYUg6zh99fg7hX8/0754.jpg"
},
"logs": "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 369ms/step\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 384ms/step",
"output": "rainbow",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-01-22T20:32:42.56Z",
"started_at": "2025-01-22T20:33:20.835717Z",
"completed_at": "2025-01-22T20:33:21.45953Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/jt8z82ww81rge0cmhyvsnxjzm4/cancel",
"get": "https://api.replicate.com/v1/predictions/jt8z82ww81rge0cmhyvsnxjzm4",
"web": "https://replicate.com/p/jt8z82ww81rge0cmhyvsnxjzm4"
},
"metrics": {
"predict_time": 0.623813665,
"total_time": 38.89953
}
}