Giter VIP home page Giter VIP logo

darkhelp's People

Contributors

erikreed avatar olokos avatar pndspirit avatar s95huang avatar stephanecharette avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

darkhelp's Issues

-> WARNING: signal handler called for signal #11

I followed the instructions of building Darkhelp, running Darkhelp from terminal or from the example when it reaches
DarkHelp::NN::predict(), gives segmentation fault:
DarkHelp cfg/coco.names cfg/yolov4-tiny.cfg yolov4-tiny.weights artwork/dog.jpg

-> WARNING: signal handler called for signal #11

however darknet works correctly.

-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Building ver: 1.5.12-3
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
CMake Warning (dev) at /usr/local/lib/cmake/opencv4/OpenCVConfig.cmake:86 (find_package):
Policy CMP0146 is not set: The FindCUDA module is removed. Run "cmake
--help-policy CMP0146" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

Call Stack (most recent call first):
/usr/local/lib/cmake/opencv4/OpenCVConfig.cmake:108 (find_host_package)
CM_dependencies.cmake:14 (FIND_PACKAGE)
CMakeLists.txt:18 (INCLUDE)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found CUDA: /usr/local/cuda-12.3 (found suitable exact version "12.3")
-- Found OpenCV: /usr/local (found version "4.8.1")
-- Configuring done (0.6s)
-- Generating done (0.0s)
-- Build files have been written to: /home/khalid/global_ws/DarkHelp/build

Compiling on Rocky Linux

I'm having trouble installing on Rocky Linux (basically CentOS 8). I've installed darknet following your instructions and it's working.

CUDA-version: 11060 (11060), cuDNN: 8.4.0, CUDNN_HALF=1, GPU count: 1  
 CUDNN_HALF=1 
 OpenCV version: 3.4.6

When I try to make DarkMark I get the following issue.

# cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 8.5.0
-- The CXX compiler identification is GNU 8.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Building ver: 1.4.16-1
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (found
  suitable exact version "11.6")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindCUDA.cmake:1264 (find_package_handle_standard_args)
  /usr/local/lib64/cmake/opencv4/OpenCVConfig.cmake:86 (find_package)
  /usr/local/lib64/cmake/opencv4/OpenCVConfig.cmake:108 (find_host_package)
  CM_dependencies.cmake:7 (FIND_PACKAGE)
  CMakeLists.txt:18 (INCLUDE)


-- Configuring incomplete, errors occurred!

CMakeError.log
CMakeOutput.log

Seems to have something to with with pthreads. I have libpthread installed and create seems to be available.

# nm /lib64/libpthread.so.0 | grep "pthread_create"
00000000000093d4 t .annobin___pthread_create_2_1.end
0000000000008458 t .annobin___pthread_create_2_1.start
0000000000006ed0 t .annobin_pthread_create.c
00000000000093d4 t .annobin_pthread_create.c_end
000000000000683c t .annobin_pthread_create.c_end.exit
000000000000683c t .annobin_pthread_create.c_end.hot
000000000000683c t .annobin_pthread_create.c_end.startup
000000000000683c t .annobin_pthread_create.c_end.unlikely
000000000000683c t .annobin_pthread_create.c.exit
000000000000683c t .annobin_pthread_create.c.hot
000000000000683c t .annobin_pthread_create.c.startup
0000000000006820 t .annobin_pthread_create.c.unlikely
0000000000008460 t __pthread_create_2_1
000000000000682e t __pthread_create_2_1.cold.12
0000000000008460 T pthread_create@@GLIBC_2.2.5

Any help would be very appreciated. I'm trying to get DarkMark installed and from the video it looks amazing!

Thanks!

cannot open source file "DarkHelp.hpp"

I did all steps from readme_windows.txt, generated a Visual Studio solution, but when I build it I see this:

cannot open source file "DarkHelp.hpp" D:\Projects\DarkHelp\src-lib\DarkHelpConfig.cpp

image

How to fix it?

an classification problem

in AlexeyAB darknet, softmax_layer.c has two layers, softmax_layer and contrastive _layer.
my problem is "how to use contrastive layer in classification?"
if you known. can offer an example cfg file?
thanks

Issue with Inference - Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

I'm running DarkHelp in a C++ application (Through CLion). I am able to conduct detection through video capture but when I attempt to run inference as I get the following error message:

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

Code:

DarkHelp::Config cfg(config_file, weights_file, names_file );
cfg.enable_tiles = true;
cfg.combine_tile_predictions = true;
cfg.annotation_auto_hide_labels = false;
cfg.annotation_include_duration = true;
cfg.annotation_include_timestamp = false;

DarkHelp::NN nn(cfg)

const auto result = nn.predict(filename);
cv::Mat output = nn.annotate()

I'm using coco names and config file with pretrained YOLOv4 weights.

Any idea what could be causing the issue?

Thanks in advance.

DarkHelp make Error

