Skip to content

Commit 2530c88

Browse files
committed
test cuda9.0 on ubuntu 16.04
1 parent 703d27c commit 2530c88

File tree

9 files changed

+55
-40
lines changed

9 files changed

+55
-40
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ if (OPENMP_FOUND)
143143
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
144144
endif()
145145
if(UNIX)
146-
set(CUDNN /usr/local/cuda/lib64/libcudnn.so)
147146
#set(CUDNN /usr/local/cuda/lib64/libcudnn.so)
147+
#set(CUDNN usr/lib/aarch64-linux-gnu/libcudnn.so)
148148
#set(CUDNN /usr/bin/libcudnn.so)
149149
include_directories(/usr/local/cuda/include)
150150
cuda_add_executable(YOLOv3SE_Train ${SOURCE_FILES} src/main.c) #Make train executable
151-
target_link_libraries(YOLOv3SE_Train cuda pthread m CUDNN)
151+
target_link_libraries(YOLOv3SE_Train cuda pthread m ${CUDNN})
152152
cuda_add_library(YOLOv3SE SHARED ${SOURCE_FILES} src/main.c src/yolo_v3.c) #make so file
153153
SET_TARGET_PROPERTIES(YOLOv3SE PROPERTIES COMPILE_FLAGS "-D_WINDLL")
154-
target_link_libraries(YOLOv3SE cuda pthread m CUDNN)
154+
target_link_libraries(YOLOv3SE cuda pthread m ${CUDNN})
155155
target_include_directories(YOLOv3SE PUBLIC ${PROJECT_SOURCE_DIR}/include)
156156
endif(UNIX)
157157
if(MSVC)

README.md

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
## YOLOv3_SpringEdition <img src="https://i.imgur.com/oYejfWp.png" title="Windows8" width="48">
1+
YOLOv3_SpringEdition <img src="https://i.imgur.com/oYejfWp.png" title="Windows8" width="48">
2+
--------------------------------------------------------------------------------------------
23

34
<img src="https://i.imgur.com/ElCyyzT.png" title="Windows8" width="48"><img src="https://i.imgur.com/O5bye0l.png" width="48"><img src="https://i.imgur.com/kmfOMZz.png" width="48"><img src="https://i.imgur.com/6OT8yM9.png" width="48">
45

56
#### YOLOv3 C++ Windows and Linux interface library. (Train,Detect both)
67

7-
* Remove pthread,opencv dependency.
8-
* You need only 1 files for YOLO deep-learning.
9-
* Support windows, linux as same interface.
8+
- Remove pthread,opencv dependency.
9+
- You need only 1 files for YOLO deep-learning.
10+
- Support windows, linux as same interface.
1011

1112
#### Do you want train YOLOv3 as double click? and detect using YOLOv3 as below?
13+
1214
```cpp
1315
YOLOv3 detector;
1416
detector.Create("coco.weights", "coco.cfg", "coco.names");
1517
cv::Mat img=cv::imread("a.jpg");
1618
std::vector<BoxSE> boxes = detector.Detect(img, 0.5F);
1719
```
18-
* Then you've come to the right place.
20+
21+
- Then you've come to the right place.
1922

2023
### 1. Setup for train.
21-
You need only 2 files for train that are **YOLOv3SE_Train.exe** and **cudnn64_5.dll** on Windows.
22-
If you are on Linux, then you need only **YOLOv3SE_Train**.
23-
This files are in `YOLOv3_SpringEdition/bin`.
24+
25+
You need only 2 files for train that are **YOLOv3SE_Train.exe** and **cudnn64_5.dll** on Windows. If you are on Linux, then you need only **YOLOv3SE_Train**. This files are in `YOLOv3_SpringEdition/bin`.
2426

