run_tests.sh 4.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 --image_dir examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --display 0
15 16
  echo " "

17
  echo "Tutorial Add Module: Example 1..."
18
  ./build/examples/tutorial_add_module/1_custom_post_processing.bin --image_dir examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --display 0
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..."
28
  ./build/examples/tutorial_api_cpp/03_keypoints_from_image.bin --net_resolution -1x32 --write_json output/ --write_images output/ --no_display
G
gineshidalgo99 已提交
29 30 31
  echo " "

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

  echo "Tutorial API C++: Example 5..."
36
  ./build/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.bin --net_resolution -1x32 --write_json output/ --write_images output/ --no_display --latency_is_irrelevant_and_computer_with_lots_of_ram
G
gineshidalgo99 已提交
37 38
  # Default configuration of this demo requires getGpuNumber(), which is not implement for CPU-only mode
  # ./build/examples/tutorial_api_cpp/05_keypoints_from_images_multi_gpu.bin --net_resolution -1x32 --write_json output/ --write_images output/ --no_display
G
gineshidalgo99 已提交
39 40
  echo " "

41
  echo "Tutorial API C++: Example 6..."
42
  ./build/examples/tutorial_api_cpp/06_face_from_image.bin --face_net_resolution 32x32 --write_json output/ --write_images output/ --no_display
43 44 45
  echo " "

  echo "Tutorial API C++: Example 7..."
46
  ./build/examples/tutorial_api_cpp/07_hand_from_image.bin --hand_net_resolution 32x32 --write_json output/ --write_images output/ --no_display
47 48
  echo " "

G
gineshidalgo99 已提交
49 50 51
  echo "Tutorial API C++: Example 8..."
  ./build/examples/tutorial_api_cpp/08_heatmaps_from_image.bin --hand_net_resolution 32x32 --write_json output/ --write_images output/ --no_display
  echo " "
G
gineshidalgo99 已提交
52 53

  echo "Tutorial API C++: Example 9..."
54
  ./build/examples/tutorial_api_cpp/09_asynchronous_custom_input.bin --image_dir examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --display 0
G
gineshidalgo99 已提交
55 56 57
  echo " "

  echo "Tutorial API C++: Example 10..."
58
  ./build/examples/tutorial_api_cpp/10_asynchronous_custom_output.bin --image_dir examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --no_display
G
gineshidalgo99 已提交
59 60 61
  echo " "

  echo "Tutorial API C++: Example 11..."
62
  ./build/examples/tutorial_api_cpp/11_asynchronous_custom_input_output_and_datum.bin --image_dir examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --no_display
G
gineshidalgo99 已提交
63 64
  echo " "

65 66
  echo "Tutorial API C++: Example 12..."
  ./build/examples/tutorial_api_cpp/12_synchronous_custom_input.bin --image_dir examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --display 0
G
gineshidalgo99 已提交
67 68
  echo " "

69 70 71
  echo "Tutorial API C++: Example 13..."
  ./build/examples/tutorial_api_cpp/13_synchronous_custom_preprocessing.bin --image_dir examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --display 0
  echo " "
72

G
gineshidalgo99 已提交
73
  echo "Tutorial API C++: Example 14..."
74
  ./build/examples/tutorial_api_cpp/14_synchronous_custom_postprocessing.bin --image_dir examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --display 0
G
gineshidalgo99 已提交
75 76 77
  echo " "

  echo "Tutorial API C++: Example 15..."
78 79 80 81 82
  ./build/examples/tutorial_api_cpp/15_synchronous_custom_output.bin --image_dir examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --no_display
  echo " "

  echo "Tutorial API C++: Example 16..."
  ./build/examples/tutorial_api_cpp/16_synchronous_custom_all_and_datum.bin --image_dir examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --no_display
G
gineshidalgo99 已提交
83 84
  echo " "

85 86
  # Python examples
  if [[ $WITH_PYTHON == true ]] ; then
G
gineshidalgo99 已提交
87
    echo "Tutorial API Python: OpenPose demo..."
88
    cd build/examples/tutorial_api_python
89
    python openpose_python.py --image_dir ../../../examples/media/ --net_resolution -1x32 --write_json output/ --write_images output/ --display 0
90
    echo " "
91
    # Note: All Python examples require GUI
92 93 94 95 96 97 98 99 100
  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