(base) [anpr@ns build]$ make -j8
[ 25%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelp.cpp.o
[ 50%] Linking CXX static library libdarkhelp.a
[ 50%] Built target dh
[ 75%] Building CXX object src-tool/CMakeFiles/cli.dir/main.cpp.o
/home/anpr/DarkHelp/src-tool/main.cpp: In function ‘void show_help_window()’:
/home/anpr/DarkHelp/src-tool/main.cpp:205:25: error: loop variable ‘iter’ creates a copy from type ‘const std::pair<const std::__cxx11::basic_string, std::__cxx11::basic_string >’ [-Werror=range-loop-construct]
205 | for (const auto iter : help)
| ^~~~
/home/anpr/DarkHelp/src-tool/main.cpp:205:25: note: use reference type to prevent copying
205 | for (const auto iter : help)
| ^~~~
| &
cc1plus: all warnings being treated as errors
make[2]: *** [src-tool/CMakeFiles/cli.dir/build.make:76: src-tool/CMakeFiles/cli.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:160: src-tool/CMakeFiles/cli.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

json output with detection for video inference

Hi, first of all thanks for your great work!

I realised that the output.json does not contain detection when running inference on a video. Is that correct? Is there another way to get the detections for each frame?

DarkHelp Crashes when using Single Channel Networks and OpenCV

When using DarkHelp to load a yolov4-tiny single channel network (grayscale images), and configuring it to use OPENCV as a backend, the program crashes. This can fixed be setting the initial dummy matrix sent to the OpenCV constructor with the appropriate matrix type of CV_8UC1, as shown:

image

Rather than hardcoding, I think it would be best to read the darknet .cfg file to get the number of channels in the network, and use that value to set the matrix type appropriately, similar to what is done immediately above this section of code with regards to the network dimensions.

Both DarkMark and DarkHelp are excellent!

Error during cmake

Console output

-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Building ver: 1.1.14-4
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenCV: /usr (found version "4.2.0") 
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
TCLAP_INCLUDE_DIRS
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-lib
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-lib
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-lib
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-lib
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-lib
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-lib
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-lib
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-lib
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-lib
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-tool
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-tool
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-tool
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-tool
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-tool
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-tool
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-tool
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-tool
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-tool
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-doc
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-doc
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-doc
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-doc
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-doc
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-doc
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-doc
   used as include directory in directory /home/spasz/python/pyAITracker/tools/DarkHelp/src-doc

CMake Error in src-lib/CMakeLists.txt:
  Found relative path while evaluating include directories of "dh":

    "TCLAP_INCLUDE_DIRS-NOTFOUND"



CMake Error in src-tool/CMakeLists.txt:
  Found relative path while evaluating include directories of "cli":

    "TCLAP_INCLUDE_DIRS-NOTFOUND"



-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Onnx

Is there any way to perform tiling while doing ONNX inference?

yolov7

Hi, @stephanecharette

I am new to darknet and impressed by your c++ DarkHelp very good coverage.

We are using AI for detecting vehicles from intersections . currently using yolov7 and fairy good enough . We want to give a shot and possibly change to c++ . can we use yolov7 models with darknet. ? If now which model you suggest for replacing yolov7e6 ?

We also want to detect small vehicles from 4Mp resolution . tiling looks very good solution for that. detecting and tracking (bytetrack at the moment)

When tiling we are inferencing more than one image per image. so it make slower . However can we doing inference simultaneously (batch) for tiled version ?

make error in Linux

Building ver: 1.3.11-1
-- Configuring done
-- Generating done
-- Build files have been written to: /share_data/YuhaoSun/DarkHelp-master/build
(yolox) root@test:/share_data/YuhaoSun/DarkHelp-master/build# make
Scanning dependencies of target dh
[ 16%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelp.cpp.o
[ 33%] Linking CXX static library libdarkhelp.a
[ 33%] Built target dh
Scanning dependencies of target cli
[ 50%] Building CXX object src-tool/CMakeFiles/cli.dir/DarkHelpCli.cpp.o
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:131:35: error: use of deleted function ‘std::atomic<bool>::atomic(const std::atomic<bool>&)’
 std::atomic<bool> signal_raised = false;
                                   ^
In file included from /share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:10:0:
/usr/include/c++/5/atomic:66:5: note: declared here
     atomic(const atomic&) = delete;
     ^
/usr/include/c++/5/atomic:70:15: note:   after user-defined conversion: constexpr std::atomic<bool>::atomic(bool)
     constexpr atomic(bool __i) noexcept : _M_base(__i) { }
               ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In function ‘void show_help_window()’:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:20: error: expected unqualified-id before ‘[’ token
  for (const auto & [key, val] : help)
                    ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:20: error: expected ‘;’ before ‘[’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:21: error: ‘key’ was not declared in this scope
  for (const auto & [key, val] : help)
                     ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:26: error: ‘val’ was not declared in this scope
  for (const auto & [key, val] : help)
                          ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In lambda function:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:31: error: expected ‘{’ before ‘:’ token
  for (const auto & [key, val] : help)
                               ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In function ‘void show_help_window()’:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:31: error: expected ‘;’ before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:31: error: expected primary-expression before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:31: error: expected ‘)’ before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:220:31: error: expected primary-expression before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:215:13: error: unused variable ‘font_face’ [-Werror=unused-variable]
  const auto font_face  = cv::HersheyFonts::FONT_HERSHEY_SIMPLEX;
             ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:216:13: error: unused variable ‘font_scale’ [-Werror=unused-variable]
  const auto font_scale  = 0.5;
             ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:217:13: error: unused variable ‘font_thickness’ [-Werror=unused-variable]
  const auto font_thickness = 1;
             ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:219:6: error: unused variable ‘y’ [-Werror=unused-variable]
  int y = 25;
      ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In function ‘void init(Options&, int, char**)’:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:21: error: expected unqualified-id before ‘[’ token
   for (const auto & [key, val] : debug_messages)
                     ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:21: error: expected ‘;’ before ‘[’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:22: error: ‘key’ was not declared in this scope
   for (const auto & [key, val] : debug_messages)
                      ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:27: error: ‘val’ was not declared in this scope
   for (const auto & [key, val] : debug_messages)
                           ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In lambda function:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:32: error: expected ‘{’ before ‘:’ token
   for (const auto & [key, val] : debug_messages)
                                ^
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp: In function ‘void init(Options&, int, char**)’:
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:32: error: expected ‘;’ before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:32: error: expected primary-expression before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:32: error: expected ‘)’ before ‘:’ token
/share_data/YuhaoSun/DarkHelp-master/src-tool/DarkHelpCli.cpp:571:32: error: expected primary-expression before ‘:’ token
cc1plus: all warnings being treated as errors
src-tool/CMakeFiles/cli.dir/build.make:82: recipe for target 'src-tool/CMakeFiles/cli.dir/DarkHelpCli.cpp.o' failed
make[2]: *** [src-tool/CMakeFiles/cli.dir/DarkHelpCli.cpp.o] Error 1
CMakeFiles/Makefile2:184: recipe for target 'src-tool/CMakeFiles/cli.dir/all' failed
make[1]: *** [src-tool/CMakeFiles/cli.dir/all] Error 2
Makefile:171: recipe for target 'all' failed
make: *** [all] Error 2

'undefined reference to function' after -static compilation using make for DarkHelp project

OS: Ubuntu 18.04 LTS

Built DarkNet succesfully and can be used with './darknet'

Built DarkHelp using this and compiled 'example_project'.

I am trying to build a standalone executable "exe_static" to be used on linux systems, where I might not have the privileges to install dependencies.

Copied DarkHelp/build/src-lib/libdarkhelp.a and libdarknet.a to /usr/lib/

exe_static.cpp

#include <DarkHelp.hpp>
#include <typeinfo>


int main(int argc, char *argv[])
{
	DarkHelp::Config cfg("model.cfg", "model.weights", "names.list");
	cfg.enable_tiles			= true;
	cfg.combine_tile_predictions		= true;
	cfg.annotation_auto_hide_labels		= false;
	cfg.annotation_include_duration		= false;
	cfg.annotation_include_timestamp	= false;

	DarkHelp::NN nn(cfg);
	const auto results = nn.predict(argv[1]);

//        std::cout <<"Shape of result = : " << results.size() << "\n";

	return 0;
}

CMakeLists.txt

CMAKE_MINIMUM_REQUIRED (VERSION 3.0)

PROJECT (ExampleProject C CXX)

SET (CMAKE_BUILD_TYPE Release)
SET (CMAKE_CXX_STANDARD 17)
SET (CMAKE_CXX_STANDARD_REQUIRED ON)

ADD_DEFINITIONS ("-Wall -Wextra -Werror -Wno-unused-parameter ")

FIND_PACKAGE (Threads	REQUIRED)
FIND_PACKAGE (OpenCV	REQUIRED)
#FIND_LIBRARY (DARKHELP	libdarkhelp.a)
#FIND_LIBRARY (DARKNET	libdarknet.a)

INCLUDE_DIRECTORIES (${OpenCV_INCLUDE_DIRS})

FILE (GLOB SOURCE *.cpp)
LIST (SORT SOURCE)

SET (BUILD_SHARED_LIBS=OFF)
SET (OPENCV_GENERATE_PKGCONFIG=YES)


ADD_EXECUTABLE (exe_static ${SOURCE})

SET_TARGET_PROPERTIES(exe_static PROPERTIES 
   LINK_SEARCH_START_STATIC ON
   LINK_SEARCH_END_STATIC ON
)

set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")

set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")

#TARGET_LINK_LIBRARIES (exe_static Threads::Threads ${DARKHELP} ${DARKNET} ${OpenCV_LIBS})
TARGET_LINK_LIBRARIES (exe_static Threads::Threads libdarknet.a libdarkhelp.a  ${OpenCV_LIBS} )

Same file structure as DarkHelp/example_project

$> cd build
$> cmake ..

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenCV: /usr/local (found version "3.4.4") 
-- Configuring done
-- Generating done
-- Build files have been written to: /path/to/exe_static/build

$> make

Scanning dependencies of target exe_static
[ 50%] Building CXX object CMakeFiles/exe_static.dir/exe_static.cpp.o
[100%] Linking CXX executable exe_static
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libdarkhelp.a(DarkHelpNN.cpp.o): In function `DarkHelp::NN::reset()':
DarkHelpNN.cpp:(.text+0x1ff8): undefined reference to `free_network'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libdarkhelp.a(DarkHelpNN.cpp.o): In function `DarkHelp::NN::predict_internal_darknet()':
DarkHelpNN.cpp:(.text+0x45ca): undefined reference to `make_image'
DarkHelpNN.cpp:(.text+0x4715): undefined reference to `network_predict'
DarkHelpNN.cpp:(.text+0x4761): undefined reference to `get_network_boxes'
DarkHelpNN.cpp:(.text+0x4b7e): undefined reference to `free_detections'
DarkHelpNN.cpp:(.text+0x4ba7): undefined reference to `free_image'
DarkHelpNN.cpp:(.text+0x5190): undefined reference to `do_nms_sort'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libdarkhelp.a(DarkHelpNN.cpp.o): In function `DarkHelp::NN::init()':
DarkHelpNN.cpp:(.text+0xaa81): undefined reference to `load_network_custom'
DarkHelpNN.cpp:(.text+0xaaa7): undefined reference to `calculate_binary_weights'
collect2: error: ld returned 1 exit status
CMakeFiles/exe_static.dir/build.make:139: recipe for target 'exe_static' failed
make[2]: *** [exe_static] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/exe_static.dir/all' failed
make[1]: *** [CMakeFiles/exe_static.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2


error Building DarkHelp (Windows)

Building Darknet Commands all worked fine.
on the Building DarkHelp (Windows) last command

LINK : fatal error LNK1181: cannot open input file 'opencv_aruco.lib' [D:\AI\DarkSrc\darkhelp\build\src-tool\cli
.vcxproj]

I uploaded a screenshot of the error ad of the file that's in the error

any ideas where this file is located or why do I get this?

err
Screenshot 2021-09-10 233944

std namespace errors while compiling using cmake

I am building a cross-compilation platform using OpenCV 3.4.4, darknet (and its dependencies) and DarkHelp.

DarkHelp dependencies such as magic, tclap etc have been cross-compiled successfully along with OpenCV and darknet. I have tested it on my RPi, the darknet libs and exe works.

When I try to compile Darkhelp,

cmake -DOpenCV_DIR="${RPI_SYSROOT}/usr/local/lib" -DCMAKE_PREFIX_PATH="${RPI_SYSROOT}/usr/local" ..


-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Building ver: 1.4.18-1
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenCV: /home/develop/RPi-sysroot/usr/local (found version "3.4.4") 
-- Configuring done
-- Generating done
-- Build files have been written to: 

make -j4


[ 11%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelpConfig.cpp.o
In file included from /usr/include/c++/7/ext/string_conversions.h:41:0,
                 from /usr/include/c++/7/bits/basic_string.h:6361,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/stl_map.h:63,
                 from /usr/include/c++/7/map:61,
                 from /home/develop/test_darknet/DarkHelp/src-lib/DarkHelp.hpp:9,
                 from /home/develop/test_darknet/DarkHelp/src-lib/DarkHelpConfig.cpp:6:
/usr/include/c++/7/cstdlib:144:11: error: '::calloc' has not been declared
   using ::calloc;
           ^~~~~~
/usr/include/c++/7/cstdlib:147:11: error: '::free' has not been declared
   using ::free;
           ^~~~
/usr/include/c++/7/cstdlib:151:11: error: '::malloc' has not been declared
   using ::malloc;
           ^~~~~~

This is a short part of the error. All the calls to std:: are reported.

While searching for a solution, I found this post

It seems some include<> are done within the namespace{} as I came across multiple forum posts. Let me know if any more information is required to find a solution.

Build error - Jetson AGX

Dear Stephan,
Outstanding work on DarkHelp, and DarkMark!
I've tried to install them on Jetson AGX and i reived the following problem. (Darknet have been installed with Libso and arch=compute_72

I have NVIDIA JetPack installed as my Linux with all standard things coming with it.

Thank you for your support and help!

error on make:
agx-dev-1@agxdev1-desktop:~/developer/darknet/DarkHelp/built$ make
[ 16%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelp.cpp.o
/home/agx-dev-1/developer/darknet/DarkHelp/src-lib/DarkHelp.cpp: In member function ‘virtual DarkHelp& DarkHelp::init(const string&, const string&, const string&, bool, DarkHelp::EDriver)’:
/home/agx-dev-1/developer/darknet/DarkHelp/src-lib/DarkHelp.cpp:169:44: error: ‘DNN_BACKEND_CUDA’ is not a member of ‘cv::dnn’
opencv_net.setPreferableBackend(cv::dnn::DNN_BACKEND_CUDA);
^~~~~~~~~~~~~~~~
/home/agx-dev-1/developer/darknet/DarkHelp/src-lib/DarkHelp.cpp:170:43: error: ‘DNN_TARGET_CUDA’ is not a member of ‘cv::dnn’
opencv_net.setPreferableTarget(cv::dnn::DNN_TARGET_CUDA);
^~~~~~~~~~~~~~~
src-lib/CMakeFiles/dh.dir/build.make:62: recipe for target 'src-lib/CMakeFiles/dh.dir/DarkHelp.cpp.o' failed
make[2]: *** [src-lib/CMakeFiles/dh.dir/DarkHelp.cpp.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'src-lib/CMakeFiles/dh.dir/all' failed
make[1]: *** [src-lib/CMakeFiles/dh.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

Before the error the cmake made this:
agx-dev-1@agxdev1-desktop:~/developer/DarkHelp/build$ cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Building ver: 1.3.6-1
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OpenCV: /usr (found version "4.1.1")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/agx-dev-1/developer/DarkHelp/build

DarkHelp Compile error mac os x

Hi I have below strange error when compiling darknet.

cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Building ver: 1.4.27-1
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found OpenCV: /usr/local (found version "3.4.8")
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Magic
linked by target "cli" in directory /Users/tulpar/Project/DarkHelp/src-tool
linked by target "server" in directory /Users/tulpar/Project/DarkHelp/src-tool

-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
╭─[email protected] ~/Project/DarkHelp/build ‹master›
╰─➤ make -j4 1 ↵
[ 44%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelpNN.cpp.o
[ 44%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelpUtils.cpp.o
[ 44%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelpConfig.cpp.o
[ 44%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelpPredictionResult.cpp.o
/Users/tulpar/Project/DarkHelp/src-lib/DarkHelpNN.cpp:821:23: error: unused function 'convert_darknet_image_to_opencv_mat' [-Werror,-Wunused-function]
static inline cv::Mat convert_darknet_image_to_opencv_mat(const image img)
^
1 error generated.
make[2]: *** [src-lib/CMakeFiles/dh.dir/DarkHelpNN.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src-lib/CMakeFiles/dh.dir/all] Error 2
make: *** [all] Error 2

Installing DarkHelp on Docker in Mac Mini M1.

My goal is to install DarkMark. The problem is that I can't install DarkHelp.

What I've did:

  1. Install Darknet
docker pull ubuntu:18.04
docker run -ti --name darkmark ubuntu:18.04 /bin/bash
apt-get update
apt-get install build-essential git libopencv-dev
mkdir ~/src
git clone https://github.com/AlexeyAB/darknet.git
cd darknet

# set LIBSO=1
apt-get install vim
vim Makefile

make
cp libdarknet.so /usr/local/lib/
cp include/darknet.h /usr/local/include/
ldconfig
  1. Install DarkHelp
apt-get install cmake build-essential libtclap-dev libmagic-dev libopencv-dev
cd ~/src
git clone https://github.com/stephanecharette/DarkHelp.git
cd DarkHelp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

The error

In file included from /DarkHelp/src-lib/DarkHelp.hpp:122:0,
                 from /DarkHelp/src-lib/DarkHelpConfig.cpp:6:
/DarkHelp/src-lib/DarkHelpPredictionResult.hpp: In member function 'bool DarkHelp::PredictionResult::empty() const':
/DarkHelp/src-lib/DarkHelpPredictionResult.hpp:43:16: error: 'const Rect {aka const class cv::Rect_<int>}' has no member named 'empty'
    return rect.empty() or all_probabilities.empty() or original_size.area() == 0.0f;
                ^~~~~
src-lib/CMakeFiles/dh.dir/build.make:62: recipe for target 'src-lib/CMakeFiles/dh.dir/DarkHelpConfig.cpp.o' failed
make[2]: *** [src-lib/CMakeFiles/dh.dir/DarkHelpConfig.cpp.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'src-lib/CMakeFiles/dh.dir/all' failed
make[1]: *** [src-lib/CMakeFiles/dh.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

Gtk-ERROR **

I have a problem. When using DarkHelp (example_project).

(example:14081): Gtk-ERROR **: 12:27:51.323: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

Can you support for resolving it?

CMAKE build issue Windows Server: Cant find FindCUDNN.cmake CUDNNconfig.cmake CUDNN_config.cmake

Trying to install DarkHelp on Windows Server 2019 with GeForce Ge 1660. Have installed OpenCV with DNN , Installed DarkNet as per the Darknet instructions.
All Path variables have been updated ,including for CUDNN and CUDNN_PATH and server restarted.
OpenCV was built from source with DNN.
Darknet is running correctly from the CLI

Now trying to install DarkHelp as per the sequence in readme_windows.txt.

When running:
cmake -DCMAKE_BUILD_TYPE=Release - DCMAKE_TOOLCHAIN_FILE=C:/src/vcpkg/scripts/buildsystems/vcpkg.cmake ..

using the command as above as well as when replicating via CMAKE GUI I get the following error:

CMake Error at C:/src/vcpkg/scripts/buildsystems/vcpkg.cmake:829 (_find_package):
By not providing "FindCUDNN.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "CUDNN", but
CMake did not find one.

Could not find a package configuration file provided by "CUDNN" with any of
the following names:

CUDNNConfig.cmake
cudnn-config.cmake

Add the installation prefix of "CUDNN" to CMAKE_PREFIX_PATH or set
"CUDNN_DIR" to a directory containing one of the above files. If "CUDNN"
provides a separate development package or SDK, be sure it has been
installed.

I located the FindCUDNN.cmake file is in several directories: Opencv/cmake darknet/share/, darknet/cmake/modules, vcpkg/ports/
Any idea how to update the configuration to point towards the correct file?
Thanks in advance

Unused Function Error on ARM64 Ubuntu 18.04

Self solved, leaving this here to save time for any others who encounter this. I encountered this error while following the install:

/src/DarkHelp/src-lib/DarkHelp.cpp:729:23: error: unused function
'convert_darknet_image_to_opencv_mat' [-Werror,-Wunused-function]
static inline cv::Mat convert_darknet_image_to_opencv_mat(const image img)
^
1 error generated.
src-lib/CMakeFiles/dh.dir/build.make:75: recipe for target 'src-lib/CMakeFiles/dh.dir/DarkHelp.cpp.o' failed

This error was solved by editing CM_definitions.cmake , changing the line in ELSE() to
ADD_COMPILE_OPTIONS (-Wextra -Wno-unused-parameter )

Additionally, I got an error for sudo dpkg -i darkmark*.deb
[sudo] password for USER:
dpkg: error: cannot access archive 'darkmark*.deb': No such file or directory

which was solved by replacing the file darkmark*.deb with the full filename

Implement tkDNN?

Do you believe it would be viable to implement tkDNN into DarkHelp as an option?

Run on Python

Hi, this work is very great and I would just like to ask if there might be a possible where it can also be ran natively in Python in the future? Thank you so much.

Cannot build on W10

I've tried to build the project but the follow error occurred when I run msbuild.exe /property:Platform=x64;Configuration=Release /target:Build -maxCpuCount -verbosity:normal -detailedSummary DarkHelp.sln.

FALHA da compilação.

       "c:\dev\DarkHelp\build\DarkHelp.sln" (Build destino) (1) ->
       "c:\dev\DarkHelp\build\ALL_BUILD.vcxproj.metaproj" (destino padrão) (2) ->
       "c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj.metaproj" (destino padrão) (10) ->
       "c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj" (destino padrão) (18) ->
       (ClCompile destino) ->
         C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): warning C4244: 'initializing': conversion from '_Tp' to 'float', possible loss of data [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): warning C4244:         with [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): warning C4244:         [ [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): warning C4244:             _Tp=int [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): warning C4244:         ] [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
         C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,25): warning C4244: 'initializing': conversion from '_Tp' to 'const float', possible loss of data [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,25): warning C4244:         with [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,25): warning C4244:         [ [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,25): warning C4244:             _Tp=int [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,25): warning C4244:         ] [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
         C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,43): warning C4244: 'initializing': conversion from '_Tp' to 'float', possible loss of data [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,43): warning C4244:         with [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,43): warning C4244:         [ [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,43): warning C4244:             _Tp=int [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,43): warning C4244:         ] [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
         C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,25): warning C4244: 'initializing': conversion from '_Tp' to 'const float', possible loss of data [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,25): warning C4244:         with [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,25): warning C4244:         [ [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,25): warning C4244:             _Tp=int [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
       C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,25): warning C4244:         ] [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]


       "c:\dev\DarkHelp\build\DarkHelp.sln" (Build destino) (1) ->
       "c:\dev\DarkHelp\build\ALL_BUILD.vcxproj.metaproj" (destino padrão) (2) ->
       "c:\dev\DarkHelp\build\src-apps\save_webcam_to_video.vcxproj.metaproj" (destino padrão) (11) ->
       "c:\dev\DarkHelp\build\src-apps\save_webcam_to_video.vcxproj" (destino padrão) (17) ->
         C:\dev\DarkHelp\src-apps\save_webcam_to_video.cpp(52,46): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data [c:\dev\DarkHelp\build\src-apps\save_webcam_to_video.vcxproj]
         C:\dev\DarkHelp\src-apps\save_webcam_to_video.cpp(52,34): warning C4244: 'initializing': conversion from 'double' to 'const int', possible loss of data [c:\dev\DarkHelp\build\src-apps\save_webcam_to_video.vcxproj]


       "c:\dev\DarkHelp\build\DarkHelp.sln" (Build destino) (1) ->
       "c:\dev\DarkHelp\build\ALL_BUILD.vcxproj.metaproj" (destino padrão) (2) ->
       "c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj.metaproj" (destino padrão) (10) ->
       "c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj" (destino padrão) (18) ->
       (ClCompile destino) ->
         C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): error C2220: the following warning is treated as an error [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
         C:\dev\DarkHelp\src-apps\rotate_images.cpp(107,46): error C2065: 'M_PI': undeclared identifier [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]
         C:\dev\DarkHelp\src-apps\rotate_images.cpp(107,17): error C2737: 'degrees': const object must be initialized [c:\dev\DarkHelp\build\src-apps\rotate_images.vcxproj]


       "c:\dev\DarkHelp\build\DarkHelp.sln" (Build destino) (1) ->
       "c:\dev\DarkHelp\build\ALL_BUILD.vcxproj.metaproj" (destino padrão) (2) ->
       "c:\dev\DarkHelp\build\src-apps\save_webcam_to_video.vcxproj.metaproj" (destino padrão) (11) ->
       "c:\dev\DarkHelp\build\src-apps\save_webcam_to_video.vcxproj" (destino padrão) (17) ->
         C:\dev\DarkHelp\src-apps\save_webcam_to_video.cpp(52,46): error C2220: the following warning is treated as an error [c:\dev\DarkHelp\build\src-apps\save_webcam_to_video.vcxproj]

    6 Aviso(s)
    4 Erro(s)

So I tried to open the solution on VisualStudio2022 and build but they give me the same errors

Build started at 17:33...
1>------ Build started: Project: save_webcam_to_video, Configuration: Release x64 ------
2>------ Build started: Project: rotate_images, Configuration: Release x64 ------
1>save_webcam_to_video.cpp
2>rotate_images.cpp
1>C:\dev\DarkHelp\src-apps\save_webcam_to_video.cpp(52,46): error C2220: the following warning is treated as an error
1>C:\dev\DarkHelp\src-apps\save_webcam_to_video.cpp(52,46): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
1>C:\dev\DarkHelp\src-apps\save_webcam_to_video.cpp(52,34): warning C4244: 'initializing': conversion from 'double' to 'const int', possible loss of data
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): error C2220: the following warning is treated as an error
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): warning C4244: 'initializing': conversion from '_Tp' to 'float', possible loss of data
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): warning C4244:         with
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): warning C4244:         [
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): warning C4244:             _Tp=int
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,44): warning C4244:         ]
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,25): warning C4244: 'initializing': conversion from '_Tp' to 'const float', possible loss of data
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,25): warning C4244:         with
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,25): warning C4244:         [
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,25): warning C4244:             _Tp=int
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(104,25): warning C4244:         ]
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,43): warning C4244: 'initializing': conversion from '_Tp' to 'float', possible loss of data
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,43): warning C4244:         with
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,43): warning C4244:         [
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,43): warning C4244:             _Tp=int
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,43): warning C4244:         ]
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,25): warning C4244: 'initializing': conversion from '_Tp' to 'const float', possible loss of data
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,25): warning C4244:         with
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,25): warning C4244:         [
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,25): warning C4244:             _Tp=int
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(105,25): warning C4244:         ]
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(107,46): error C2065: 'M_PI': undeclared identifier
2>C:\dev\DarkHelp\src-apps\rotate_images.cpp(107,17): error C2737: 'degrees': const object must be initialized
2>Done building project "rotate_images.vcxproj" -- FAILED.
1>Done building project "save_webcam_to_video.vcxproj" -- FAILED.
3>------ Skipped Build: Project: PACKAGE, Configuration: Release x64 ------
3>Project not selected to build for this solution configuration 
4>------ Skipped Build: Project: INSTALL, Configuration: Release x64 ------
4>Project not selected to build for this solution configuration 
========== Build: 0 succeeded, 2 failed, 10 up-to-date, 2 skipped ==========
========== Build completed at 17:33 and took 02,967 seconds ==========

