|0.3.0||Jan 13, 2021|
|0.2.5||Sep 17, 2020|
|0.2.4||Jul 11, 2020|
|0.1.2||Mar 31, 2020|
66 downloads per month
Used in darknet
Main crate: darknet
Get the crate by adding the dependency to your
darknet-sys = "0.3"
If you clone the repository manually, run
git submodule init && git submodule update --recursive to get all submodules.
enable-cuda: Enable CUDA (expects CUDA 10.x and cuDNN 7.x).
enable-cudnn: Enable cuDNN
enable-opencv: Enable OpenCV.
runtime: Link to darknet dynamic library. For example,
dylib: Build dynamic library instead of static
buildtime-bindgen: Generate bindings from darknet headers.
By default, darknet-sys compiles and link to darknet statically. You can control the feature flags to change the behavior.
By default, it builds and links to darknet statically.
You can optionally enable CUDA and OpenCV features. Please read Build with CUDA section to work to CUDA properly.
cargo build --features enable-cuda,enable-opencv
If you prefer to build with your darknet source, fill the source directory to the
DARKNET_SRC environment variable. It expects a
CMakeLists.txt in that directory.
export DARKNET_SRC=/path/to/your/darknet/repo cargo build
runtime feature, darknet-sys will not compile the darknet source code and instead links to darknet dynamically. If you are using Linux, make sure
libdark.so is installed on your system.
cargo build --feature runtime
buildtime-bindgen feature, darknet-sys re-generates bindings from headers. It guesses the header file paths according to feature flags. The option is necessary only when darkent is updated or modified.
If you prefer to your (possibly modified) header files, fill the header directory to
DARKNET_INCLUDE_PATH environment variable.
Please check both CUDA 10.x and cuDNN 7.x are installed and versions are correct.
They are not installed to standard paths on most systems. Please add the CUDA library directory to
LIBRARY_PATH environment variable before building. For example on Ubuntu and CUDA 10.1,
env LIBRARY_PATH=/usr/local/cuda-10.1/lib64 cargo build --features enable-cuda
Huge thanks to jerry73204