3 # Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # See https://github.com/Samsung/ONE/issues/4155 for information
19 SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20 pushd $SCRIPT_PATH > /dev/null
22 if [[ ! -s "inception_v3.pb" ]]; then
23 rm -rf inception_v3_2018_04_27.tgz
24 wget https://storage.googleapis.com/download.tensorflow.org/models/tflite/model_zoo/upload_20180427/inception_v3_2018_04_27.tgz
25 tar zxvf inception_v3_2018_04_27.tgz
28 if [[ ! -s "while_3.pbtxt" ]]; then
30 wget https://github.com/Samsung/ONE/files/5095630/while_3.zip
32 # https://github.com/Samsung/ONE/issues/4155#issuecomment-689320297
35 if [[ ! -s "mobilenet_test_data.h5" ]]; then
36 rm -rf mobilenet_test_data.zip
37 wget https://github.com/Samsung/ONE/files/5139460/mobilenet_test_data.zip
38 unzip mobilenet_test_data.zip
39 # https://github.com/Samsung/ONE/issues/4155#issuecomment-689321538
42 if [[ ! -s "bcq.pb" ]]; then
44 wget https://github.com/Samsung/ONE/files/5153842/bcq.pb.zip
46 # https://github.com/Samsung/ONE/issues/4155#issuecomment-689324597
49 if [[ ! -s "img_files" ]]; then
51 wget https://github.com/Samsung/ONE/files/5499172/img_files.zip
53 # https://github.com/Samsung/ONE/issues/3213#issuecomment-722757499
56 if [ ! -d "raw_files" ] || [ ! -s "datalist.txt" ]; then
57 ../bin/venv/bin/python preprocess_images.py
60 if [[ ! -s "inception_v3_test_data.h5" ]]; then
61 ../bin/venv/bin/python ../bin/rawdata2hdf5 \
62 --data_list datalist.txt \
63 --output_path inception_v3_test_data.h5
66 # prepare 'inception_v3.circle' file used for quantization test
67 inputfile="./inception_v3.pb"
68 outputfile="./inception_v3.circle"
70 if [[ ! -s ${outputfile} ]]; then
71 ../bin/one-import-tf \
72 --input_path ${inputfile} \
73 --output_path ${outputfile} \
74 --input_arrays input --input_shapes "1,299,299,3" \
75 --output_arrays InceptionV3/Predictions/Reshape_1