Skip to content

Commit 6b369cf

Browse files
committed
fix script
1 parent 0215033 commit 6b369cf

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

weights/onnx/download.bash

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
#!/bin/bash
22

3-
# if $1 is empty
4-
if [ -z "$1" ]; then
5-
echo "Usage: $0 <target-model>"
6-
echo "Target-Models :"
7-
echo "yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l, all"
8-
exit 1
9-
fi
10-
MODEL=$1
11-
MODEL_VERSION=0.1.1rc0
12-
SCRIPT_DIR=$(cd $(dirname $0); pwd)
3+
function download {
4+
# if $1 is empty
5+
if [ -z "$1" ]; then
6+
echo "Usage: $0 <target-model>"
7+
echo "Target-Models :"
8+
echo "yolox_tiny, yolox_nano, yolox_s, yolox_m, yolox_l, all"
9+
return
10+
fi
11+
MODEL=$1
12+
MODEL_VERSION=0.1.1rc0
13+
SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)
1314

14-
echo $MODEL
15-
if [ "$MODEL" = "all" ]; then
16-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_tiny.onnx -P $SCRIPT_DIR
17-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_nano.onnx -P $SCRIPT_DIR
18-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_s.onnx -P $SCRIPT_DIR
19-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_m.onnx -P $SCRIPT_DIR
20-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_l.onnx -P $SCRIPT_DIR
21-
else
22-
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/$MODEL.onnx -P $SCRIPT_DIR
23-
fi
15+
echo $MODEL
16+
if [ "$MODEL" = "all" ]; then
17+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_tiny.onnx -P $SCRIPT_DIR
18+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_nano.onnx -P $SCRIPT_DIR
19+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_s.onnx -P $SCRIPT_DIR
20+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_m.onnx -P $SCRIPT_DIR
21+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/yolox_l.onnx -P $SCRIPT_DIR
22+
else
23+
wget https://github.com/Megvii-BaseDetection/YOLOX/releases/download/$MODEL_VERSION/$MODEL.onnx -P $SCRIPT_DIR
24+
fi
25+
}
26+
27+
download $1

weights/tensorrt/convert.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function convert {
99
fi
1010

1111
MODEL=$1
12-
SCRIPT_DIR=$(cd $(dirname $0); pwd)
12+
SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)
1313

1414
echo "Model Name: ${MODEL}"
1515
echo ""

0 commit comments

Comments
 (0)