run_tests.sh 3.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/bash

# Test the project

BASEDIR=$(dirname $0)
source $BASEDIR/defaults.sh

# Only for NAME="default-cmake-cpu" WITH_CUDA=false
if [[ $RUN_EXAMPLES == true ]] ; then
  echo "Running demos and tutorials..."
  echo " "

  echo "OpenPose demo..."
14
  ./build/examples/openpose/openpose.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --write_images output/ --display 0 --render_pose 1
15 16
  echo " "

17
  echo "Tutorial Add Module: Example 1..."
18
  ./build/examples/tutorial_add_module/1_custom_post_processing.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --write_images output/ --display 0 --render_pose 1
19 20
  echo " "

G
gineshidalgo99 已提交
21
  # # Note: Examples 1-2 require the whole OpenPose resolution (too much RAM memory) and the GUI
G
gineshidalgo99 已提交
22
  # echo "Tutorial API C++: Examples 1-2..."
G
gineshidalgo99 已提交
23 24
  # ./build/examples/tutorial_api_cpp/01_body_from_image_default.bin
  # ./build/examples/tutorial_api_cpp/02_whole_body_from_image_default.bin
25 26
  # echo " "

G
gineshidalgo99 已提交
27
  echo "Tutorial API C++: Example 3..."
G
gineshidalgo99 已提交
28
  ./build/examples/tutorial_api_cpp/03_keypoints_from_image.bin --no_display --net_resolution -1x32 --write_json output/
G
gineshidalgo99 已提交
29 30 31
  echo " "

  echo "Tutorial API C++: Example 4..."
G
gineshidalgo99 已提交
32
  ./build/examples/tutorial_api_cpp/04_keypoints_from_images.bin --no_display --net_resolution -1x32 --write_json output/
G
gineshidalgo99 已提交
33 34 35
  echo " "

  echo "Tutorial API C++: Example 5..."
G
gineshidalgo99 已提交
36
  ./build/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.bin --no_display --net_resolution -1x32 --write_json output/
G
gineshidalgo99 已提交
37 38
  echo " "

39
  echo "Tutorial API C++: Example 6..."
40
  ./build/examples/tutorial_api_cpp/06_asynchronous_custom_input.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --write_images output/ --display 0 --render_pose 1
41 42 43
  echo " "

  echo "Tutorial API C++: Example 7..."
G
gineshidalgo99 已提交
44
  ./build/examples/tutorial_api_cpp/07_asynchronous_custom_output.bin --no_display --net_resolution -1x32 --image_dir examples/media/
45 46
  echo " "

G
gineshidalgo99 已提交
47
  echo "Tutorial API C++: Example 8..."
G
gineshidalgo99 已提交
48
  ./build/examples/tutorial_api_cpp/08_asynchronous_custom_input_output_and_datum.bin --no_display --net_resolution -1x32 --image_dir examples/media/
G
gineshidalgo99 已提交
49 50 51
  echo " "

  echo "Tutorial API C++: Example 9..."
G
gineshidalgo99 已提交
52 53 54 55 56 57 58 59
  ./build/examples/tutorial_api_cpp/09_face_from_image.bin --no_display --face_net_resolution 32x32
  echo " "

  echo "Tutorial API C++: Example 10..."
  ./build/examples/tutorial_api_cpp/10_hand_from_image.bin --no_display --hand_net_resolution 32x32
  echo " "

  echo "Tutorial API C++: Example 11..."
60
  ./build/examples/tutorial_api_cpp/11_synchronous_custom_input.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --write_images output/ --display 0 --render_pose 1
G
gineshidalgo99 已提交
61 62 63
  echo " "

  echo "Tutorial API C++: Example 13..."
64
  ./build/examples/tutorial_api_cpp/13_synchronous_custom_postprocessing.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --write_images output/ --display 0 --render_pose 1
G
gineshidalgo99 已提交
65 66 67 68 69 70 71 72
  echo " "

  echo "Tutorial API C++: Example 14..."
  ./build/examples/tutorial_api_cpp/14_synchronous_custom_output.bin  --no_display --net_resolution -1x32 --image_dir examples/media/
  echo " "

  echo "Tutorial API C++: Example 15..."
  ./build/examples/tutorial_api_cpp/15_synchronous_custom_all.bin  --no_display --net_resolution -1x32 --image_dir examples/media/
G
gineshidalgo99 已提交
73 74
  echo " "

75 76
  # Python examples
  if [[ $WITH_PYTHON == true ]] ; then
G
gineshidalgo99 已提交
77
    echo "Tutorial API Python: OpenPose demo..."
78
    cd build/examples/tutorial_api_python
79
    python openpose_python.py --net_resolution -1x32 --image_dir ../../../examples/media/ --write_json output/ --write_images output/ --display 0 --render_pose 1
80
    echo " "
81
    # Note: All Python examples require GUI
82 83 84 85 86 87 88 89 90
  fi

  echo "Demos and tutorials successfully finished!"

# Disable examples for all other Travis Build configurations
else
  echo "Skipping tests for non CPU-only versions."
  exit 0
fi