Skip to content

Commit

Permalink
[Hackathon No.89] Complete the deployment verification of PaddlePaddl…
Browse files Browse the repository at this point in the history
…e visual model on Arm virtual hardware (#20)

Update configuration name.
  • Loading branch information
Zheng-Bicheng authored Jan 5, 2024
1 parent 2a97528 commit 90d7419
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 29 deletions.
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,46 @@
# Paddle Examples for Arm Virtual Hardware(AVH)

## Arm Virtual Hardware(AVH)
[Arm Virtual Hardware (AVH)](https://www.arm.com/products/development-tools/simulation/virtual-hardware) scales and accelerates IoT software development by virtualising popular IoT development kits, Arm-based processors, and systems in the cloud. It is an evolution of Arm’s modelling technology that removes the wait for hardware and the complexity of building and configuring board farms for testing. It enables modern agile software development practices, such as DevOps and MLOps workflows.

Arm Virtual Hardware is available for [Corstone](https://www.arm.com/products/silicon-ip-subsystems) platforms and [Cortex](https://www.arm.com/products/silicon-ip-cpu) processors via an Amazon Machine Image (AMI) on [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-urbpq7yo5va7g) as well for third-party hardware available via Arm’s [SaaS platform](https://avh.arm.com/).
[Arm Virtual Hardware (AVH)](https://www.arm.com/products/development-tools/simulation/virtual-hardware) scales and
accelerates IoT software development by virtualising popular IoT development kits, Arm-based processors, and systems in
the cloud. It is an evolution of Arm’s modelling technology that removes the wait for hardware and the complexity of
building and configuring board farms for testing. It enables modern agile software development practices, such as DevOps
and MLOps workflows.

Arm Virtual Hardware is available for [Corstone](https://www.arm.com/products/silicon-ip-subsystems) platforms
and [Cortex](https://www.arm.com/products/silicon-ip-cpu) processors via an Amazon Machine Image (AMI)
on [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-urbpq7yo5va7g) as well for third-party hardware
available via Arm’s [SaaS platform](https://avh.arm.com/).

For examples in this repository, we use Arm Virtual Hardware with Corstone platforms and Cortex processors via AWS.

## PaddlePaddle
PaddlePaddle (PArallel Distributed Deep LEarning) is a simple, efficient and extensible deep learning framework developed by Baidu, Inc. As the first independent R&D deep learning platform in China, it has been officially open-sourced to professional communities since 2016. It is an industrial platform with advanced technologies and rich features that cover core deep learning frameworks, basic model libraries, end-to-end development kits, tools & components as well as service platforms. For more details, please refer to [PaddlePaddle Github](https://github.com/PaddlePaddle/Paddle) for details.

PaddlePaddle (PArallel Distributed Deep LEarning) is a simple, efficient and extensible deep learning framework
developed by Baidu, Inc. As the first independent R&D deep learning platform in China, it has been officially
open-sourced to professional communities since 2016. It is an industrial platform with advanced technologies and rich
features that cover core deep learning frameworks, basic model libraries, end-to-end development kits, tools &
components as well as service platforms. For more details, please refer
to [PaddlePaddle Github](https://github.com/PaddlePaddle/Paddle) for details.

## Running environment and prerequisites

If you haven't configured the environment yet, please run the following command to set up the dependencies for this
repository.

```bash
cd /path/to/Paddle-examples-for-AVH
bash scripts/config_cmsis_toolbox.sh
bash scripts/config_tvm.sh
```

## Example
We provide 4 use cases in this repository ([ocr](./ocr), [object_classification](./object_classification), [object_detection](./object_detection), [object_segmentation](./object_segmentation)) with various models supported from corresponding Paddle Toolkit.

We have divided the repository into several sections based on common tasks in the computer vision field. Please refer to
the table below for details.

| Task | Model | Cortex-M55 | Cortex-M85 |
|-------------------------------------------|-------------|------------|------------|
| [Classification](./object_classification) | MobileNetV3 |||
| [Classification](./object_classification) | PP_LCNet |||
31 changes: 31 additions & 0 deletions object_classification/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Running PaddleClas image classification model using Arm Virtual Hardware

## Running environment and prerequisites

If you are running this project for the first time, please go back to [the homepage](../README.md) and follow the
documentation there to install the dependencies.

## Supported Models List

For your convenience, we have provided a corresponding table of models currently adapted and the devices that support each of these models.

| Model | Cortex-M55 | Cortex-M85 |
|-------------|------------|------------|
| MobileNetV3 |||
| PP_LCNet |||

## Run Classification Model Demo

We use **run_demo.sh** to build the entire project. The parameters you need to pass are listed in the table below.

| Arguments | Details |
|-----------|--------------------------------------------------------------------------------------------------------------|
| --model | The '--model' parameter is used to select the desired model. Currently, it supports MobileNetV3/PP_LCNet. |
| --device | The '--device' parameter is used to select the desired device. Currently, it supports cortex-m55/cortex-m85. |

For example, running the following command can execute the MobileNetV3 model on Cortex-M55:

```bash
cd /path/to/Paddle-examples-for-AVH/object_classification
bash run_demo.sh --model MobileNetV3 --device cortex-m55
```
10 changes: 5 additions & 5 deletions object_classification/run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ function show_usage() {
cat <<EOF
Usage: run_demo.sh
-h, --help
Display this help message.
--model_name MODEL_NAME
Display this help message.
--model MODEL
Set name of paddle model.
--device DEVICE
Set device to run.
Expand All @@ -20,13 +20,13 @@ while (( $# )); do
exit 0
;;

--model_name)
--model)
if [ $# -gt 1 ]
then
export MODEL_NAME="$2"
shift 2
else
echo 'ERROR: --model_name requires a non-empty argument' >&2
echo 'ERROR: --model requires a non-empty argument' >&2
show_usage >&2
exit 1
fi
Expand Down Expand Up @@ -81,7 +81,7 @@ elif [ "$MODEL_NAME" == "PP_LCNet" ]; then
mv PPLCNet_x0_75_infer "${PWD}/model"
MODEL_NAME="PPLCNet"
else
echo 'ERROR: --model_name only support MobileNetV3/PP_LCNet' >&2
echo 'ERROR: --model only support MobileNetV3/PP_LCNet' >&2
exit 1
fi

Expand Down
10 changes: 5 additions & 5 deletions object_detection/run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ function show_usage() {
cat <<EOF
Usage: run_demo.sh
-h, --help
Display this help message.
--model_name MODEL_NAME
Display this help message.
--model MODEL
Set name of paddle model.
--device DEVICE
Set device to run.
Expand All @@ -20,13 +20,13 @@ while (( $# )); do
exit 0
;;

--model_name)
--model)
if [ $# -gt 1 ]
then
export MODEL_NAME="$2"
shift 2
else
echo 'ERROR: --model_name requires a non-empty argument' >&2
echo 'ERROR: --model requires a non-empty argument' >&2
show_usage >&2
exit 1
fi
Expand Down Expand Up @@ -74,7 +74,7 @@ if [ "$MODEL_NAME" == "Picodet" ]; then
rm -rf picodet_s_320_coco_lcnet_no_nms.tar
mv picodet_s_320_coco_lcnet_no_nms model
else
echo 'ERROR: --model_name only support Picodet' >&2
echo 'ERROR: --model only support Picodet' >&2
exit 1
fi

Expand Down
11 changes: 6 additions & 5 deletions object_segmentation/run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
function show_usage() {
cat <<EOF
Usage: run_demo.sh
-h, --help Display this help message.
--model_name MODEL_NAME
-h, --help
Display this help message.
--model MODEL
Set name of paddle model.
--device DEVICE
Set device to run.
Expand All @@ -19,13 +20,13 @@ while (( $# )); do
exit 0
;;

--model_name)
--model)
if [ $# -gt 1 ]
then
export MODEL_NAME="$2"
shift 2
else
echo 'ERROR: --model_name requires a non-empty argument' >&2
echo 'ERROR: --model requires a non-empty argument' >&2
show_usage >&2
exit 1
fi
Expand Down Expand Up @@ -75,7 +76,7 @@ if [ "$MODEL_NAME" == "PP_HumanSeg" ]; then
rm -rf __MACOSX
MODEL_NAME="PPHumanSeg"
else
echo 'ERROR: --model_name only support PP_HumanSeg' >&2
echo 'ERROR: --model only support PP_HumanSeg' >&2
exit 1
fi

Expand Down
11 changes: 6 additions & 5 deletions ocr/text_angle_classification/run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
function show_usage() {
cat <<EOF
Usage: run_demo.sh
-h, --help Display this help message.
--model_name MODEL_NAME
-h, --help
Display this help message.
--model MODEL
Set name of paddle model.
--device DEVICE
Set device to run.
Expand All @@ -19,13 +20,13 @@ while (( $# )); do
exit 0
;;

--model_name)
--model)
if [ $# -gt 1 ]
then
export MODEL_NAME="$2"
shift 2
else
echo 'ERROR: --model_name requires a non-empty argument' >&2
echo 'ERROR: --model requires a non-empty argument' >&2
show_usage >&2
exit 1
fi
Expand Down Expand Up @@ -74,7 +75,7 @@ if [ "$MODEL_NAME" == "CH_PPOCRV2_CLS" ]; then
mv ch_ppocr_mobile_v2.0_cls_infer model
MODEL_NAME="CHPPOCRV2CLS"
else
echo 'ERROR: --model_name only support CH_PPOCRV2_CLS' >&2
echo 'ERROR: --model only support CH_PPOCRV2_CLS' >&2
exit 1
fi

Expand Down
11 changes: 6 additions & 5 deletions ocr/text_recognition/run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
function show_usage() {
cat <<EOF
Usage: run_demo.sh
-h, --help Display this help message.
--model_name MODEL_NAME
-h, --help
Display this help message.
--model MODEL
Set name of paddle model.
--device DEVICE
Set device to run.
Expand All @@ -19,13 +20,13 @@ while (( $# )); do
exit 0
;;

--model_name)
--model)
if [ $# -gt 1 ]
then
export MODEL_NAME="$2"
shift 2
else
echo 'ERROR: --model_name requires a non-empty argument' >&2
echo 'ERROR: --model requires a non-empty argument' >&2
show_usage >&2
exit 1
fi
Expand Down Expand Up @@ -75,7 +76,7 @@ if [ "$MODEL_NAME" == "EN_PPOCRV3_REC" ]; then
rm ocr_en.tar
MODEL_NAME="ENPPOCRV3REC"
else
echo 'ERROR: --model_name only support EN_PPOCRV3_REC' >&2
echo 'ERROR: --model only support EN_PPOCRV3_REC' >&2
exit 1
fi

Expand Down

0 comments on commit 90d7419

Please sign in to comment.