JSON exporting available?

Is there any option to export the detections as JSON file as in darknet output exporting. The results are printed on the command prompt.

Confused about resize aspect ratio training/inferencing

During training, using DarkMark/darknet CUDA on my linux box, I deselected 'resize images' because I didn't want the network to change the aspect ratio of images.... many are smaller than my network dimensions.

Typical small training images: 96 x 32
Network dimensions: 192 x 96 x 1
Network: YoloV4-Tiny

As the training progresses, DarkMark seems to properly utilize darknet to predict annotations on unmarked images. So all is good up to this point.

When I run inferencing on my Windows box, (using darkhelp API, directly with OpenCV/Cuda), I notice that the NN performs very poorly. Digging in, I see that the function DarkHelp::NN::predict_internal_opencv() calls the function fast_resize_ignore_aspect_ratio. If I change that to resize_keeping_aspect_ratio, then the network performs properly. Shouldn't the prediction function maintain the aspect ratio?

image

Compilation error on Raspberry Pi 4 / CM4 : cannot convert ‘const long long int*’ to ‘const time_t*’ {aka ‘const long int*’}

I stumbled on this compilation fatal error (output.txt) while trying to compile Darkhelp on Compute Module 4 (armv7l Raspbian).
This error occurred in 2 files : first in DarkHelpServer.cpp and secondly in DarkHelpCli.cpp

