Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 Yolo model type deduction #1225

Open
wants to merge 10 commits into
base: v3_develop
Choose a base branch
from
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ _builds/
*.swp
/env

.history/
.history/

.compile_commands.json
.depthai_cached_models/
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceRVC4Config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set(DEPTHAI_DEVICE_RVC4_MATURITY "snapshot")

# "version if applicable"
# set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+93f7b75a885aa32f44c5e9f53b74470c49d2b1af")
set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+ee40f16b48648261a85c3e568cb1a005ee57b2d7")
set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+6c542270418705221fb57061b5d29137407fa9cd")
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "9af6aa33e593ce207ad00d09e528ce85181d543b")
set(DEPTHAI_DEVICE_SIDE_COMMIT "b73558f5eea7cd96b87fc4f0d2945aaa2f290dde")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
2 changes: 1 addition & 1 deletion examples/cpp/Visualizer/visualizer_yolo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ int main(int argc, char** argv) {
// Set up topics for remote connection
remoteConnector.addTopic("detections", detectionNetwork->out);
remoteConnector.addTopic("images", *cameraOutputVisualize);
remoteConnector.registerPipeline(pipeline);
pipeline.start();

remoteConnector.registerPipeline(pipeline);
// Main loop
while(isRunning && pipeline.isRunning()) {
int key = remoteConnector.waitKey(1);
Expand Down
3 changes: 2 additions & 1 deletion include/depthai/common/DetectionParserOptions.hpp
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we maybe go with an enum here?

I think we should also add a way to specify the subtype with setters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIRC in NNArchive spec it is defined as a string, I think this way is a bit simpler if we want to still have the option to use tensor layer names

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace dai {
struct DetectionParserOptions {
/// Generic Neural Network properties
DetectionNetworkType nnFamily;
std::string subtype;
float confidenceThreshold;

/// YOLO specific network properties
Expand All @@ -25,6 +26,6 @@ struct DetectionParserOptions {
float iouThreshold;
};

DEPTHAI_SERIALIZE_EXT(DetectionParserOptions, nnFamily, confidenceThreshold, classes, coordinates, anchors, anchorMasks, anchorsV2, iouThreshold);
DEPTHAI_SERIALIZE_EXT(DetectionParserOptions, nnFamily, subtype, confidenceThreshold, classes, coordinates, anchors, anchorMasks, anchorsV2, iouThreshold);

} // namespace dai
3 changes: 3 additions & 0 deletions src/pipeline/node/DetectionParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ void DetectionParser::setConfig(const dai::NNArchiveVersionedConfig& config) {

if(head.parser == "YOLO") {
properties.parser.nnFamily = DetectionNetworkType::YOLO;
if(head.metadata.subtype){
properties.parser.subtype = *head.metadata.subtype;
}
} else if(head.parser == "SSD" || head.parser == "MOBILENET") {
properties.parser.nnFamily = DetectionNetworkType::MOBILENET;
} else {
Expand Down
Loading