2527
The requirement interface not changed. Same as **[pjreddie/darknet](https://github.com/pjreddie/darknet)**.
2628

@@ -34,58 +36,58 @@ And YOLOv3SE_Train.exe is automatically choosing multi-gpu training. and select
3436

3537
### 2. Setup for detect
3638

37-
Just include **YOLOv3SE.h** and use it. See `YOLOv3_SpringEdition_Test/`.
38-
You need only **YOLOv3SE.h**, **libYOLOv3SE.dll** and **cudnn64_5.dll** for detect.
39+
Just include **YOLOv3SE.h** and use it. See `YOLOv3_SpringEdition_Test/`. You need only **YOLOv3SE.h**, **libYOLOv3SE.dll** and **cudnn64_5.dll** for detect.
3940

4041
##### Reference
4142

4243
The class `YOLOv3` that in `YOLOv3SE.h` has 3 methods.
44+
4345
```cpp
4446
void Create(std::string weights,std::string cfg,std::string names);
4547
```
46-
This method load trained model(**weights**), network configuration(**cfg**) and class naming file(**names**)
47-
* **Parameter**
48-
* **weights** : trained model path(e.g. "obj.weights")
49-
* **cfg** : network configuration file(e.g. "obj.cfg")
50-
* **names** : class naming file(e.g. "obj.names")
48+
49+
This method load trained model(**weights**), network configuration(**cfg**) and class naming file(**names**\)* **Parameter** * **weights** : trained model path(e.g. "obj.weights") * **cfg** : network configuration file(e.g. "obj.cfg") * **names** : class naming file(e.g. "obj.names")
5150
5251
```cpp
5352
std::vector<BoxSE> Detect(cv::Mat img, float threshold);
5453
std::vector<BoxSE> Detect(std::string file, float threshold);
5554
std::vector<BoxSE> Detect(IplImage* img, float threshold);
5655
```
57-
This method is detecting objects of `file`,`cv::Mat` or `IplImage`.
58-
* **Parameter**
59-
* **file** : image file path
60-
* **img** : 3-channel image.
61-
* **threshold** : It removes predictive boxes if there score is less than threshold.
56+
57+
This method is detecting objects of `file`,`cv::Mat` or `IplImage`.* **Parameter** * **file** : image file path * **img** : 3-channel image. * **threshold** : It removes predictive boxes if there score is less than threshold.
6258

6359
```cpp
6460
void Release();
6561
```
62+
6663
Release loaded network.
6764

68-
## Technical issue
65+
Technical issue
66+
---------------
6967

70-
Original YOLOv3(darknet) is linux version.
71-
And **[AlexeyAB](https://github.com/AlexeyAB/darknet)** already made YOLOv3 Windows version.
72-
But, his detection method is too slow on Windows. I don't know why exactly. Maybe it has bottleneck.
73-
So, I converted **[darknet](https://github.com/pjreddie/darknet)**(YOLOv3 only) again.
68+
Original YOLOv3(darknet) is linux version. And **[AlexeyAB](https://github.com/AlexeyAB/darknet)** already made YOLOv3 Windows version. But, his detection method is too slow on Windows. I don't know why exactly. Maybe it has bottleneck. So, I converted **[darknet](https://github.com/pjreddie/darknet)**(YOLOv3 only) again.
7469

75-
## change log
70+
change log
71+
----------
7672

7773
**build_windows.bat** and **build_linux.sh** will download automatically correct version of cudnn. and build as cmake.
74+
7875
```
79-
1080ti + CUDA8.0 + cudnn7.1 = 19FPS
80-
1080 + CUDA9.0 + cudnn7.1 = 27FPS
76+
Windows + 1080ti + CUDA8.0 + cudnn7.1 = 19FPS
77+
Windows + 1080 + CUDA9.0 + cudnn7.1 = 27FPS
78+
Ubuntu + 1080 + CUDA8.0 + cudnn7.1 = 20FPS
79+
Ubuntu + 1080 + CUDA9.0 + cudnn7.1 = 22FPS
8180
```
82-
## Software requirement
8381

84-
* CMake
85-
* CUDA 8.0 or 9.0 or 9.1
86-
* OpenCV
87-
* Visual Studio
82+
Software requirement
83+
--------------------
84+
85+
- CMake
86+
- CUDA 8.0 or 9.0(9.1 is not working)
87+
- OpenCV(for testing)
88+
- Visual Studio
8889

89-
## Hardware requirement
90+
Hardware requirement
91+
--------------------
9092

91-
* NVIDIA GPU
93+
- NVIDIA GPU

bin/CUDA8.0/YOLOv3SE_Train

100644100755
32 Bytes
Binary file not shown.

bin/CUDA8.0/libYOLOv3SE.so

100644100755
32 Bytes
Binary file not shown.

bin/CUDA9.0/YOLOv3SE_Train

3.76 MB
Binary file not shown.

bin/CUDA9.0/libYOLOv3SE.so

3.8 MB
Binary file not shown.

bin/CUDA9.1/YOLOv3SE_Train

3.73 MB
Binary file not shown.

bin/CUDA9.1/libYOLOv3SE.so

3.76 MB
Binary file not shown.

build_linux.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
mkdir build
22
cd build
3-
cmake ..
4-
make
3+
if [ -f "/usr/local/cuda/lib64/libcudnn.so" ]; then
4+
#Default cuda path
5+
cmake .. -DCUDNN=/usr/local/cuda/lib64/libcudnn.so
6+
make
7+
elif [ -f "/usr/bin/libcudnn.so" ]; then
8+
#global path
9+
cmake .. -DCUDNN=/usr/bin/libcudnn.so
10+
make
11+
elif [ -f "/usr/lib/aarch64-linux-gnu/libcudnn.so" ]; then
12+
#jetson cuda path(jetpack)
13+
cmake .. -DCUDNN=/usr/lib/aarch64-linux-gnu/libcudnn.so
14+
make
15+
else
16+
echo "there is no cudnn in your PC";
17+
fi

0 commit comments

Comments
 (0)