I bypassed this error by editing line 230 in DarkHelpServer.cpp and line 1046 in DarkHelpCli.cpp

const auto lt = std::localtime(&seconds);

const auto lt = std::localtime(&seconds);

I wrote in both files:

std::time_t t = seconds;
const auto lt = std::localtime(&t);

Can you check if my update is correct and update these two files if it complies with your code ?

Thank you in advance.

PS : Thank you for your job done on this project, it's incredible how it's easy to use darknet with your help.

Hide label in annotation

Hi,

I use DarkHelp version: 1.4.15-1.
The commit is : 2c0fdbb

I want image detection results without labels and percentages. I read Darkhelp's parameters to do that (https://www.ccoderun.ca/darkhelp/api/Parameters.html). I see there are 2 parameters -o and -p. When I use them, only the -p parameter works. I read that auto hide label available since 2020-07-03 (https://www.ccoderun.ca/darkhelp/api/classDarkHelp_1_1Config.html#a3086f69df165e7be96cd909682b44c54)

This is my command:

Darkhelp config_path weight_path names_path -f 2 --threshold 0.5 -k -l /opt/image_list.txt --outdir /opt/results -Y jpg -j -o true -p false >/opt/abc.log

I also tried –autohide instead of -o . Tried all the true,false,on,off,1,0 but they don't work

