Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
RapidOCR
Commits
397381dc
Commit
397381dc
authored
Oct 19, 2022
by
benjaminwan
Browse files
适配linux cuda
parent
3e2008c5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
7 deletions
+35
-7
onnxruntime-gpu/linux/OnnxRuntimeConfig.cmake
onnxruntime-gpu/linux/OnnxRuntimeConfig.cmake
+1
-1
onnxruntime-gpu/windows-x64/OnnxRuntimeConfig.cmake
onnxruntime-gpu/windows-x64/OnnxRuntimeConfig.cmake
+1
-1
run-benchmark.sh
run-benchmark.sh
+13
-1
run-test.sh
run-test.sh
+14
-2
valgrind-massif.sh
valgrind-massif.sh
+3
-0
valgrind-memcheck.sh
valgrind-memcheck.sh
+3
-2
No files found.
onnxruntime-gpu/linux/OnnxRuntimeConfig.cmake
View file @
397381dc
set
(
OnnxRuntime_INCLUDE_DIRS
"
${
CMAKE_CURRENT_LIST_DIR
}
/include"
)
set
(
OnnxRuntime_INCLUDE_DIRS
"
${
CMAKE_CURRENT_LIST_DIR
}
/include"
)
include_directories
(
${
OnnxRuntime_INCLUDE_DIRS
}
)
include_directories
(
${
OnnxRuntime_INCLUDE_DIRS
}
)
link_directories
(
${
CMAKE_CURRENT_LIST_DIR
}
/lib
)
link_directories
(
${
CMAKE_CURRENT_LIST_DIR
}
/lib
)
set
(
OnnxRuntime_LIBS onnxruntime
onnxruntime_providers_cuda onnxruntime_providers_shared onnxruntime_providers_tensorrt
)
set
(
OnnxRuntime_LIBS onnxruntime
)
onnxruntime-gpu/windows-x64/OnnxRuntimeConfig.cmake
View file @
397381dc
set
(
OnnxRuntime_INCLUDE_DIRS
"
${
CMAKE_CURRENT_LIST_DIR
}
/include"
)
set
(
OnnxRuntime_INCLUDE_DIRS
"
${
CMAKE_CURRENT_LIST_DIR
}
/include"
)
include_directories
(
${
OnnxRuntime_INCLUDE_DIRS
}
)
include_directories
(
${
OnnxRuntime_INCLUDE_DIRS
}
)
link_directories
(
${
CMAKE_CURRENT_LIST_DIR
}
/lib
)
link_directories
(
${
CMAKE_CURRENT_LIST_DIR
}
/lib
)
set
(
OnnxRuntime_LIBS onnxruntime
onnxruntime_providers_cuda onnxruntime_providers_shared onnxruntime_providers_tensorrt
)
set
(
OnnxRuntime_LIBS onnxruntime
)
run-benchmark.sh
View file @
397381dc
#!/usr/bin/env bash
#!/usr/bin/env bash
function
PrepareVar
(){
function
PrepareVar
(){
EXE_PATH
=
${
sysOS
}
-BIN
echo
"onnxruntime: 1)CPU(默认), 2)GPU(cuda)"
read
-p
""
ONNX_TYPE
if
[
$ONNX_TYPE
==
1
]
;
then
ONNX_TYPE
=
"CPU"
GPU_INDEX
=
-1
elif
[
$ONNX_TYPE
==
2
]
;
then
ONNX_TYPE
=
"CUDA"
GPU_INDEX
=
0
else
echo
-e
"输入错误!Input Error!"
fi
EXE_PATH
=
${
sysOS
}
-
${
ONNX_TYPE
}
-BIN
}
}
sysOS
=
`
uname
-s
`
sysOS
=
`
uname
-s
`
...
@@ -45,4 +56,5 @@ fi
...
@@ -45,4 +56,5 @@ fi
--unClipRatio
1.6
\
--unClipRatio
1.6
\
--doAngle
1
\
--doAngle
1
\
--mostAngle
1
\
--mostAngle
1
\
--GPU
$GPU_INDEX
\
--loopCount
$LOOP_COUNT
--loopCount
$LOOP_COUNT
\ No newline at end of file
run-test.sh
View file @
397381dc
#!/usr/bin/env bash
#!/usr/bin/env bash
function
PrepareVar
(){
function
PrepareVar
(){
EXE_PATH
=
${
sysOS
}
-BIN
echo
"onnxruntime: 1)CPU(默认), 2)GPU(cuda)"
read
-p
""
ONNX_TYPE
if
[
$ONNX_TYPE
==
1
]
;
then
ONNX_TYPE
=
"CPU"
GPU_INDEX
=
-1
elif
[
$ONNX_TYPE
==
2
]
;
then
ONNX_TYPE
=
"CUDA"
GPU_INDEX
=
0
else
echo
-e
"输入错误!Input Error!"
fi
EXE_PATH
=
${
sysOS
}
-
${
ONNX_TYPE
}
-BIN
}
}
sysOS
=
`
uname
-s
`
sysOS
=
`
uname
-s
`
...
@@ -42,4 +53,5 @@ fi
...
@@ -42,4 +53,5 @@ fi
--boxThresh
0.3
\
--boxThresh
0.3
\
--unClipRatio
1.6
\
--unClipRatio
1.6
\
--doAngle
1
\
--doAngle
1
\
--mostAngle
1
--mostAngle
1
\
\ No newline at end of file
--GPU
$GPU_INDEX
\ No newline at end of file
valgrind-massif.sh
View file @
397381dc
...
@@ -18,6 +18,9 @@ echo "找不到待识别的目标图片:${TARGET_IMG},请打开本文件并
...
@@ -18,6 +18,9 @@ echo "找不到待识别的目标图片:${TARGET_IMG},请打开本文件并
exit
exit
fi
fi
sysOS
=
`
uname
-s
`
EXE_PATH
=
${
sysOS
}
-CPU-BIN
##### run test on MacOS or Linux
##### run test on MacOS or Linux
valgrind
--tool
=
massif
--pages-as-heap
=
yes
\
valgrind
--tool
=
massif
--pages-as-heap
=
yes
\
./
${
EXE_PATH
}
/RapidOcrOnnx
--models
models
\
./
${
EXE_PATH
}
/RapidOcrOnnx
--models
models
\
...
...
valgrind-memcheck.sh
View file @
397381dc
...
@@ -19,7 +19,7 @@ exit
...
@@ -19,7 +19,7 @@ exit
fi
fi
sysOS
=
`
uname
-s
`
sysOS
=
`
uname
-s
`
EXE_PATH
=
${
sysOS
}
-BIN
EXE_PATH
=
${
sysOS
}
-
CPU-
BIN
##### run test on MacOS or Linux
##### run test on MacOS or Linux
valgrind
--tool
=
memcheck
--leak-check
=
full
--leak-resolution
=
med
--track-origins
=
yes
--vgdb
=
no
--log-file
=
valgrind-memcheck.txt
\
valgrind
--tool
=
memcheck
--leak-check
=
full
--leak-resolution
=
med
--track-origins
=
yes
--vgdb
=
no
--log-file
=
valgrind-memcheck.txt
\
...
@@ -36,4 +36,5 @@ valgrind --tool=memcheck --leak-check=full --leak-resolution=med --track-origins
...
@@ -36,4 +36,5 @@ valgrind --tool=memcheck --leak-check=full --leak-resolution=med --track-origins
--boxThresh
0.3
\
--boxThresh
0.3
\
--unClipRatio
1.6
\
--unClipRatio
1.6
\
--doAngle
1
\
--doAngle
1
\
--mostAngle
1
--mostAngle
1
\
--GPU
-1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment