2. Create an Intrusion Detector
Create an intrusion detection system through the STARSG platform. Intrusion detection can detect whether there are traces of people in the input image data, promptly discover intrusion behaviors, and synchronize the information to the user, helping the user discover or prevent the occurrence of intrusion behaviors, thereby enhancing the user's overall security.
1. Create a Simple Human Detection
First, create a new Agent and enter the Edit Workflow page.
We will first attempt to write the simplest human detection. Change Start to General mode, change param Type to Media, add a Media node in the General node, and add a Human Detection node in the Extension. Connect the Start, Media, Human Detection, and End nodes. Write the names and outputs of the Media and Detection elements, then bind the end node to the output value of Human Detection. The general effect is as shown in the figure below:

Test run, and you can observe that the output structure of Human Detection is:

That is, a Boolean value indicating whether there is a person in the target image and the size and coordinates of the person in the image.
2. Detection Judgment and Alarm
To make a judgment in Agent, we need to extract the hasHuman value from Human Detection. So we add a Program node. Since the output structure of the Human Detection node is a dictionary structure, after using the output of the Human Detection node as the input of the Program node, the Boolean value can be extracted with the following code:
def main(args):
detection = args["detection"]
result = detection["hasHuman"]
return {"result": result}
Then add a Condition node after the Program node to determine whether the Boolean value output by the Program node is equal to True. The specific settings are as shown in the figure below:

In the case of detecting a person, it indicates an intrusion, and an alarm needs to be made to the user. We add an LLM node, select the vLLM model to describe the detected person's clothing and appearance, and analyze whether the current person's actions indicate an intrusion behavior.

Then connect both the LLM node and the Else condition of the Condition node to the End node. The final connection diagram is as shown below:
