|
|
|
@@ -34,7 +34,7 @@ class Operator: |
|
|
|
def on_event( |
|
|
|
self, |
|
|
|
dora_event: dict, |
|
|
|
send_output: Callable[[str, bytes | pa.UInt8Array, Optional[dict]], None], |
|
|
|
send_output: Callable[[str, bytes | pa.Array, Optional[dict]], None], |
|
|
|
) -> DoraStatus: |
|
|
|
if dora_event["type"] == "INPUT": |
|
|
|
return self.on_input(dora_event, send_output) |
|
|
|
@@ -43,7 +43,7 @@ class Operator: |
|
|
|
def on_input( |
|
|
|
self, |
|
|
|
dora_input: dict, |
|
|
|
send_output: Callable[[str, bytes | pa.UInt8Array, Optional[dict]], None], |
|
|
|
send_output: Callable[[str, bytes | pa.Array, Optional[dict]], None], |
|
|
|
) -> DoraStatus: |
|
|
|
""" |
|
|
|
Put image and bounding box on cv2 window. |
|
|
|
@@ -51,10 +51,10 @@ class Operator: |
|
|
|
Args: |
|
|
|
dora_input["id"] (str): Id of the dora_input declared in the yaml configuration |
|
|
|
dora_input["value"] (arrow array): message of the dora_input |
|
|
|
send_output Callable[[str, bytes | pa.UInt8Array, Optional[dict]], None]: |
|
|
|
send_output Callable[[str, bytes | pa.Array, Optional[dict]], None]: |
|
|
|
Function for sending output to the dataflow: |
|
|
|
- First argument is the `output_id` |
|
|
|
- Second argument is the data as either bytes or `pa.UInt8Array` |
|
|
|
- Second argument is the data as either bytes or `pa.Array` |
|
|
|
- Third argument is dora metadata dict |
|
|
|
e.g.: `send_output("bbox", pa.array([100], type=pa.uint8()), dora_event["metadata"])` |
|
|
|
""" |
|
|
|
|