# Fire/Smoke Detection-Server

Fires often begin in quiet, low-traffic areas—electrical rooms, loading docks, storage areas—where nobody’s watching. `KBY-AI`'s `fire/smoke detection SDK` turns your existing CCTV into smart fire sentries, instantly detecting smoke or flames before they spiral into a crisis. Perfect for warehouses, industrial sites, and logistics hubs.

## Features

* [x] Fire Detection
* [x] Smoke Detection
* [x] Available on Docker
* [x] Free Trial License
* [x] Free Update & Technical Support
* [x] On-Premise Solution

## License

We offer `lifetime license(perpetual license)` based on `machine ID` for every server(`Windows`, `Linux`). The license is available for `one-time payment`. In other words, once you purchase license from me, you can use our `SDK` permanently.

To request a license, please contact us:

> **Email:** <contact@kby-ai.com>&#x20;

{% embed url="<https://wa.me/+19092802609>" %}

{% embed url="<https://t.me/kbyaisupport>" %}

{% embed url="<https://discord.gg/6wm383re2s>" %}

{% embed url="<https://teams.live.com/l/invite/FAAYGB1-IlXkuQM3AQ>" %}

## Recommended Spec.

### 1. Linux

* **CPU:** 2 cores or more (Recommended: 2 cores)
* **RAM:** 4 GB or more (Recommended: 8 GB)
* HDD: 4 GB or more (Recommended: 8 GB)
* **OS:** Windows 7 or later
* **Architecture:** x64

### 2. Windows

* **CPU:** 2 cores or more (Recommended: 2 cores)
* **RAM:** 4 GB or more (Recommended: 8 GB)
* HDD: 4 GB or more (Recommended: 8 GB)
* **OS:** Ubuntu 20.04 or later
* **Architecture:** x64

## Setting up SDK & Test

* Pull `Docker`image.

```bash
sudo docker pull kbyai/fire-smoke-detection:latest
```

* Read `machine code`

<pre class="language-bash"><code class="lang-bash"><strong>sudo docker run -e LICENSE="xxxxx" kbyai/fire-smoke-detection:latest
</strong></code></pre>

* Send us `machine code` obtained.

<figure><img src="/files/0zVOPOtYPlv5wnPavENA" alt=""><figcaption></figcaption></figure>

* Create a `license.txt` file and write the license key that you received from `KBY-AI` team.
* Run `Docker` container

```
sudo docker run -v ./license.txt:/home/openvino/kby-ai-fire/license.txt -p 8081:8080 -p 9001:9000 kbyai/fire-smoke-detection:latest
```

* Here are the endpoints to test the `API` through `Postman`:&#x20;
* To test with an image file, send a `POST` request to `http://{xx.xx.xx.xx}:8081/fire`.\
  To test with a `base64-encoded` image, send a `POST` request to `http://{xx.xx.xx.xx}:8081/fire_base64`.

<figure><img src="/files/0sMmIsWh79j9evDoZLce" alt=""><figcaption></figcaption></figure>

## APIs

### 1. Getting Machine Code

The `SDK` provides a single API to get `machine code`

```python
machineCode = getMachineCode()
print("\nmachineCode: ", machineCode.decode('utf-8'))
```

### 2. Activate `SDK`

Read `license.txt` file and activate `SDK` with `setActivation()` function as follows.

```python
try:
    with open(licensePath, 'r') as file:
        license = file.read().strip()
except IOError as exc:
    print("failed to open license.txt: ", exc.errno)

print("\nlicense: ", license)

ret = setActivation(license.encode('utf-8'))
```

### 3. Initialize SDK

```python
ret = initSDK()
print("init: ", ret)
```

### 3. Get Detection Result

```python
cnt = getFireDetection(img_byte, len(img_byte), label_array, box_array, score_array)

rectangles = [
(box_array[i * 4], box_array[i * 4 + 1], box_array[i * 4 + 2], box_array[i * 4 + 3])
for i in range(cnt)]
scores = [score_array[i] for i in range(cnt)]
labels = [label_array[i] for i in range(cnt)]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kby-ai.com/help/product/computer-vision-solutions/fire-smoke-detection-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
