diff options
author | Raviv Shalev <raviv.shalev@arm.com> | 2021-12-07 15:18:09 +0200 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2022-04-13 15:33:31 +0000 |
commit | 97ddc06e52fbcabfd8ede7a00e9494c663186b92 (patch) | |
tree | 43c84d352c3a67aa45d89760fba6c79b81c8f8dc /python/pyarmnn/examples/tests/conftest.py | |
parent | 2f0ddb67d8f9267ab600a8a26308cab32f9e16ac (diff) | |
download | armnn-97ddc06e52fbcabfd8ede7a00e9494c663186b92.tar.gz |
MLECO-2493 Add python OD example with TFLite delegate
Signed-off-by: Raviv Shalev <raviv.shalev@arm.com>
Change-Id: I25fcccbf912be0c5bd4fbfd2e97552341958af35
Diffstat (limited to 'python/pyarmnn/examples/tests/conftest.py')
-rw-r--r-- | python/pyarmnn/examples/tests/conftest.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/python/pyarmnn/examples/tests/conftest.py b/python/pyarmnn/examples/tests/conftest.py index b7fa73b852..4f1ac5f379 100644 --- a/python/pyarmnn/examples/tests/conftest.py +++ b/python/pyarmnn/examples/tests/conftest.py @@ -20,20 +20,38 @@ def test_data_folder(): data_dir = os.path.join(script_dir, "testdata") if not os.path.exists(data_dir): os.mkdir(data_dir) + + sys_arch = os.uname().machine + if sys_arch == "x86_64": + libarmnn_url = "https://github.com/ARM-software/armnn/releases/download/v21.11/ArmNN-linux-x86_64.tar.gz" + else: + libarmnn_url = "https://github.com/ARM-software/armnn/releases/download/v21.11/ArmNN-linux-aarch64.tar.gz" + + files_to_download = ["https://raw.githubusercontent.com/opencv/opencv/4.0.0/samples/data/messi5.jpg", "https://raw.githubusercontent.com/opencv/opencv/4.0.0/samples/data/basketball1.png", "https://raw.githubusercontent.com/opencv/opencv/4.0.0/samples/data/Megamind.avi", "https://github.com/ARM-software/ML-zoo/raw/master/models/object_detection/ssd_mobilenet_v1/tflite_uint8/ssd_mobilenet_v1.tflite", "https://git.mlplatform.org/ml/ethos-u/ml-embedded-evaluation-kit.git/plain/resources/kws/samples/yes.wav", - "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-speech-sdk/master/sampledata/audiofiles/myVoiceIsMyPassportVerifyMe04.wav" + "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-speech-sdk/master/sampledata/audiofiles/myVoiceIsMyPassportVerifyMe04.wav", + "https://tfhub.dev/google/lite-model/magenta/arbitrary-image-stylization-v1-256/int8/prediction/1?lite-format=tflite", + "https://tfhub.dev/google/lite-model/magenta/arbitrary-image-stylization-v1-256/int8/transfer/1?lite-format=tflite", + libarmnn_url ] for file in files_to_download: path, filename = ntpath.split(file) + if filename == '1?lite-format=tflite' and 'prediction' in file: + filename = 'style_predict.tflite' + elif filename == '1?lite-format=tflite' and 'transfer' in file: + filename = 'style_transfer.tflite' file_path = os.path.join(data_dir, filename) if not os.path.exists(file_path): print("\nDownloading test file: " + file_path + "\n") urllib.request.urlretrieve(file, file_path) + path, filename = ntpath.split(libarmnn_url) + file_path = os.path.join(data_dir, filename) + os.system(f"tar -xvzf {file_path} -C {data_dir} ") return data_dir |