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
ModelZoo
ppocrv5_migraphx
Commits
64383f40
Commit
64383f40
authored
Jul 12, 2025
by
liuhy
Browse files
1、修改README.md 2、新增opencv编译脚本
parent
8dbb579b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
35 deletions
+37
-35
3rdParty/InstallOpenCVDependences.sh
3rdParty/InstallOpenCVDependences.sh
+0
-10
3rdParty/buildOpencv.sh
3rdParty/buildOpencv.sh
+22
-0
CMakeLists.txt
CMakeLists.txt
+0
-1
Python/requirements.txt
Python/requirements.txt
+4
-4
Python/whl/pyclipper-1.3.0.post6-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
...p310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
+0
-0
Python/whl/shapely-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
...p310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
+0
-0
README.md
README.md
+3
-20
demo.sh
demo.sh
+8
-0
No files found.
3rdParty/InstallOpenCVDependences.sh
deleted
100755 → 0
View file @
8dbb579b
#! /bin/sh
############### Ubuntu ###############
# 参考:https://docs.opencv.org/3.4.11/d7/d9f/tutorial_linux_install.html
apt-get
install
build-essential
-y
apt-get
install
cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
-y
apt-get
install
python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
-y
# 处理图像所需的包,可选
############### CentOS ###############
# yum install gcc gcc-c++ gtk2-devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig python libtool nasm -y
3rdParty/buildOpencv.sh
0 → 100755
View file @
64383f40
#! /bin/sh
echo
"开始编译opencv ..."
cur_dir
=
$(
pwd
)
if
[
!
-d
"
${
cur_dir
}
/3rdParty/opencv-3.4.11"
]
;
then
tar
-xvzf
${
cur_dir
}
/3rdParty/opencv-3.4.11_mini.tar.gz
-C
${
cur_dir
}
/3rdParty/
fi
if
[
-d
"
${
cur_dir
}
/3rdParty/opencv"
]
;
then
rm
-rf
${
cur_dir
}
/3rdParty/opencv/
*
else
mkdir
-p
${
cur_dir
}
/3rdParty/opencv
fi
mkdir
-p
${
cur_dir
}
/3rdParty/opencv-3.4.11/build
cd
${
cur_dir
}
/3rdParty/opencv-3.4.11/build
rm
./
*
ake
*
-rf
cmake
-D
CMAKE_BUILD_TYPE
=
RELEASE
-D
CMAKE_INSTALL_PREFIX
=
${
cur_dir
}
/3rdParty/opencv ..
make
-j8
&&
make
install
rm
${
cur_dir
}
/3rdParty/opencv-3.4.11
-rf
cd
${
cur_dir
}
CMakeLists.txt
View file @
64383f40
...
...
@@ -27,7 +27,6 @@ set(LIBRARY opencv_core
opencv_imgproc
opencv_imgcodecs
freetype
opencv_dnn
migraphx
migraphx_gpu
migraphx_onnx
)
...
...
Python/requirements.txt
View file @
64383f40
opencv-python
numpy
shapely
pyclipper
\ No newline at end of file
#opencv-python
#numpy
./whl/shapely-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
./whl/pyclipper-1.3.0.post6-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
\ No newline at end of file
3rdParty/rbuild_depend
/pyclipper-1.3.0.post6-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
→
Python/whl
/pyclipper-1.3.0.post6-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
View file @
64383f40
File moved
3rdParty/rbuild_depend
/shapely-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
→
Python/whl
/shapely-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
View file @
64383f40
File moved
README.md
View file @
64383f40
...
...
@@ -73,7 +73,6 @@ cd <ppocrv5_migraphx>
cd
Python
/
# 安装依赖
pip
install
-
r
requirements
.
txt
-
i
https
:
//
pypi
.
tuna
.
tsinghua
.
edu
.
cn
/
simple
```
如果测试环境是离线环境,可手动安装需要的依赖(shapely,pyclipper),依赖文件存放在3rdParty/rbuild_depend目录下
运行示例程序:
...
...
@@ -86,27 +85,11 @@ python inference.py
下面介绍如何运行C++代码示例,C++ API调用示例的详细说明见Doc目录下的Tutorial_Cpp.md。
#### 安装Opencv依赖
```
python
cd
<
path_to_ppocrv5_migraphx
>
sh
.
/
3
rdParty
/
InstallOpenCVDependences
.
sh
```
#### 安装OpenCV并构建工程
```
rbuild build -d depend
```
如果构建不成功可手动编译OpenCV,步骤如下:
-
进入到3rdParty下解压opencv,tar -xvzf opencv-3.4.11_mini.tar.gz
-
进入到opencv-3.4.11_mini目录下创建build目录,cd build
-
执行以下命令:
在path_to_ppocrv5_migraphx目录下执行以下命令:
```
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=./opencv_dep -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_GENERATE_PKGCONFIG=ON -D BUILD_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=../modules/ ..
sh ./3rdParty/buildOpencv.sh
```
-
执行make -j8 && make install,编译的头文件和库目录存放在opencv_dep,将opencv_dep目录拷贝到3rdParty,并命名为opencv
#### 运行示例
...
...
@@ -115,7 +98,7 @@ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=./opencv_dep -D INSTAL
cd
<
path_to_ppocrv5_migraphx
>
# 进入build目录
cd
build
/
mkdir
build
&&
cd
build
#编译
cmake
..
&&
make
...
...
demo.sh
0 → 100755
View file @
64383f40
cd
Python
pip
install
-r
requirements.txt
python ./inference.py
cd
..
sh ./3rdParty/buildOpencv.sh
mkdir
build
&&
cd
build
cmake ..
&&
make
./ppOcrV5cd
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