diff --git a/CMakeLists.txt b/CMakeLists.txt index 5692979..b366416 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,9 @@ include_directories(${EIGEN3_INCLUDE_DIR}) find_package(OpenCV REQUIRED) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOPENCV") +# if(OpenCV_CUDA_VERSION) +# add_compile_definitions(OPENCV_CUDACONTRIB) +# endif() # gives problems in cross-compiling, probably malformed cmake config find_package(yaml-cpp REQUIRED) @@ -119,6 +122,14 @@ target_link_libraries(test_resnet101_cnet tkDNN) add_executable(test_dla34_cnet tests/centernet/dla34_cnet/dla34_cnet.cpp) target_link_libraries(test_dla34_cnet tkDNN) +add_executable(test_dla34_cnet3d tests/centernet/dla34_cnet3d/dla34_cnet3d.cpp) +target_link_libraries(test_dla34_cnet3d tkDNN) + +# CENTERTRACK + +add_executable(test_dla34_ctrack tests/centertrack/dla34_ctrack/dla34_ctrack.cpp) +target_link_libraries(test_dla34_ctrack tkDNN) + # SHELFNET add_executable(test_shelfnet tests/shelfnet/shelfnet.cpp) target_link_libraries(test_shelfnet tkDNN) @@ -139,6 +150,12 @@ target_link_libraries(map_demo tkDNN) add_executable(demo demo/demo/demo.cpp) target_link_libraries(demo tkDNN) +add_executable(demo3D demo/demo/demo3D.cpp) +target_link_libraries(demo3D tkDNN) + +add_executable(demoTracker demo/demo/demoTracker.cpp) +target_link_libraries(demoTracker tkDNN) + add_executable(seg_demo demo/demo/seg_demo.cpp) target_link_libraries(seg_demo tkDNN) diff --git a/README.md b/README.md index 7dcd080..b630fec 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ If you use tkDNN in your research, please cite the [following paper](https://iee ### What's new (20 July 2021) - [x] Support to sematic segmentation [README](docs/README_seg.md) +- [x] Support 2D/3D Object Detection and Tracking [README](docs/README_2d3dtracking.md) - [ ] Support to TensorRT8 (WIP) ## FPS Results @@ -70,32 +71,18 @@ Results for COCO val 2017 (5k images), on RTX 2080Ti, with conf threshold=0.001 - [tkDNN](#tkdnn) - [Index](#index) - [Dependencies](#dependencies) - - [About OpenCV](#about-opencv) - [How to compile this repo](#how-to-compile-this-repo) - [Workflow](#workflow) - - [How to export weights](#how-to-export-weights) - - [1)Export weights from darknet](#1export-weights-from-darknet) - - [2)Export weights for DLA34 and ResNet101](#2export-weights-for-dla34-and-resnet101) - - [3)Export weights for CenterNet](#3export-weights-for-centernet) - - [4)Export weights for MobileNetSSD](#4export-weights-for-mobilenetssd) - - [Run the demo](#run-the-demo) - - [FP16 inference](#fp16-inference) - - [INT8 inference](#int8-inference) - - [mAP demo](#map-demo) + - [Exporting weights](#exporting-weights) + - [Run the demos](#run-the-demos) + - [tkDNN on Windows 10 (experimental)](#tkdnn-on-windows-10-experimental) - [Existing tests and supported networks](#existing-tests-and-supported-networks) - [References](#references) - - [tkDNN on Windows 10 (experimental)](#tkdnn-on-windows-10-experimental) - - [Dependencies-Windows](#dependencies-windows) - - [Compiling tkDNN on Windows](#compiling-tkdnn-on-windows) - - [Run the demo on Windows](#run-the-demo-on-windows) - - [FP16 inference windows](#fp16-inference-windows) - - [INT8 inference windows](#int8-inference-windows) - - [Known issues with tkDNN on Windows](#known-issues-with-tkdnn-on-windows) ## Dependencies This branch works on every NVIDIA GPU that supports the following (latest tested) dependencies: -* CUDA 11.0 (or >= 10) +* CUDA 11.0 (or >= 10) [the segmentation only works with CUDA 10 for now] * cuDNN 8.0.4 (or >= 7.3) * TensorRT 7.2.0 (or >=5) * OpenCV 4.5.2 (or >=4) @@ -109,7 +96,7 @@ sudo apt install libyaml-cpp-dev curl libeigen3-dev ``` -## About OpenCV +#### About OpenCV To compile and install OpenCV4 with contrib us the script ```install_OpenCV4.sh```. It will download and compile OpenCV in Download folder. ``` bash scripts/install_OpenCV4.sh @@ -135,214 +122,23 @@ Steps needed to do inference on tkDNN with a custom neural network. * Create a new test and define the network, layer by layer using the weights extracted and the output to check the results. * Do inference. -## How to export weights +## Exporting weights -Weights are essential for any network to run inference. For each test a folder organized as follow is needed (in the build folder): -``` - test_nn - |---- layers/ (folder containing a binary file for each layer with the corresponding wieghts and bias) - |---- debug/ (folder containing a binary file for each layer with the corresponding outputs) -``` -Therefore, once the weights have been exported, the folders layers and debug should be placed in the corresponding test. +For specific details on how to export weights see [HERE](./docs/exporting_weights.md). -### 1)Export weights from darknet -To export weights for NNs that are defined in darknet framework, use [this](https://git.hipert.unimore.it/fgatti/darknet.git) fork of darknet and follow these steps to obtain a correct debug and layers folder, ready for tkDNN. - -``` -git clone https://git.hipert.unimore.it/fgatti/darknet.git -cd darknet -make -mkdir layers debug -./darknet export layers -``` -N.b. Use compilation with CPU (leave GPU=0 in Makefile) if you also want debug. - -### 2)Export weights for DLA34 and ResNet101 -To get weights and outputs needed to run the tests dla34 and resnet101 use the Python script and the Anaconda environment included in the repository. - -Create Anaconda environment and activate it: -``` -conda env create -f file_name.yml -source activate env_name -python