Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions depthai_models/yolov6_nano_r2_coco.RVC2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
model: luxonis/yolov6-nano:r2-coco-512x288
platform: RVC2
2 changes: 2 additions & 0 deletions depthai_models/yolov6_nano_r2_coco.RVC4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
model: luxonis/yolov6-nano:r2-coco-512x288
platform: RVC4
25 changes: 6 additions & 19 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,20 @@
from depthai_nodes.node.parsing_neural_network import ParsingNeuralNetwork

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can import the node like this:

Suggested change
from depthai_nodes.node.parsing_neural_network import ParsingNeuralNetwork
from depthai_nodes.node import ParsingNeuralNetwork



model = "luxonis/yolov6-nano:r2-coco-512x288"

visualizer = dai.RemoteConnection(httpPort=8082)
device = dai.Device()

api_key = "<your api key>" # Replace with your actual API key


with dai.Pipeline(device) as pipeline:
print("Creating pipeline...")

model_description = dai.NNModelDescription(model)
platform = device.getPlatformAsString()
model_description.platform = platform
nn_archive = dai.NNArchive(
dai.getModelFromZoo(
model_description,
apiKey=api_key,
)
platform = device.getPlatform()
model_description = dai.NNModelDescription.fromYamlFile(
f"yolov6_nano_r2_coco.{platform.name}.yaml"
)
nn_archive = dai.NNArchive(dai.getModelFromZoo(modelDescription=model_description))

input_node = pipeline.create(dai.node.Camera).build()

nn_with_parser = pipeline.create(ParsingNeuralNetwork).build(
input_node, nn_archive
)
nn_with_parser = pipeline.create(ParsingNeuralNetwork).build(input_node, nn_archive)

visualizer.addTopic("Video", nn_with_parser.passthrough, "images")
visualizer.addTopic("Visualizations", nn_with_parser.out, "images")
Expand All @@ -41,7 +29,6 @@
nn_with_parser.out,
label_map=nn_archive.getConfigV1().model.heads[0].metadata.classes,
)


print("Pipeline created.")

Expand All @@ -52,4 +39,4 @@
key = visualizer.waitKey(1)
if key == ord("q"):
print("Got q key from the remote connection!")
break
break
2 changes: 2 additions & 0 deletions oakapp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ prepare_build_container = []

build_steps = ["pip3 install -r /app/requirements.txt --break-system-packages"]

depthai_models = { yaml_path = "./depthai_models" }

entrypoint = ["bash", "-c", "python3 /app/main.py"]