Skip to content

Commit

Permalink
organize script files
Browse files Browse the repository at this point in the history
  • Loading branch information
justincdavis committed Aug 1, 2024
1 parent 73e98c2 commit cace816
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/oakutils/nodes/_script_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from __future__ import annotations
13 changes: 12 additions & 1 deletion src/oakutils/nodes/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@
import depthai as dai


def verify_script(
script: str | Path,
) -> bool:
"""
"""

def create_script(
pipeline: dai.Pipeline,
script: str | Path,
name: str | None = None,
processor: dai.ProcessorType = dai.ProcessorType.LEON_CSS,
) -> None:
) -> dai.node.Script:
"""
Use to create a script node.
Expand All @@ -46,6 +52,11 @@ def create_script(
The processor type to run the script on, by default dai.ProcessorType.LEON_CSS
Should only be changed if you know what you are doing.
Returns
-------
dai.node.Script
The script node
"""
name = name if name else f"script_{time.time()}"
script_node = pipeline.create(dai.node.Script)
Expand Down
11 changes: 11 additions & 0 deletions src/oakutils/nodes/scripts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

"""
Premade scripts for allowing more advanced usage.
References
----------
https://docs.luxonis.com/software/depthai/examples/script_change_pipeline_flow/
https://docs.luxonis.com/software/depthai-components/nodes/script#available-modules-and-libraries
"""

0 comments on commit cace816

Please sign in to comment.