-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from fateshelled/dev_cpp
Preprocess speed up and some fix
- Loading branch information
Showing
25 changed files
with
294 additions
and
281 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
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 |
---|---|---|
@@ -1,23 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# if $1 is empty | ||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <target-model>" | ||
echo "Target-Models :" | ||
echo "yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l, all" | ||
exit 1 | ||
fi | ||
MODEL=$1 | ||
MODEL_VERSION=0.1.1rc0 | ||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
function download { | ||
# if $1 is empty | ||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <target-model>" | ||
echo "Target-Models :" | ||
echo "yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l, all" | ||
return | ||
fi | ||
MODEL=$1 | ||
MODEL_VERSION=0.1.1rc0 | ||
SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd) | ||
|
||
echo $MODEL | ||
if [ "$MODEL" = "all" ]; then | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_tiny.onnx -P $SCRIPT_DIR | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_nano.onnx -P $SCRIPT_DIR | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_s.onnx -P $SCRIPT_DIR | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_m.onnx -P $SCRIPT_DIR | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_l.onnx -P $SCRIPT_DIR | ||
else | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/$MODEL.onnx -P $SCRIPT_DIR | ||
fi | ||
echo $MODEL | ||
if [ "$MODEL" = "all" ]; then | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_tiny.onnx -P $SCRIPT_DIR | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_nano.onnx -P $SCRIPT_DIR | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_s.onnx -P $SCRIPT_DIR | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_m.onnx -P $SCRIPT_DIR | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_l.onnx -P $SCRIPT_DIR | ||
else | ||
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/$MODEL.onnx -P $SCRIPT_DIR | ||
fi | ||
} | ||
|
||
download $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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
#!/bin/bash | ||
|
||
# if $1 is empty | ||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <target-model>" | ||
echo "Target-Models : yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l" | ||
exit 1 | ||
fi | ||
function convert { | ||
# if $1 is empty | ||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <target-model>" | ||
echo "Target-Models : yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l" | ||
return | ||
fi | ||
|
||
MODEL=$1 | ||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
MODEL=$1 | ||
SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd) | ||
|
||
echo "Model Name: ${MODEL}" | ||
echo "" | ||
echo "Model Name: ${MODEL}" | ||
echo "" | ||
|
||
ONNX_MODEL_PATH=$SCRIPT_DIR/../onnx/$MODEL.onnx | ||
if [ ! -e $ONNX_MODEL_PATH ]; then | ||
$SCRIPT_DIR/../onnx/download.bash $MODEL | ||
fi | ||
ONNX_MODEL_PATH=$SCRIPT_DIR/../onnx/$MODEL.onnx | ||
if [ ! -e $ONNX_MODEL_PATH ]; then | ||
$SCRIPT_DIR/../onnx/download.bash $MODEL | ||
fi | ||
|
||
if [ ! -e $ONNX_MODEL_PATH ]; then | ||
echo "[ERROR] Not Found ${ONNX_MODEL_PATH}" | ||
echo "[ERROR] Please check target model name." | ||
exit 1 | ||
fi | ||
if [ ! -e $ONNX_MODEL_PATH ]; then | ||
echo "[ERROR] Not Found ${ONNX_MODEL_PATH}" | ||
echo "[ERROR] Please check target model name." | ||
return | ||
fi | ||
|
||
/usr/src/tensorrt/bin/trtexec \ | ||
--onnx=$SCRIPT_DIR/../onnx/$MODEL.onnx \ | ||
--saveEngine=$SCRIPT_DIR/$MODEL.trt \ | ||
--fp16 --verbose | ||
/usr/src/tensorrt/bin/trtexec \ | ||
--onnx=$SCRIPT_DIR/../onnx/$MODEL.onnx \ | ||
--saveEngine=$SCRIPT_DIR/$MODEL.trt \ | ||
--fp16 --verbose | ||
} | ||
|
||
convert $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
Oops, something went wrong.