qpycam-detect Command
The qpycam-detect command performs AI-based image analysis, such as object detection, image classification, segmentation, and pose estimation.
It supports real-time processing and can stream results via RTSP or MQTT.
Usage
Commonly Used Options
| Option | Description |
|---|---|
-ct, --camera_type |
Selects the camera type (0: CSI, 1: USB, 2: RTSP). |
-id, --device_id |
Specifies the device ID for USB cameras (default: 2). |
-url, --input_rtsp_url |
RTSP stream URL (only for RTSP cameras). |
-t, --timeout |
Sets the stream duration in ms (0 for infinite). |
--mqtt_topic |
MQTT topic to publish inference results. |
--mqtt_host |
MQTT broker IP address |
--mqtt_port |
MQTT broker port number |
--mqtt_config |
Path to the MQTT configuration file |
For a full list of common options, refer to Common Options.
AI Detection Options
| Option | Description |
|---|---|
--display |
Enable video stream display on screen |
-dt, --detect_type |
Type of detection (classification, detection, segmentation, pose, superresolution). |
--module |
AI model module to use (e.g., yolo-nas, mobilenet, posenet). |
--delegate |
Backend for model inference (gpu, cpu, xnnpack). |
-m, --model |
Path to the AI model file. |
-l, --labels |
Path to the label file. |
--threshold |
Confidence threshold for detection (default: 50). |
--results |
Number of detection results to display (default: 10). |
--constants |
Additional constants for the model. |
Note
The qpycam-detect command supports saving video, inference, displaying output, and RTSP streaming.
It combines the features of qpycam-hello, qpycam-rtsp, and qpycam-record.
However, display is disabled by default. To enable it, use the --display option.
Supported Models
Qpycam currently supports models in the TFLite format for computer vision inference.
| Model Type | Model File(s) |
|---|---|
| classification | inception_v3_quantized.tflite |
| object detection | Yolo-v7-Quantized.tflite YOLOv8-Detection-Quantized.tflite |
| segmentation | deeplabv3_resnet50.tflite |
| pose | hrnet_pose_quantized.tflite posenet_mobilenet_v1.tflite |
Example Usage
-
Run segmentation using an unquantized DeepLab model
-
Run object detection using a quantized YOLOv8 model with additional constants
-
Send detection results to an MQTT broker
For configuration file usage, see Configuration Guide.