-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add mmcls full pipeline test ci * update * update * add mmcv * install torch * install mmdeploy * change clone with https * install mmcls * update * change mmcls version * add mmcv version * update mmcls version * test sdk * tast with imagnet * sed pipeline * print env * update * move to backend-ort ci * install mim
- Loading branch information
1 parent
71e6478
commit 5874f10
Showing
2 changed files
with
78 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
# print env | ||
python3 tools/check_env.py | ||
|
||
deploy_cfg=configs/mmcls/classification_onnxruntime_dynamic.py | ||
device=cpu | ||
model_cfg=../mmclassification/configs/resnet/resnet18_8xb32_in1k.py | ||
checkpoint=https://download.openmmlab.com/mmclassification/v0/resnet/resnet18_8xb32_in1k_20210831-fbbb1da6.pth | ||
sdk_cfg=-configs/mmcls/classification_sdk_dynamic.py | ||
input_img=../mmclassification/demo/demo.JPEG | ||
work_dir=work_dir | ||
|
||
echo "------------------------------------------------------------------------------------------------------------" | ||
echo "deploy_cfg=$deploy_cfg" | ||
echo "model_cfg=$model_cfg" | ||
echo "checkpoint=$checkpoint" | ||
echo "device=$device" | ||
echo "------------------------------------------------------------------------------------------------------------" | ||
|
||
mkdir -p $work_dir | ||
|
||
python3 tools/deploy.py \ | ||
$deploy_cfg \ | ||
$model_cfg \ | ||
$checkpoint \ | ||
$input_img \ | ||
--device $device \ | ||
--work-dir $work_dir \ | ||
--dump-info | ||
|
||
# prepare dataset | ||
wget -P data/ https://github.com/open-mmlab/mmdeploy/files/9401216/imagenet-val100.zip | ||
unzip data/imagenet-val100.zip -d data/ | ||
|
||
echo "Running test with ort" | ||
python3 tools/test.py \ | ||
$deploy_cfg \ | ||
$model_cfg \ | ||
--model $work_dir/end2end.onnx \ | ||
--device $device \ | ||
--out $work_dir/ort_out.pkl \ | ||
--metrics accuracy \ | ||
--device $device \ | ||
--log2file $work_dir/test_ort.log \ | ||
--speed-test \ | ||
--log-interval 50 \ | ||
--warmup 20 \ | ||
--batch-size 32 | ||
|
||
echo "Running test with sdk" | ||
|
||
# change topk for test | ||
sed -i 's/"topk": 5/"topk": 1000/g' work_dir/pipeline.json | ||
|
||
python3 tools/test.py \ | ||
$sdk_cfg \ | ||
$model_cfg \ | ||
--model $work_dir \ | ||
--device $device \ | ||
--out $work_dir/sdk_out.pkl \ | ||
--metrics accuracy \ | ||
--device $device \ | ||
--log2file $work_dir/test_sdk.log \ | ||
--speed-test \ | ||
--log-interval 50 \ | ||
--warmup 20 \ | ||
--batch-size 1 |
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