-
Notifications
You must be signed in to change notification settings - Fork 5
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
e087aa9
commit e67e66b
Showing
11 changed files
with
993 additions
and
17 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,26 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
# Create project | ||
set(ProjectName "main") | ||
project(${ProjectName}) | ||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${ProjectName}) | ||
|
||
# Select build system and set compile options | ||
include(${CMAKE_CURRENT_LIST_DIR}/../common_helper/cmakes/build_setting.cmake) | ||
|
||
# Create executable file | ||
add_executable(${ProjectName} main.cpp) | ||
|
||
# Link ImageProcessor module | ||
add_subdirectory(./image_processor image_processor) | ||
target_include_directories(${ProjectName} PUBLIC ./image_processor) | ||
target_link_libraries(${ProjectName} ImageProcessor) | ||
|
||
# For OpenCV | ||
find_package(OpenCV REQUIRED) | ||
target_include_directories(${ProjectName} PUBLIC ${OpenCV_INCLUDE_DIRS}) | ||
target_link_libraries(${ProjectName} ${OpenCV_LIBS}) | ||
|
||
# Copy resouce | ||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/../resource DESTINATION ${CMAKE_BINARY_DIR}/) | ||
add_definitions(-DRESOURCE_DIR="${CMAKE_BINARY_DIR}/resource/") |
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,39 @@ | ||
# YOLOX with TensorFlowLite/TensorRT/OpenCV/OpenVINO/ncnn/MNN/ArmNN/ONNXRuntime/TensorFlow in C++ on Windows/Linux/Linux(Arm)/Android | ||
|
||
![00_doc/demo.jpg](00_doc/demo.jpg)] | ||
|
||
## Target Environment, How to Build, How to Run | ||
1. Please follow the instruction: https://github.com/iwatake2222/InferenceHelper_Sample | ||
2. Build `pj_det_yolox` project (this directory) | ||
|
||
|
||
## Tested environments | ||
| Framework | Windows (x64) | Linux (x64) | Linux (aarch64) | Android (aarch64) | | ||
|---------------------------|-----------------|-----------------|-----------------|-------------------| | ||
| TensorFlow Lite | [x] | [x] | [x] | [x] | | ||
| TensorFlow Lite + XNNPACK | [x] | [x] | [x] | [x] | | ||
| TensorFlow Lite + EdgeTPU | [x] bad result | [ ] | [x] bad result | Unsupported | | ||
| TensorFlow Lite + GPU | No library | No library | No library | [x] | | ||
| TensorFlow Lite + NNAPI | No library | No library | No library | [x] | | ||
| TensorRT | [x] | [ ] | [x] | No library | | ||
| OpenCV(dnn) | [x] | [x] | [ ] | [x] | | ||
| OpenVINO with OpenCV | [x] | [x] | Unsupported | Unsupported | | ||
| ncnn | [x] | [x] | No library | [x] | | ||
| MNN | [x] | [x] | [x] | [x] | | ||
| ~~SNPE~~ | Unsupported | Unsupported | [ ] | [ ] | | ||
| Arm NN | Unsupported | [ ] | [x] | No library | | ||
| NNabla | [ ] no model | No library | No library | No library | | ||
| ONNX Runtime | [x] | [x] | [x] | [ ] error | | ||
| LibTorch | No model | No model | No model | No model | | ||
| TensorFlow | [x] | [ ] | No library | No library | | ||
|
||
## Note | ||
- To run with OpenVINO, enable OpenCV and uncomment the following line | ||
- `//#define MODEL_NAME "yolox_nano_480x640/model_float32.xml" /* for OpenVINO */` | ||
- To run on Android, modify `ViewAndroid\app\src\main\cpp\CMakeLists.txt` | ||
- `set(ImageProcessor_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../../pj_det_yolox/image_processor")` | ||
|
||
## Acknowledgements | ||
- https://github.com/Megvii-BaseDetection/YOLOX | ||
- https://github.com/PINTO0309/PINTO_model_zoo | ||
- https://github.com/Tencent/ncnn |
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,81 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
set(LibraryName "ImageProcessor") | ||
|
||
# Create library | ||
add_library (${LibraryName} image_processor.cpp image_processor.h detection_engine.cpp detection_engine.h) | ||
|
||
# For OpenCV | ||
find_package(OpenCV REQUIRED) | ||
target_include_directories(${LibraryName} PUBLIC ${OpenCV_INCLUDE_DIRS}) | ||
target_link_libraries(${LibraryName} ${OpenCV_LIBS}) | ||
|
||
# Link Common Helper module | ||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../../common_helper common_helper) | ||
target_include_directories(${LibraryName} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../../common_helper) | ||
target_link_libraries(${LibraryName} CommonHelper) | ||
|
||
# For InferenceHelper | ||
set(INFERENCE_HELPER_DIR ${CMAKE_CURRENT_LIST_DIR}/../../InferenceHelper/) | ||
add_subdirectory(${INFERENCE_HELPER_DIR}/inference_helper inference_helper) | ||
target_include_directories(${LibraryName} PUBLIC ${INFERENCE_HELPER_DIR}/inference_helper) | ||
target_link_libraries(${LibraryName} InferenceHelper) | ||
|
||
# Add definition to select framework automatically. You don't need this in the real product | ||
if(INFERENCE_HELPER_ENABLE_OPENCV) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_OPENCV) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_TENSORRT) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_TENSORRT) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_TFLITE) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_TFLITE) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_TFLITE_DELEGATE_GPU) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_TFLITE_DELEGATE_GPU) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_TFLITE_DELEGATE_EDGETPU) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_TFLITE_DELEGATE_EDGETPU) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_TFLITE_DELEGATE_XNNPACK) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_TFLITE_DELEGATE_XNNPACK) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_TFLITE_DELEGATE_NNAPI) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_TFLITE_DELEGATE_NNAPI) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_NCNN) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_NCNN) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_MNN) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_MNN) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_SNPE) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_SNPE) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_ARMNN) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_ARMNN) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_NNABLA) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_NNABLA) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_NNABLA_CUDA) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_NNABLA_CUDA) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_ONNX_RUNTIME) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_ONNX_RUNTIME) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_ONNX_RUNTIME_CUDA) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_ONNX_RUNTIME_CUDA) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_LIBTORCH) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_LIBTORCH) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_LIBTORCH_CUDA) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_LIBTORCH_CUDA) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_TENSORFLOW) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_TENSORFLOW) | ||
endif() | ||
if(INFERENCE_HELPER_ENABLE_TENSORFLOW_GPU) | ||
add_definitions(-DINFERENCE_HELPER_ENABLE_TENSORFLOW_GPU) | ||
endif() |
Oops, something went wrong.