diff --git a/depthai_models/yolov6_nano_r2_coco.RVC2.yaml b/depthai_models/yolov6_nano_r2_coco.RVC2.yaml new file mode 100644 index 0000000..07be5b0 --- /dev/null +++ b/depthai_models/yolov6_nano_r2_coco.RVC2.yaml @@ -0,0 +1,2 @@ +model: luxonis/yolov6-nano:r2-coco-512x288 +platform: RVC2 \ No newline at end of file diff --git a/depthai_models/yolov6_nano_r2_coco.RVC4.yaml b/depthai_models/yolov6_nano_r2_coco.RVC4.yaml new file mode 100644 index 0000000..824fd00 --- /dev/null +++ b/depthai_models/yolov6_nano_r2_coco.RVC4.yaml @@ -0,0 +1,2 @@ +model: luxonis/yolov6-nano:r2-coco-512x288 +platform: RVC4 \ No newline at end of file diff --git a/main.py b/main.py index 1ace7fa..dfa5238 100644 --- a/main.py +++ b/main.py @@ -6,32 +6,20 @@ from depthai_nodes.node.parsing_neural_network import ParsingNeuralNetwork -model = "luxonis/yolov6-nano:r2-coco-512x288" - visualizer = dai.RemoteConnection(httpPort=8082) device = dai.Device() -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") @@ -41,7 +29,6 @@ nn_with_parser.out, label_map=nn_archive.getConfigV1().model.heads[0].metadata.classes, ) - print("Pipeline created.") @@ -52,4 +39,4 @@ key = visualizer.waitKey(1) if key == ord("q"): print("Got q key from the remote connection!") - break \ No newline at end of file + break diff --git a/oakapp.toml b/oakapp.toml index 0de7f9b..b8b330a 100644 --- a/oakapp.toml +++ b/oakapp.toml @@ -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"] \ No newline at end of file