Predicting a synthesised image
You can use this endpoint to detect if an image has been artificially generated.
Last updated
Was this helpful?
Was this helpful?
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"imageUrl": "YOUR_IMAGE_URL/image.jpg",
"modelName": "MODEL_NAME",
"token": "YOUR_ENDPOINT_TOKEN"
}' \
https://enterprise.personr.co/api/1.1/wf/api-deepfake-detectionconst axios = require('axios');
const url = 'https://enterprise.personr.co/api/1.1/wf/api-deepfake-detection';
const token = 'YOUR_BEARER_TOKEN';
const endpointToken = 'YOUR_ENDPOINT_TOKEN';
const data = {
imageUrl: 'YOUR_IMAGE_URL/image.jpg',
modelName: 'Personr_DF_5M',
token: endpointToken
};
const config = {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
}
};
axios.post(url, data, config)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
require 'net/http'
require 'uri'
require 'json'
url = URI.parse('https://enterprise.personr.co/api/1.1/wf/api-deepfake-detection')
token = 'YOUR_BEARER_TOKEN'
endpoint_token = 'YOUR_ENDPOINT_TOKEN'
data = {
imageUrl: 'YOUR_IMAGE_URL/image.jpg',
modelName: 'Personr_DF_5M',
token: endpoint_token
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url.path)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{token}"
request.body = data.to_json
response = http.request(request)
puts response.bodyimport requests
url = 'https://enterprise.personr.co/api/1.1/wf/api-deepfake-detection'
token = 'YOUR_BEARER_TOKEN'
endpoint_token = 'YOUR_ENDPOINT_TOKEN'
data = {
'imageUrl': 'hYOUR_IMAGE_URL/image.jpg',
'modelName': 'Personr_DF_5M',
'token': endpoint_token
}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {}'.format(token)
}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
print(response.json())
else:
print('Error:', response.text){
"status": "success",
"response": {
"result": "Artificial",
"labels": [
"Artificial",
"Genuine"
],
"confidence": [
0.875041127204895,
0.12495886534452438
]
}
}{
"statusCode": 400,
"message": "Error: incorrect modelName provided"
}{
"error_class": "Unauthorized",
"args": {
"code": "1709700303639x0000000000000"
},
"message": null,
"translation": "Invalid or expired token: ABC123"