Create object/person detection → parameters
create_detection_reactiveSet up object detection control channels in TouchDesigner using a WebSocket detector or CPU ONNX model, outputting presence, count, and bounding boxes as CHOP channels.
Instructions
Turn object/person detection into TouchDesigner control channels — with NO CUDA requirement. Two backends: 'websocket' subscribes to an external detector process that streams JSON detections over a WebSocket (runs on any machine/GPU, or none), and 'onnx' scaffolds a CPU Script CHOP that runs an .onnx model via onnxruntime inside TD. Either way the output is a Null CHOP carrying a stable contract — presence (0/1), count, and per-object normalized bboxes (obj1_x, obj1_y, obj1_w, obj1_h, obj1_score, …) — ready for bind_to_channel. (Detection idea inspired by TDYolo, MIT-licensed; no code copied.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | (websocket) URL of the external detector's WebSocket. It should send JSON objects like {"count": N, "objects": [{"x":..,"y":..,"w":..,"h":..,"score":..}]}. | ws://127.0.0.1:8765 |
| name | No | Base name for the container COMP. | detection |
| source | No | Detector backend. 'websocket' subscribes to an external detector process that streams JSON detections (no CUDA needed, runs anywhere). 'onnx' scaffolds a Script CHOP that runs an ONNX model via onnxruntime on the CPU inside TouchDesigner — you fill in the model path + inference. | websocket |
| input_top | No | (onnx) Absolute path of the TOP to read frames from for inference. Pulled via a Select TOP. | |
| model_path | No | (onnx) Filesystem path to the .onnx model to load in the Script CHOP (CPU inference). | |
| max_objects | No | Number of detected objects (bboxes) to expose as channels (obj1_x, obj1_y, …). | |
| parent_path | No | COMP to create the detection container in (default '/project1'). | /project1 |
| reconnect_seconds | No | (websocket) Auto-reconnect interval if the detector connection drops. |