Commit 8e86dcd1 authored by Dan J's avatar Dan J Committed by drpngx
Browse files

Automate download and unzip of the model file (#14853)

TESTING

Used Android Studio 3.1.3, NDK r17b and Pixel XL API 24 emulator.

Blocked from testing the built app due to this issue: https://github.com/tensorflow/tensorflow/issues/18658

Did a ./gradlew clean.  Deleted intermediate download and unzipped versions of the model:
```
$ rm app/build/intermediates/mobilenet_v1_224_android_quant_2017_11_08.zip
$ rm app/src/main/assets/mobilenet_quant_v1_224.tflite
```

Built the app and confirmed the model got downloaded and unzipped:
```
$ ./gradlew assemble
<snip>
:app:downloadModel
Downloading https://storage.googleapis.com/download.tensorflow.org/models/tflite/mobilenet_v1_224_android_quant_2017_11_08.zip
:app:unzipModel
Unzipping build/intermediates/mobilenet_v1_224_android_quant_2017_11_08.zip
:app:preBuild
<snip>
```

Deleted the model file from the assets folder and checked it gets unzipped again from the intermediate storage location:
```
$ ./gradlew assemble
<snip>
:app:downloadModel UP-TO-DATE
:app:unzipModel
Unzipping build/intermediates/mobilenet_v1_224_android_quant_2017_11_08.zip
:app:preBuild
<snip>
```

Built it again and check it doesn't get downloaded or unzipped again:
```
$ ./gradlew assemble
<snip>
:app:downloadModel UP-TO-DATE
:app:unzipModel UP-TO-DATE
<snip>
```
parent ab9b1341
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment