Skip to content

Commit

Permalink
Add image-augmentation and image-augmentation-3d to pip integration (i…
Browse files Browse the repository at this point in the history
…ntel-analytics#833)

* add image-augmentation test

* add image-augmentation-3d test

* resolve conflict

* fix bug

* fix typo

* fix typo

* fix typo

* fix file name typo

* remove redundant lines

* fix typo

* update

* intel-analytics#10 dogs-vs-cats: time1 -> time10
  • Loading branch information
insularZJ committed Oct 29, 2018
1 parent 5e53b0a commit d0fa20d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 14 deletions.
75 changes: 61 additions & 14 deletions apps/run-app-tests-pip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fi
unset SPARK_DRIVER_MEMORY
now=$(date "+%s")
time2=$((now-start))
echo "object-detection time used:$time2 seconds"
echo "#2 object-detection time used:$time2 seconds"

echo "#3 start app test for image-similarity"
start=$(date "+%s")
Expand Down Expand Up @@ -173,6 +173,54 @@ now=$(date "+%s")
time3=$((now-start))
echo "#3 image-similarity time used:$time3 seconds"

echo "#5 start app test for using_variational_autoencoder_to_generate_digital_numbers"
#timer
start=$(date "+%s")

${ANALYTICS_ZOO_HOME}/apps/ipynb2py.sh ${ANALYTICS_ZOO_HOME}/apps/variational-autoencoder/using_variational_autoencoder_to_generate_digital_numbers

sed "s/nb_epoch = 6/nb_epoch=2/g; s/batch_size=batch_size/batch_size=1008/g" ${ANALYTICS_ZOO_HOME}/apps/variational-autoencoder/using_variational_autoencoder_to_generate_digital_numbers.py > ${ANALYTICS_ZOO_HOME}/apps/variational-autoencoder/tmp_test.py

export SPARK_DRIVER_MEMORY=12g
python ${ANALYTICS_ZOO_HOME}/apps/variational-autoencoder/tmp_test.py

exit_status=$?
if [ $exit_status -ne 0 ];
then
clear_up
echo "using_variational_autoencoder_to_generate_digital_numbers failed"
exit $exit_status
fi

unset SPARK_DRIVER_MEMORY
now=$(date "+%s")
time5=$((now-start))
echo "#5 using_variational_autoencoder_to_generate_digital_numbers time used:$time5 seconds"

echo "#9 start app test for image-augmentation"
# timer
start=$(date "+%s")

# Conversion to py file and data preparation
${ANALYTICS_ZOO_HOME}/apps/ipynb2py.sh ${ANALYTICS_ZOO_HOME}/apps/image-augmentation/image-augmentation

# Run the example
export SPARK_DRIVER_MEMORY=1g
python ${ANALYTICS_ZOO_HOME}/apps/image-augmentation/image-augmentation.py

exit_status=$?
if [ $exit_status -ne 0 ];
then
clear_up
echo "image-augmentation failed"
exit $exit_status
fi

unset SPARK_DRIVER_MEMORY
now=$(date "+%s")
time9=$((now-start))
echo "#9 image-augmentation time used:$time9 seconds"

echo "#10 start app test for dogs-vs-cats"
start=$(date "+%s")

Expand Down Expand Up @@ -223,33 +271,32 @@ fi

unset SPARK_DRIVER_MEMORY
now=$(date "+%s")
time1=$((now-start))
echo "dogs-vs-cats time used:$time1 seconds"
time10=$((now-start))
echo "#10 dogs-vs-cats time used:$time10 seconds"

echo "#5 start app test for using_variational_autoencoder_to_generate_digital_numbers"
#timer
echo "#11 start app test for image-augmentation-3d"
# timer
start=$(date "+%s")

${ANALYTICS_ZOO_HOME}/apps/ipynb2py.sh ${ANALYTICS_ZOO_HOME}/apps/variational-autoencoder/using_variational_autoencoder_to_generate_digital_numbers

sed "s/nb_epoch = 6/nb_epoch=2/g; s/batch_size=batch_size/batch_size=1008/g" ${ANALYTICS_ZOO_HOME}/apps/variational-autoencoder/using_variational_autoencoder_to_generate_digital_numbers.py > ${ANALYTICS_ZOO_HOME}/apps/variational-autoencoder/tmp_test.py
# Conversion to py file and data preparation
${ANALYTICS_ZOO_HOME}/apps/ipynb2py.sh ${ANALYTICS_ZOO_HOME}/apps/image-augmentation-3d/image-augmentation-3d

export SPARK_DRIVER_MEMORY=12g
python ${ANALYTICS_ZOO_HOME}/apps/variational-autoencoder/tmp_test.py
# Run the example
export SPARK_DRIVER_MEMORY=1g
python ${ANALYTICS_ZOO_HOME}/apps/image-augmentation-3d/image-augmentation-3d.py

exit_status=$?
if [ $exit_status -ne 0 ];
then
clear_up
echo "using_variational_autoencoder_to_generate_digital_numbers failed"
echo "image-augmentation-3d failed"
exit $exit_status
fi

unset SPARK_DRIVER_MEMORY
now=$(date "+%s")
time5=$((now-start))
echo "#5 using_variational_autoencoder_to_generate_digital_numbers time used:$time5 seconds"

time11=$((now-start))
echo "#11 image-augmentation-3d time used:$time11 seconds"

echo "#12 start app test for image_classification_inference"
#timer
Expand Down

0 comments on commit d0fa20d

Please sign in to comment.