forked from Linaom1214/TensorRT-For-YOLO-Series
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2449c51
commit bacd195
Showing
8 changed files
with
435 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## With NMS Plugin | ||
|
||
**Edit code for you model** | ||
|
||
```c++ | ||
const cv::Size& new_shape = cv::Size(640, 640), | ||
static const int INPUT_H = 640; | ||
auto in_dims = engine->getBindingDimensions(engine->getBindingIndex("image_arrays")); | ||
``` | ||
**run** | ||
```shell | ||
cd end2end && mkdir build && build | ||
cmake .. | ||
make | ||
./yolo -model_path engine -image_path xxx.jpg | ||
``` | ||
|
||
|
||
## Without NMS Plugin | ||
|
||
**Edit code for you model** | ||
|
||
```c++ | ||
static const int INPUT_W = 640; | ||
static const int INPUT_H = 640; | ||
const char* INPUT_BLOB_NAME = "image_arrays"; | ||
const char* OUTPUT_BLOB_NAME = "outputs"; | ||
``` | ||
**run** | ||
|
||
```shell | ||
cd norm && mkdir build && build | ||
cmake .. | ||
make | ||
./yolo ../model_trt.engine -i ../*.jpg | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
cmake_minimum_required(VERSION 2.6) | ||
|
||
project(yolo) | ||
|
||
add_definitions(-std=c++11) | ||
|
||
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF) | ||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_BUILD_TYPE Debug) | ||
# add_definitions("-Wall -g") | ||
find_package(CUDA REQUIRED) | ||
|
||
include_directories(${PROJECT_SOURCE_DIR}/include) | ||
# include and link dirs of cuda and tensorrt, you need adapt them if yours are different | ||
# cuda | ||
include_directories(/usr/local/cuda/include) | ||
link_directories(/usr/local/cuda/lib64) | ||
# tensorrt | ||
include_directories(/usr/include/x86_64-linux-gnu/) | ||
link_directories(/usr/lib/x86_64-linux-gnu/) | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast -Wfatal-errors -D_MWAITXINTRIN_H_INCLUDED") | ||
|
||
find_package(OpenCV) | ||
include_directories(${OpenCV_INCLUDE_DIRS}) | ||
|
||
add_executable(yolo ${PROJECT_SOURCE_DIR}/main.cpp) | ||
target_link_libraries(yolo nvinfer) | ||
target_link_libraries(yolo nvinfer_plugin) | ||
target_link_libraries(yolo cudart) | ||
|
||
target_link_libraries(yolo ${OpenCV_LIBS}) | ||
|
||
add_definitions(-O2 -pthread) |
Oops, something went wrong.