Skip to content

T41 detections#7

Draft
matteius wants to merge 3 commits intothemactep:stablefrom
opensensor:t41-detections
Draft

T41 detections#7
matteius wants to merge 3 commits intothemactep:stablefrom
opensensor:t41-detections

Conversation

@matteius
Copy link
Copy Markdown

@matteius matteius commented Dec 7, 2025

To leverage, add to your prudynt.json config:

    "enabled": true,
    "json_path": "/tmp/detections.json",
    "poll_interval_ms": 200,
    "line_width": 2,
    "box_color": 4278255360,
    "text_color": 4294967295,
    "text_stroke_color": 4278190080,
    "min_confidence": 0.5,
    "show_labels": true,
    "show_confidence": true,
    "max_boxes": 10
},

Then separately push the mars binary and runtime libs to /opt and run your favorite mars model in dameon mode:
LD_LIBRARY_PATH=/opt ./mars_detect -t .5 tinydet_best_float.mars -d

Comment thread src/IMPAudio.cpp
.usrFrmDepth = 30, // frame buffer depth
#if defined(PLATFORM_T40) || defined(PLATFORM_T41)
.usrFrmDepth = 30,
.aecChn = AUDIO_AEC_CHANNEL_FIRST_LEFT, // T40/T41 require aecChn to be initialized
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

t41 Audio fix

Comment thread src/WS.cpp
u_ctx->imaging_dirty = false;
}
}
#else
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

t41 fix for preview UI

Comment thread src/Detection.cpp

Detection::Detection(int osdGrp, uint16_t stream_width, uint16_t stream_height)
: osdGrp(osdGrp), stream_width(stream_width), stream_height(stream_height),
enabled(false), initialized(false), lastModTime(0), currentBoxCount(0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Rather than an always on/off; shouldn't it just do detections if motion is detected?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I mean I wouldn't use it that way, but it could be supported in the futrure -- if I were using on device detections, id just want it always processing snapshots -- its not like its a battery cam.

Comment thread src/Detection.cpp

DetectionResult result;
if (!parseDetectionJSON(json_path, result)) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shouldn't it also run a script when it detects something like how Motion runs a script?

Copy link
Copy Markdown
Author

@matteius matteius Dec 7, 2025

Choose a reason for hiding this comment

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

scripts can leverage the /tmp/detections.json directly, this is for drawing overlays on the RTSP stream using OSD memory. OR mars_detect could trigger a script under certain conditions in that pipeline -- I just feel we shouldn't overly complicate the streamer app. onivf server could also do something with the detections json file.

@matteius
Copy link
Copy Markdown
Author

matteius commented Dec 7, 2025

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants