modifications for Edgeptu
@@ -22,8 +22,13 @@ wget ${PACKAGE_URL}/${PACKAGE_NAME}
########################################################################
echo
+
+# Edgetpu extracts as a different name other than PACKAGE_NAME
+if ["${VERSION}" != "edgetpu" ]; then
echo "Unpack weights file ${PACKAGE_NAME} ..."
tar -zxvf ${PACKAGE_NAME}
+fi
+
# Exception: v2 quantized unpacks into a subdirectory.
if [[ -d ${PACKAGE_NAME_V2_QUANT} ]]; then
@@ -41,6 +46,39 @@ if [[ -d ${PACKAGE_NAME_MOBILENET_V3} ]]; then
rmdir ${PACKAGE_NAME_MOBILENET_V3}
fi
+# Exception: edgetpu also unpacks into subdirectory
+# note that this has multiple names when unpacking
+if ["${VERSION}" == "edgetpu" ]; then
+ echo "Unpack weights file ${PACKAGE_NAME_EDGTPU_TGZ} ..."
+ tar -zxvf ${PACKAGE_NAME_EDGETPU_TGZ}
+
+ if [[ -d ${PACKAGE_NAME_EDGETPU} ]]; then
+ echo
+ echo "Move files out of ${PACKAGE_NAME_EDGETPU}/ ..."
+ mv ${PACKAGE_NAME_EDGETPU_FOLDER}/* ${PACKAGE_NAME_EDGETPU}/..
+ rmdir ${PACKAGE_NAME_EDGETPU}
+ fi
+
+ if [ "${MODEL_MOBILENET_PRECISION}" == "int8" ]; then
+ file1_to_remove="${PACKAGE_NAME_EDGETPU}_uint8.tflite"
+ file2_to_remove="${PACKAGE_NAME_EDGETPU}_float.tflite"
+ echo "Removing file ${file1_to_remove} ${file2_to_remove}"
+ rm ${file1_to_remove} ${file2_to_remove}
+ elif [ "${MODEL_MOBILENET_PRECISION}" == "uint8" ]; then
+ file1_to_remove="${PACKAGE_NAME_EDGETPU}_int8.tflite"
+ file2_to_remove="${PACKAGE_NAME_EDGETPU}_float.tflite"
+ echo "Removing file ${file1_to_remove} ${file2_to_remove}"
+ rm ${file1_to_remove} ${file2_to_remove}
+ else
+ file1_to_remove="${PACKAGE_NAME_EDGETPU}_uint8.tflite"
+ file2_to_remove="${PACKAGE_NAME_EDGETPU}_int8.tflite"
+ echo "Removing file ${file1_to_remove} ${file2_to_remove}"
+ rm ${file1_to_remove} ${file2_to_remove}
+ fi
+
+fi
+
+
########################################################################
echo
echo "Remove temporary files ..."
