From Proof-of-Concept to Production in Hours
Deploying a neural network on an edge device used to be a week-long ordeal: install OpenVINO, configure the Intel Neural Compute Stick, write inference scripts, handle hardware quirks, and then repeat the whole cycle when you need to test a different model. Engineers spend more time gluing components together than actually solving the business problem.
ASI Biont changes that by acting as an AI agent that writes, deploys, and manages the entire integration on your behalf. You describe what you want – “connect to the Raspberry Pi with the Intel Neural Compute Stick, run YOLOv8 on the camera feed, and alert me when a person is detected” – and the agent produces a working solution within seconds. This article shows exactly how this integration works, with a real example and code you can adapt.
What is an Intel Neural Compute Stick?
The Intel Neural Compute Stick 2 (NCS2) is a USB‑3 form‑factor accelerator that runs deep learning inference using the Intel OpenVINO toolkit. It plugs into any device with a USB port – typically a Raspberry Pi, a Jetson Nano, or even a laptop – and offloads neural network computations from the CPU, enabling real‑time computer vision on low‑power edge hardware.
When combined with ASI Biont, the NCS2 becomes a remotely controllable inference node. The AI agent can:
- Switch between object‑detection, classification, and segmentation models on the fly.
- Adjust inference parameters (confidence threshold, input resolution) via chat commands.
- Stream detection results to cloud dashboards or trigger actions (e.g., send an image via Telegram).
How ASI Biont Connects to the Intel NCS
The Intel NCS does not expose its own network interface – it is a USB peripheral attached to a host computer. To control it, ASI Biont uses SSH (via paramiko) to connect to the host (e.g., a Raspberry Pi) and execute Python scripts that leverage OpenVINO. This approach is the most practical because:
- SSH works with any Linux‑based single‑board computer (Raspberry Pi, Orange Pi, BeagleBone).
- It allows the AI agent to install packages, transfer model files, and run inference scripts on the host.
- It returns results (text, file paths, logs) directly into the chat conversation.
Alternatively, if the host publishes inference results over MQTT, ASI Biont can subscribe to those topics via the paho-mqtt library. Both methods are supported through the execute_python sandbox.
Concrete Use Case: Smart Camera with Object Detection
Scenario: You have a Raspberry Pi 4 with an Intel Neural Compute Stick 2 and a USB camera. You want the Pi to run a lightweight object‑detection model (e.g., MobileNet‑SSD v2 converted to OpenVINO IR) and have ASI Biont process the detections – logging them, triggering alerts for “person” detections, and even changing the model to a more accurate one (YOLOv8‑n) when needed.
Step‑by‑Step Integration
-
User describes the task in chat:
“Connect to my Raspberry Pi at 192.168.1.100 with username pi and SSH key. The Pi has an Intel Neural Compute Stick and camera. Write a script that continuously captures frames, runs MobileNet‑SSD, and sends the detection results back to me via the chat. If a person is detected, also save the frame and send a notification.”
-
ASI Biont writes and executes the integration code (shown below) via the
execute_pythonsandbox. -
The code connects via SSH, uploads the inference script, runs it, and captures the output.
-
The AI agent then parses the output and optionally continues to process the stream (by running the script periodically or using MQTT).
Example AI‑Generated Python Script (SSH Runner)
import paramiko
import time
# Connection parameters (provided by user)
host = "192.168.1.100"
port = 22
username = "pi"
key_path = "/home/user/.ssh/id_rsa"
# Inference script to run on the Pi
inference_script = """
import cv2
from openvino.inference_engine import IECore
# Load model
ie = IECore()
net = ie.read_network(model="ssd_mobilenet_v2.xml", weights="ssd_mobilenet_v2.bin")
exec_net = ie.load_network(network=net, device_name="MYRIAD") # MYRIAD = Intel NCS
# Capture from camera
cap = cv2.VideoCapture(0)
ret, frame = cap.read()
if ret:
# Resize to model input shape
input_blob = next(iter(net.input_info))
n, c, h, w = net.input_info[input_blob].input_data.shape
resized = cv2.resize(frame, (w, h))
resized = resized.transpose((2, 0, 1)) # HWC to CHW
resized = resized.reshape((n, c, h, w))
# Inference
result = exec_net.infer({input_blob: resized})
detections = result["detection_out"][0][0]
# Parse detections
for detection in detections:
confidence = detection[2]
if confidence > 0.5:
class_id = int(detection[1])
print(f"Detection: class {class_id}, confidence {confidence:.2f}")
# Save image with persons
if class_id == 1: # person class
cv2.imwrite("person.jpg", frame)
print("PERSON_DETECTED")
cap.release()
"""
# Connect via SSH
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname=host, port=port, username=username, key_filename=key_path)
# Write inference script to Pi
sftp = client.open_sftp()
with sftp.open("/home/pi/inference.py", "w") as f:
f.write(inference_script)
sftp.close()
# Run script and capture stdout
stdin, stdout, stderr = client.exec_command("cd /home/pi && python3 inference.py")
output = stdout.read().decode()
error = stderr.read().decode()
client.close()
# Return results back to chat
print(output)
if error:
print("STDERR:", error)
After execution, the AI agent reads the printed output (e.g., detection lines, “PERSON_DETECTED”) and can take further actions – such as sending a Telegram message with the saved image via the telegram module or logging the detection to a database.
Automatically Switching Models
One of the most powerful features is dynamic model switching. Because ASI Biont controls the host via SSH, it can replace the model files and inference script on the fly. For example:
- Day scenario: lightweight MobileNet‑SSD (fast, low power).
- Night scenario: more accurate YOLOv8‑n (better in low light).
The user says “switch to night mode”, and the AI agent uploads the new model, restarts the script, and verifies the change – all in under a minute.
Why This Matters for Engineers
| Without ASI Biont | With ASI Biont |
|---|---|
| Manual setup: install OpenVINO, configure NCS, write Python scripts | Describe task in natural language |
| Days to iterate model changes | Seconds to switch models |
| Hard to monitor and control remotely | Full control via chat (SSH/MQTT) |
| One‑off prototype, hard to reuse | AI agent stores and reuses integration patterns |
Connect Any Device, Not Just Intel NCS
The same principle applies to thousands of other devices. ASI Biont connects to anything that speaks COM port (via Hardware Bridge), MQTT, Modbus, BACnet, OPC UA, CAN bus, gRPC, CoAP, HTTP API, WebSocket, or SSH. You simply describe your hardware in the chat:
“Read temperature from the Modbus PLC at 10.0.0.1, register 40001”
“Turn on the LED on Arduino COM3 with serial command LED_ON”
“Send the inference result to a Telegram chat”
The AI agent generates the correct Python code using the appropriate library and executes it in the secure sandbox. No dashboard panels, no “add device” buttons – just a conversation.
Getting Started Today
- Go to asibiont.com and create an account.
- In the chat, type: “Connect to my Raspberry Pi with Intel Neural Compute Stick. IP 192.168.1.100, username pi, SSH key ~/.ssh/id_rsa. Run object detection and alert me on person.”
- The AI agent will write the integration code, connect to your device, and start processing – typically in under 30 seconds.
Stop writing boilerplate glue code. Start deploying real edge AI in hours, not weeks. Try the Intel Neural Compute Stick integration on asibiont.com today.
Comments