image

You can see that percentage is disappear but the label still there.

I wonder if I am using it incorrectly? Is there any way to hide the label?

Regards,
An

Error in make project

I am trying to compile the project but has the following error occurred:

`[ 25%] Building CXX object src-lib/CMakeFiles/dh.dir/DarkHelp.cpp.o
In file included from /opt/DarkHelp/src-lib/DarkHelp.cpp:6:0:
/opt/DarkHelp/src-lib/DarkHelp.hpp:559:7: error: âHersheyFontsâ in namespace âcvâ does not name a type
cv::HersheyFonts annotation_font_face;
^~~~~~~~~~~~

/opt/DarkHelp/src-lib/DarkHelp.cpp: In member function âvirtual void DarkHelp::reset()â:
/opt/DarkHelp/src-lib/DarkHelp.cpp:201:2: error: âannotation_font_faceâ was not declared in this scope
annotation_font_face = cv::HersheyFonts::FONT_HERSHEY_SIMPLEX;
^~~~~~~~~~~~~~~~~~~~

/opt/DarkHelp/src-lib/DarkHelp.cpp:201:32: error: âcv::HersheyFontsâ has not been declared
annotation_font_face = cv::HersheyFonts::FONT_HERSHEY_SIMPLEX;
^~~~~~~~~~~~

/opt/DarkHelp/src-lib/DarkHelp.cpp: In member function âvirtual DarkHelp::PredictionResults DarkHelp::predict_tile(cv::Mat, float)â:
/opt/DarkHelp/src-lib/DarkHelp.cpp:361:31: error: âcv::HersheyFontsâ has not been declared
const auto font = cv::HersheyFonts::FONT_HERSHEY_PLAIN;
^~~~~~~~~~~~

/opt/DarkHelp/src-lib/DarkHelp.cpp:376:54: error: âFILLEDâ is not a member of âcvâ
cv::rectangle(mat, label_rect, {255, 255, 255}, cv::FILLED, cv::LINE_AA);
^~

/opt/DarkHelp/src-lib/DarkHelp.cpp:376:66: error: âLINE_AAâ is not a member of âcvâ
cv::rectangle(mat, label_rect, {255, 255, 255}, cv::FILLED, cv::LINE_AA);
^~

/opt/DarkHelp/src-lib/DarkHelp.cpp: In member function âvirtual cv::Mat DarkHelp::annotate(float)â:
/opt/DarkHelp/src-lib/DarkHelp.cpp:565:58: error: âannotation_font_faceâ was not declared in this scope
const cv::Size text_size = cv::getTextSize(pred.name, annotation_font_face, annotation_font_scale, annotation_font_thickness, &baseline);
^~~~~~~~~~~~~~~~~~~~

/opt/DarkHelp/src-lib/DarkHelp.cpp:594:51: error: âannotation_font_faceâ was not declared in this scope
const cv::Size text_size = cv::getTextSize(str, annotation_font_face, annotation_font_scale, annotation_font_thickness, nullptr);
^~~~~~~~~~~~~~~~~~~~

/opt/DarkHelp/src-lib/DarkHelp.cpp:607:57: error: âannotation_font_faceâ was not declared in this scope
const cv::Size text_size = cv::getTextSize(timestamp, annotation_font_face, annotation_font_scale, annotation_font_thickness, nullptr);
^~~~~~~~~~~~~~~~~~~~

/opt/DarkHelp/src-lib/DarkHelp.cpp: In member function âvirtual std::__cxx11::string DarkHelp::duration_string()â:
/opt/DarkHelp/src-lib/DarkHelp.cpp:700:13: error: âsetwâ is not a member of âstdâ
<< "." << std::setw(3) << std::setfill('0')
^~~
/opt/DarkHelp/src-lib/DarkHelp.cpp:700:29: error: âsetfillâ is not a member of âstdâ
<< "." << std::setw(3) << std::setfill('0')
^~~

src-lib/CMakeFiles/dh.dir/build.make:62: recipe for target 'src-lib/CMakeFiles/dh.dir/DarkHelp.cpp.o' failed
make[2]: *** [src-lib/CMakeFiles/dh.dir/DarkHelp.cpp.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'src-lib/CMakeFiles/dh.dir/all' failed
make[1]: *** [src-lib/CMakeFiles/dh.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
`
My libopencv-dev is 2.4.9.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.