mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
* rename mmdeploy_python -> mmdeploy_runtime * remove incompatible build config * Revert "remove incompatible build config" This reverts commit cdc780cde52c0417e6a5408001fb5ddef1a9498d. * fix builder * update package_tools docs * fix linux set_env script * fix gcc 7.3 aligned_alloc * fix link * comment temporarily as text_det_recog can't be built with prebuild package built under manylinux
35 lines
672 B
Bash
Executable File
35 lines
672 B
Bash
Executable File
set -e
|
|
|
|
WORKSPACE="."
|
|
MODEL_DIR="/__w/mmdeploy/testmodel/mmcls"
|
|
SDK_PYTHON_DIR="mmdeploy_runtime"
|
|
|
|
if [[ -n "$1" ]]; then
|
|
WORKSPACE=$1
|
|
fi
|
|
|
|
cd $WORKSPACE
|
|
cd $SDK_PYTHON_DIR
|
|
|
|
PY_VERSION=$(python3 -V | awk '{print $2}' | awk '{split($0, a, "."); print a[1]a[2]}')
|
|
test_pkg=$(ls | grep mmdeploy_runtime-*cp${PY_VERSION}*)
|
|
|
|
python3 -m pip install $test_pkg --force-reinstall
|
|
python3 -m pip install opencv-python
|
|
|
|
code="
|
|
import cv2
|
|
from mmdeploy_runtime import Classifier
|
|
import sys
|
|
handle = Classifier('$MODEL_DIR', 'cpu', 0)
|
|
img = cv2.imread('$MODEL_DIR/demo.jpg')
|
|
try:
|
|
res = handle(img)
|
|
print(res)
|
|
except:
|
|
print('error')
|
|
sys.exit(1)
|
|
"
|
|
|
|
python3 -c "$code"
|