Destruction & Fire Detection
BETA destructionOverview
The Destruction & Fire model is designed to detect images and videos of damaged or destroyed buildings and vehicles, violent riots, or scenes involving fire βΒ whether caused by accidents, arson, or natural disasters. It also identifies fires in contexts that pose significant risks to safety.
For the sake of clarity, the following scenes are not flagged by this model: abandoned ruins with no signs of recent life, buildings under construction, graffiti-covered walls, fireworks, burned forests, controlled fires (e.g., campfires, lit candles), and peaceful protests.
Results are returned in 11 different classes, to help you make more nuanced decisions.
Destruction & Fire classes
The Destruction & Fire model returns an overall probability in destruction.prob. This probability is defined as the maximum of all the underlying classes listed below. For more fine-grained decisions, you can use the following classes:
- Major building damage: Photos and illustrations showing significant structural damage to buildings, often caused by war or natural disasters
destruction.classes.building_major_damage- Completely destroyed buildings (e.g., houses, apartment blocks, public facilities)
- Buildings with missing walls or roofs (e.g., houses, apartment blocks, public facilities)
This does not include abandoned ruins or buildings under construction or renovation.
- Minor building damage: Photos and illustrations depicting minor damage to buildings, often caused by vandalism or less severe natural disasters
destruction.classes.building_minor_damage- Broken windows
- Destroyed room interiors, while the building's main structure (walls, ceiling, floor) remains intact
This does not include graffiti-covered walls.
- Building on fire: Photos and illustrations showing buildings on fire
destruction.classes.building_on_fire- Buildings (e.g., houses, apartment blocks, public facilities) on fire, with visible or invisible flames
- Burned building: Photos and illustrations depicting buildings partially or completely burned
destruction.classes.building_burned- Completely burned buildings (e.g., houses, apartment blocks, public facilities)
- Partially burned buildings (e.g., houses, apartment blocks, public facilities)
- Major vehicle damage: Photos and illustrations showing significant damage to vehicles, often caused by major accidents
destruction.classes.vehicle_major_damage- Vehicles (e.g., cars, trucks, motorcycles, aircraft, watercraft, trains) involved in accidents that may have resulted in death or serious injuries
- Severely damaged vehicles (e.g., cars, trucks, motorcycles, aircraft, watercraft, trains) that seem irreparable
- Minor vehicle damage: Photos and illustrations depicting less severe damage to vehicles, often caused by minor accidents or vandalism
destruction.classes.vehicle_minor_damage- Vehicles (e.g., cars, trucks, motorcycles, aircraft, watercraft, trains) involved in minor accidents with no serious injuries
- Vehicles (e.g., cars, trucks, motorcycles, aircraft, watercraft, trains) with moderate damage that seems repairable
- Vehicle on fire: Photos and illustrations showing vehicles on fire
destruction.classes.vehicle_on_fire- Vehicles (e.g., cars, trucks, motorcycles, aircraft, watercraft, trains) on fire, with visible or invisible flames
- Burned vehicle: Photos and illustrations depicting vehicles partially or completely burned
destruction.classes.vehicle_burned- Completely burned vehicles (e.g., cars, trucks, motorcycles, aircraft, watercraft, trains)
- Partially burned vehicles (e.g., cars, trucks, motorcycles, aircraft, watercraft, trains)
- Wildfire: Photos and illustrations showing wildfires, including those potentially caused by human activity (e.g., vandalism, arson)
destruction.classes.wildfire- Wildfires
This does not include wildfires that have burned out.
- Unsafe fire: Photos and illustrations showing people or objects on fire
destruction.classes.unsafe_fire- Self-immolation
- Burning objects that are not part of a burning building or vehicle
This does not include fireworks or controlled fires (e.g., campfires, lit candles).
- Violent protest: Photos and illustrations depicting violent riots
destruction.classes.violent_protest- Signs of violence such as fire, weapons, military or police action, physical violence, or vandalism during or related to a protest
This does not include peaceful protests.
- Violence Detection: Detect physical and fights.
- Military Scene Detection: Detect military equipment and personnel.
- Weapon Detection: Detect firearms, knives and how they are being used in images and videos.
Related models
The following 3 models can provide a useful complement to the destruction model:
Use the model (images)
If you haven't already, create an account to get your own API keys.
Detect destruction in images
Let's say you want to moderate the following image:
You can either share a URL to the image, or upload the image file.
Option 1: Send image URL
Here's how to proceed if you choose to share the image URL:
curl -X GET -G 'https://api.sightengine.com/1.0/check.json' \
-d 'models=destruction' \
-d 'api_user={api_user}&api_secret={api_secret}' \
--data-urlencode 'url=https://sightengine.com/assets/img/doc/destruction/building_on_fire.jpg'
# this example uses requests
import requests
import json
params = {
'url': 'https://sightengine.com/assets/img/doc/destruction/building_on_fire.jpg',
'models': 'destruction',
'api_user': '{api_user}',
'api_secret': '{api_secret}'
}
r = requests.get('https://api.sightengine.com/1.0/check.json', params=params)
output = json.loads(r.text)
$params = array(
'url' => 'https://sightengine.com/assets/img/doc/destruction/building_on_fire.jpg',
'models' => 'destruction',
'api_user' => '{api_user}',
'api_secret' => '{api_secret}',
);
// this example uses cURL
$ch = curl_init('https://api.sightengine.com/1.0/check.json?'.http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$output = json_decode($response, true);
// this example uses axios
const axios = require('axios');
axios.get('https://api.sightengine.com/1.0/check.json', {
params: {
'url': 'https://sightengine.com/assets/img/doc/destruction/building_on_fire.jpg',
'models': 'destruction',
'api_user': '{api_user}',
'api_secret': '{api_secret}',
}
})
.then(function (response) {
// on success: handle response
console.log(response.data);
})
.catch(function (error) {
// handle error
if (error.response) console.log(error.response.data);
else console.log(error.message);
});
See request parameter description
| Parameter | Type | Description |
| url | string | URL of the image to analyze |
| models | string | comma-separated list of models to apply |
| api_user | string | your API user id |
| api_secret | string | your API secret |
Option 2: Send image file
Here's how to proceed if you choose to upload the image file:
curl -X POST 'https://api.sightengine.com/1.0/check.json' \
-F 'media=@/path/to/image.jpg' \
-F 'models=destruction' \
-F 'api_user={api_user}' \
-F 'api_secret={api_secret}'
# this example uses requests
import requests
import json
params = {
'models': 'destruction',
'api_user': '{api_user}',
'api_secret': '{api_secret}'
}
files = {'media': open('/path/to/image.jpg', 'rb')}
r = requests.post('https://api.sightengine.com/1.0/check.json', files=files, data=params)
output = json.loads(r.text)
$params = array(
'media' => new CurlFile('/path/to/image.jpg'),
'models' => 'destruction',
'api_user' => '{api_user}',
'api_secret' => '{api_secret}',
);
// this example uses cURL
$ch = curl_init('https://api.sightengine.com/1.0/check.json');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$response = curl_exec($ch);
curl_close($ch);
$output = json_decode($response, true);
// this example uses axios and form-data
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
data = new FormData();
data.append('media', fs.createReadStream('/path/to/image.jpg'));
data.append('models', 'destruction');
data.append('api_user', '{api_user}');
data.append('api_secret', '{api_secret}');
axios({
method: 'post',
url:'https://api.sightengine.com/1.0/check.json',
data: data,
headers: data.getHeaders()
})
.then(function (response) {
// on success: handle response
console.log(response.data);
})
.catch(function (error) {
// handle error
if (error.response) console.log(error.response.data);
else console.log(error.message);
});
See request parameter description
| Parameter | Type | Description |
| media | file | image to analyze |
| models | string | comma-separated list of models to apply |
| api_user | string | your API user id |
| api_secret | string | your API secret |
API response
The API will then return a JSON response with the following structure:
{
"status": "success",
"request": {
"id": "req_gcTp4s63IAAni0lFOT7KK",
"timestamp": 1714997478.552115,
"operations": 1
},
"destruction": {
"prob": 0.99,
"classes": {
"building_major_damage": 0.001,
"building_minor_damage": 0.001,
"building_on_fire": 0.99,
"building_burned": 0.001,
"vehicle_major_damage": 0.001,
"vehicle_minor_damage": 0.001,
"vehicle_on_fire": 0.001,
"vehicle_burned": 0.001,
"wildfire": 0.001,
"unsafe_fire": 0.001,
"violent_protest": 0.001
}
},
"media": {
"id": "med_gcTpqyOZ18IMsiMe4Ar28",
"uri": "https://sightengine.com/img/doc/destruction/building_on_fire.jpg"
}
}
Successful Response
Status code: 200, Content-Type: application/json| Field | Type | Description |
| status | string | status of the request, either "success" or "failure" |
| request | object | information about the processed request |
| request.id | string | unique identifier of the request |
| request.timestamp | float | timestamp of the request in Unix time |
| request.operations | integer | number of operations consumed by the request |
| destruction | object | results for the model |
| media | object | information about the media analyzed |
| media.id | string | unique identifier of the media |
| media.uri | string | URI of the media analyzed: either the URL or the filename |
Error
Status codes: 4xx and 5xx. See how error responses are structured.Use the model (videos)
Detecting destruction in videos
Option 1: Short video
Here's how to proceed to analyze a short video (less than 1 minute):
curl -X POST 'https://api.sightengine.com/1.0/video/check-sync.json' \
-F 'media=@/path/to/video.mp4' \
-F 'models=destruction' \
-F 'api_user={api_user}' \
-F 'api_secret={api_secret}'
# this example uses requests
import requests
import json
params = {
# specify the models you want to apply
'models': 'destruction',
'api_user': '{api_user}',
'api_secret': '{api_secret}'
}
files = {'media': open('/path/to/video.mp4', 'rb')}
r = requests.post('https://api.sightengine.com/1.0/video/check-sync.json', files=files, data=params)
output = json.loads(r.text)
$params = array(
'media' => new CurlFile('/path/to/video.mp4'),
// specify the models you want to apply
'models' => 'destruction',
'api_user' => '{api_user}',
'api_secret' => '{api_secret}',
);
// this example uses cURL
$ch = curl_init('https://api.sightengine.com/1.0/video/check-sync.json');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$response = curl_exec($ch);
curl_close($ch);
$output = json_decode($response, true);
// this example uses axios and form-data
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
data = new FormData();
data.append('media', fs.createReadStream('/path/to/video.mp4'));
// specify the models you want to apply
data.append('models', 'destruction');
data.append('api_user', '{api_user}');
data.append('api_secret', '{api_secret}');
axios({
method: 'post',
url:'https://api.sightengine.com/1.0/video/check-sync.json',
data: data,
headers: data.getHeaders()
})
.then(function (response) {
// on success: handle response
console.log(response.data);
})
.catch(function (error) {
// handle error
if (error.response) console.log(error.response.data);
else console.log(error.message);
});
See request parameter description
| Parameter | Type | Description |
| media | file | image to analyze |
| models | string | comma-separated list of models to apply |
| interval | float | frame interval in seconds, out of 0.5, 1, 2, 3, 4, 5 (optional) |
| api_user | string | your API user id |
| api_secret | string | your API secret |
Option 2: Long video
Here's how to proceed to analyze a long video. Note that if the video file is very large, you might first need to upload it through the Upload API.
curl -X POST 'https://api.sightengine.com/1.0/video/check.json' \
-F 'media=@/path/to/video.mp4' \
-F 'models=destruction' \
-F 'callback_url=https://yourcallback/path' \
-F 'api_user={api_user}' \
-F 'api_secret={api_secret}'
# this example uses requests
import requests
import json
params = {
# specify the models you want to apply
'models': 'destruction',
# specify where you want to receive result callbacks
'callback_url': 'https://yourcallback/path',
'api_user': '{api_user}',
'api_secret': '{api_secret}'
}
files = {'media': open('/path/to/video.mp4', 'rb')}
r = requests.post('https://api.sightengine.com/1.0/video/check.json', files=files, data=params)
output = json.loads(r.text)
$params = array(
'media' => new CurlFile('/path/to/video.mp4'),
// specify the models you want to apply
'models' => 'destruction',
// specify where you want to receive result callbacks
'callback_url' => 'https://yourcallback/path',
'api_user' => '{api_user}',
'api_secret' => '{api_secret}',
);
// this example uses cURL
$ch = curl_init('https://api.sightengine.com/1.0/video/check.json');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$response = curl_exec($ch);
curl_close($ch);
$output = json_decode($response, true);
// this example uses axios and form-data
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
data = new FormData();
data.append('media', fs.createReadStream('/path/to/video.mp4'));
// specify the models you want to apply
data.append('models', 'destruction');
// specify where you want to receive result callbacks
data.append('callback_url', 'https://yourcallback/path');
data.append('api_user', '{api_user}');
data.append('api_secret', '{api_secret}');
axios({
method: 'post',
url:'https://api.sightengine.com/1.0/video/check.json',
data: data,
headers: data.getHeaders()
})
.then(function (response) {
// on success: handle response
console.log(response.data);
})
.catch(function (error) {
// handle error
if (error.response) console.log(error.response.data);
else console.log(error.message);
});
See request parameter description
| Parameter | Type | Description |
| media | file | image to analyze |
| callback_url | string | callback URL to receive moderation updates (optional) |
| models | string | comma-separated list of models to apply |
| interval | float | frame interval in seconds, out of 0.5, 1, 2, 3, 4, 5 (optional) |
| api_user | string | your API user id |
| api_secret | string | your API secret |
Option 3: Live-stream
Here's how to proceed to analyze a live-stream:
curl -X GET -G 'https://api.sightengine.com/1.0/video/check.json' \
--data-urlencode 'stream_url=https://domain.tld/path/video.m3u8' \
-d 'models=destruction' \
-d 'callback_url=https://your.callback.url/path' \
-d 'api_user={api_user}' \
-d 'api_secret={api_secret}'
# if you haven't already, install the SDK with 'pip install sightengine'
from sightengine.client import SightengineClient
client = SightengineClient('{api_user}','{api_secret}')
output = client.check('destruction').video('https://domain.tld/path/video.m3u8', 'https://your.callback.url/path')
// if you haven't already, install the SDK with 'composer require sightengine/client-php'
use \Sightengine\SightengineClient;
$client = new SightengineClient('{api_user}','{api_secret}');
$output = $client->check(['destruction'])->video('https://domain.tld/path/video.m3u8', 'https://your.callback.url/path');
// if you haven't already, install the SDK with 'npm install sightengine --save'
var sightengine = require('sightengine')('{api_user}', '{api_secret}');
sightengine.check(['destruction']).video('https://domain.tld/path/video.m3u8', 'https://your.callback.url/path').then(function(result) {
// The API response (result)
}).catch(function(err) {
// Handle error
});
See request parameter description
| Parameter | Type | Description |
| stream_url | string | URL of the video stream |
| callback_url | string | callback URL to receive moderation updates (optional) |
| models | string | comma-separated list of models to apply |
| interval | float | frame interval in seconds, out of 0.5, 1, 2, 3, 4, 5 (optional) |
| api_user | string | your API user id |
| api_secret | string | your API secret |
Moderation result
The Moderation result will be provided either directly in the request response (for sync calls, see below) or through the callback URL your provided (for async calls).
Here is the structure of the JSON response with moderation results for each analyzed frame under the data.frames array:
{
"status": "success",
"request": {
"id": "req_gmgHNy8oP6nvXYaJVLq9n",
"timestamp": 1717159864.348989,
"operations": 21
},
"data": {
"frames": [
{
"info": {
"id": "med_gmgHcUOwe41rWmqwPhVNU_1",
"position": 0
},
"destruction": {
"prob": 0.001,
"classes": {
"building_major_damage": 0.001,
"building_minor_damage": 0.001,
"building_on_fire": 0.001,
"building_burned": 0.001,
"vehicle_major_damage": 0.001,
"vehicle_minor_damage": 0.001,
"vehicle_on_fire": 0.001,
"vehicle_burned": 0.001,
"wildfire": 0.001,
"unsafe_fire": 0.001,
"violent_protest": 0.001
}
}
},
...
]
},
"media": {
"id": "med_gmgHcUOwe41rWmqwPhVNU",
"uri": "yourfile.mp4"
},
}
You can use the classes under the destruction object to detect destruction in the video.