la_mojo: make the Darknet (YOLO filter) build and link #17
Merged
ClaudeAI
merged 1 commits from fix/la-mojo-darknet into master 2 hours ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'fix/la-mojo-darknet'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Summary
Makes the Darknet-based YOLO filter from
65b87bbcompile and link. The header facts come from upstream Darknet (hank-ai/darknet,src-lib/darknet.handsrc-lib/CMakeLists.txt).Why it did not work
load_network(),load_network_custom()andfree_network_ptr()are only declared whenDARKNET_INCLUDE_ORIGINAL_APIis defined beforedarknet.h. Otherwise all three give'...' was not declared in this scope.m_pNETwas declared asDarknetNetworkPtr *, i.e.void **, butDarknetNetworkPtris alreadytypedef void*. The result:invalid conversion from 'DarknetNetworkPtr' {aka 'void*'} to 'void**'.<prefix>/include/darknet.h, notinclude/darknet/darknet.h.-ldarknetwas only in Release86, while./builduses Debug86.Problems 1 and 2 were reproduced by compiling the original file against the upstream declarations.
Changes
kernelEventFilterYOLO.h:DARKNET_INCLUDE_ORIGINAL_API;<darknet.h>, falls back to<darknet/darknet.h>, and stops with a clear#errorif neither exists;m_pNETis now a plainDarknetNetworkPtr.makefileandla_mojo.vpj:-ldarknetis added to Debug86 and Debug. It is in the.vpjtoo, so a SlickEdit regeneration keeps it. Release and LRF_Proxy_ONLY do not link OpenCV or FFmpeg either, so they cannot build la_mojo at the moment anyway; they are left unchanged.kernelEventFilterYOLO::initFilter():validate(). Before,m_sYOLOFilterDatawas still zero, sofileExist("")failed and the filter could never start;LOG_ERRORformats into a 256-byte buffer.Testing
Darknet is not available in the build container, so the tests used a stand-in
darknet.hwith the exact upstream declarations and a stand-inlibdarknet.so:kernelEventFilterYOLO.cppcompiles with no warnings (-Wall -W -pedantic);make -kcompiles every file except the three that need live555, which cannot be installed in the container;On the build machine, Darknet (
libdarknet.so+darknet.h) must be installed.Still missing before YOLO actually runs
These are not part of this PR:
getYOLOFilterData(); the base class returns NULL. There is notarget_filter_yolotable either (the Bubble filter usestarget_filter_bubble).TF_YOLO_FILTERcase inmojoKernelis still empty.Generated with Claude Code
https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
- kernelEventFilterYOLO.h: * Darknet V3+ (hank-ai) declares load_network(), load_network_custom() and free_network_ptr() only when DARKNET_INCLUDE_ORIGINAL_API is defined before darknet.h ("was not declared in this scope"): define it. * Darknet installs the header as <prefix>/include/darknet.h, not darknet/darknet.h: include <darknet.h>, fall back to <darknet/darknet.h>, clear #error if neither exists. * m_pNET was DarknetNetworkPtr * (void **) although DarknetNetworkPtr is already void *: "invalid conversion from void* to void**". - makefile / la_mojo.vpj: -ldarknet was only linked in Release86; the build script uses Debug86. Added to Debug86 and Debug (the .vpj too, so a SlickEdit regeneration keeps it). - kernelEventFilterYOLO::initFilter(): load the settings first (validate()); m_sYOLOFilterData was still zero, so fileExist("") made initFilter() always fail. Logs why it fails, frees a previously loaded network, logs the network dimensions. Destructor stops the thread before freeing the network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN163b9a5fa839.