项目作者: TUI-NICR

项目描述 :
Fast and robust upper body orientation estimation for mobile robotic applications
高级语言: Python
项目地址: git://github.com/TUI-NICR/deep-orientation.git
创建时间: 2019-03-01T07:22:06Z
项目社区:https://github.com/TUI-NICR/deep-orientation

开源协议:Other

下载


Deep Orientation

Fast and Robust Upper Body Orientation Estimation for Mobile Robotic Applications using Tensorflow (Python 3.6).

Installation

  1. Clone repository:

    1. git clone https://github.com/tui-nicr/deep-orientation.git
  2. Set up environment and install dependencies:

    1. # create Python 3.6 environment
    2. conda create --name env_deep_orientation python=3.6
    3. conda activate env_deep_orientation
    4. # install dependencies
    5. # GPU version:
    6. pip install -r /path/to/this/repository/requirements_gpu.txt [--user]
    7. # CPU version:
    8. pip install -r /path/to/this/repository/requirements_cpu.txt [--user]
    9. # opt. dependencies to plot models, see src/plot_models.py
    10. conda install graphviz pydot
  3. For network training: Download NICR RGB-D Orientation Data Set and install dataset package

Apply already trained network for orientation estimation

  • Change directory to src

    1. cd /path/to/this/repository/src
  • Apply best performing modified beyer architecture network (depth input, biternion output, mean absolute error of 5.28° on test set)

    1. # single prediction (without dropout sampling)
    2. python inference.py \
    3. beyer_mod_relu \
    4. ../trained_networks/beyer_mod_relu__depth__126x48__biternion__0_030000__1/weights_valid_0268.hdf5 \
    5. ../nicr_rgb_d_orientation_data_set_examples/small_patches \
    6. --input_type depth \
    7. --input_preprocessing standardize \
    8. --input_height 126 \
    9. --input_width 48 \
    10. --output_type biternion \
    11. --n_samples 1
    12. [--cpu]

    beyer_mod_relu_depth_without_sampling

    1. # multiple predictions to estimate uncertainty (with dropout sampling)
    2. python inference.py \
    3. beyer_mod_relu \
    4. ../trained_networks/beyer_mod_relu__depth__126x48__biternion__0_030000__1/weights_valid_0268.hdf5 \
    5. ../nicr_rgb_d_orientation_data_set_examples/small_patches \
    6. --input_type depth \
    7. --input_preprocessing standardize \
    8. --input_height 126 \
    9. --input_width 48 \
    10. --output_type biternion \
    11. --n_samples 25
    12. [--cpu]

    beyer_mod_relu_depth_with_sampling

  • Apply best performing MobileNet v2 architecture network (depth input, biternion output, mean absolute error of 5.17° on test set)

    1. # single prediction (without dropout sampling)
    2. python inference.py \
    3. mobilenet_v2 \
    4. ../trained_networks/mobilenet_v2_1_00__depth__96x96__biternion__0_001000__2/weights_valid_0268.hdf5 \
    5. ../nicr_rgb_d_orientation_data_set_examples/small_patches \
    6. --input_type depth \
    7. --input_preprocessing scale01 \
    8. --input_height 96 \
    9. --input_width 96 \
    10. --output_type biternion \
    11. --mobilenet_v2_alpha 1.00 \
    12. --n_samples 1
    13. [--cpu]

    mobilenet_v2_depth_without_sampling

    • Apply best performing RGB MobileNet v2 architecture network (rgb input, biternion output, mean absolute error of 7.98° on test set)

      1. # single prediction (without dropout sampling)
      2. python inference.py \
      3. mobilenet_v2 \
      4. ../trained_networks/mobilenet_v2_1_00__rgb__96x96__biternion__0_001000__0/weights_valid_0134.hdf5 \
      5. ../nicr_rgb_d_orientation_data_set_examples/small_patches \
      6. --input_type rgb \
      7. --input_preprocessing scale01 \
      8. --input_height 96 \
      9. --input_width 96 \
      10. --output_type biternion \
      11. --mobilenet_v2_alpha 1.00 \
      12. --n_samples 1
      13. [--cpu]

      mobilenet_v2_rgb_without_sampling

Train neural network for orientation estimation

  1. Change directory to src

    1. cd /path/to/this/repository/src
  2. Extract patches

    1. python extract_patches.py --dataset_basepath /path/to/nicr_rgb_d_orientation_data_set
  3. Train (GPU only) multiple neural networks with same hyperparameters

    1. # best performing configuration and hyperparameters from paper
    2. python train.py \
    3. beyer_mod_relu \
    4. --dataset_basepath /path/to/nicr_rgb_d_orientation_data_set \
    5. --output_basepath /path/where/to/store/training/output/files \
    6. --input_type depth \
    7. --input_preprocessing standardize \
    8. --input_height 126 \
    9. --input_width 48 \
    10. --output_type biternion \
    11. --learning_rate 0.03 \
    12. --run_id 0
    13. python train.py \
    14. beyer_mod_relu \
    15. --dataset_basepath /path/to/nicr_rgb_d_orientation_data_set \
    16. --output_basepath /path/where/to/store/training/output/files \
    17. --input_type depth \
    18. --input_preprocessing standardize \
    19. --input_height 126 \
    20. --input_width 48 \
    21. --output_type biternion \
    22. --learning_rate 0.03 \
    23. --run_id 1
    24. python train.py \
    25. beyer_mod_relu \
    26. --dataset_basepath /path/to/nicr_rgb_d_orientation_data_set \
    27. --output_basepath /path/where/to/store/training/output/files \
    28. --input_type depth \
    29. --input_preprocessing standardize \
    30. --input_height 126 \
    31. --input_width 48 \
    32. --output_type biternion \
    33. --learning_rate 0.03 \
    34. --run_id 2

    For further details and parameters, see:

    1. python train.py --help
    2. usage: train.py [-h] [-o OUTPUT_BASEPATH] [-db DATASET_BASEPATH]
    3. [-ds {small,large}] [-ts TRAINING_SET]
    4. [-vs VALIDATION_SETS [VALIDATION_SETS ...]]
    5. [-it {depth,rgb,depth_and_rgb}] [-iw INPUT_WIDTH]
    6. [-ih INPUT_HEIGHT] [-ip {standardize,scale01,none}]
    7. [-ot {regression,classification,biternion}]
    8. [-lr LEARNING_RATE] [-lrd {poly}] [-m MOMENTUM] [-ne N_EPOCHS]
    9. [-es EARLY_STOPPING] [-b BATCH_SIZE]
    10. [-vb VALIDATION_BATCH_SIZE] [-nc N_CLASSES] [-k KAPPA]
    11. [-opt {sgd,adam,rmsprop}] [-naug] [-rid RUN_ID]
    12. [--mobilenet_v2_alpha {0.35,0.5,0.75,1.0}] [-d DEVICES] [-v]
    13. {beyer,beyer_mod,beyer_mod_relu,mobilenet_v2,beyer_mod_relu_sep}
    14. Train neural network for orientation estimation
    15. positional arguments:
    16. {beyer,beyer_mod_relu,mobilenet_v2}
    17. Model to use: beyer, beyer_mod_relu or mobilenet_v2
    18. optional arguments:
    19. -h, --help show this help message and exit
    20. -o OUTPUT_BASEPATH, --output_basepath OUTPUT_BASEPATH
    21. Path where to store output files, default: '/results/rotator'
    22. -db DATASET_BASEPATH, --dataset_basepath DATASET_BASEPATH
    23. Path to downloaded dataset (default: '/datasets/rotator')
    24. -ds {small,large}, --dataset_size {small,large}
    25. Dataset image size to use. One of :('small', 'large'), default: small
    26. -ts TRAINING_SET, --training_set TRAINING_SET
    27. Set to use for training, default: training
    28. -vs VALIDATION_SETS [VALIDATION_SETS ...], --validation_sets VALIDATION_SETS [VALIDATION_SETS ...]
    29. Sets to use for validation, default: [validation, test]
    30. -it {depth,rgb,depth_and_rgb}, --input_type {depth,rgb,depth_and_rgb}
    31. Input type. One of ('depth', 'rgb', 'depth_and_rgb'), default: depth
    32. -iw INPUT_WIDTH, --input_width INPUT_WIDTH
    33. Patch width to use, default: 96
    34. -ih INPUT_HEIGHT, --input_height INPUT_HEIGHT
    35. Patch height to use, default: 96
    36. -ip {standardize,scale01,none}, --input_preprocessing {standardize,scale01,none}
    37. Preprocessing to apply. One of [standardize, scale01, none], default: standardize
    38. -ot {regression,classification,biternion}, --output_type {regression,classification,biternion}
    39. Output type. One of ('regression', 'classification', 'biternion'), default: biternion)
    40. -lr LEARNING_RATE, --learning_rate LEARNING_RATE
    41. (Base) learning rate, default: 0.01
    42. -lrd {poly}, --learning_rate_decay {poly}
    43. Learning rate decay to use, default: poly
    44. -m MOMENTUM, --momentum MOMENTUM
    45. Momentum to use, default: 0.9
    46. -ne N_EPOCHS, --n_epochs N_EPOCHS
    47. Number of epochs to train, default: 800
    48. -es EARLY_STOPPING, --early_stopping EARLY_STOPPING
    49. Number of epochs with no improvement after which training will be stopped, default: 100.To disable early stopping use -1.
    50. -b BATCH_SIZE, --batch_size BATCH_SIZE
    51. Batch size to use, default: 128
    52. -vb VALIDATION_BATCH_SIZE, --validation_batch_size VALIDATION_BATCH_SIZE
    53. Batch size to use for validation, default: 512
    54. -nc N_CLASSES, --n_classes N_CLASSES
    55. Number of classes when output_type is classification, default: 8
    56. -k KAPPA, --kappa KAPPA
    57. Kappa to use when output_type is biternion or regression, default: biternion: 1.0, regression: 0.5
    58. -opt {sgd,adam,rmsprop}, --optimizer {sgd,adam,rmsprop}
    59. Optimizer to use, default: sgd
    60. -naug, --no_augmentation
    61. Disable augmentation
    62. -rid RUN_ID, --run_id RUN_ID
    63. Run ID (default: 0)
    64. -ma {0.35,0.5,0.75,1.0}, --mobilenet_v2_alpha {0.35,0.5,0.75,1.0}
    65. Alpha value for MobileNet v2 (default: 1.0)
    66. -d DEVICES, --devices DEVICES
    67. GPU device id(s) to train on. (default: 0)
    68. -v, --verbose Enable verbose output
  4. Evaluate trained networks

    1. # this creates a json file containing a deeper analysis of the trained networks
    2. python eval.py \
    3. biternion \
    4. --dataset_basepath /path/to/nicr_rgb_d_orientation_data_set \
    5. --set test \
    6. --output_path /path/where/to/store/evaluation/output/files \
    7. --training_basepath /path/where/to/store/training/output/files

    For further details and parameters, see:

    1. python eval.py --help
    2. usage: eval.py [-h] [-o OUTPUT_PATH] [-tb TRAINING_BASEPATH]
    3. [-s {validation,test}] [-ss {training,validation,test}]
    4. [-db DATASET_BASEPATH] [-ds {small,large}] [-v]
    5. {regression,classification,biternion}
    6. Evaluate trained neural networks for orientation estimation
    7. positional arguments:
    8. {regression,classification,biternion}
    9. Output type. One of ('regression', 'classification', 'biternion') (default: biternion)
    10. optional arguments:
    11. -h, --help show this help message and exit
    12. -o OUTPUT_PATH, --output_path OUTPUT_PATH
    13. Path where to store created output files, default: '../eval_outputs/' relative to the location of this script
    14. -tb TRAINING_BASEPATH, --training_basepath TRAINING_BASEPATH
    15. Path to training outputs (default: '/results/rotator')
    16. -s {validation,test}, --set {validation,test}
    17. Set to use for evaluation, default: test
    18. -ss {training,validation,test}, --selection_set {training,validation,test}
    19. Set to use for deriving the best epoch, default: validation
    20. -db DATASET_BASEPATH, --dataset_basepath DATASET_BASEPATH
    21. Path to downloaded dataset (default: '/datasets/rotator')
    22. -ds {small,large}, --dataset_size {small,large}
    23. Dataset image size to use. One of :('small', 'large'), default: small
    24. -v, --verbose Enable verbose output

License and Citations

The source code is published under BSD 3-Clause license, see license file for details.

If you use the source code or the network weights, please cite the following paper:

Lewandowski, B., Seichter, D., Wengefeld, T., Pfennig, L., Drumm, H., Gross, H.-M.
Deep Orientation: Fast and Robust Upper Body Orientation Estimation for Mobile Robotic Applications.
in: IEEE/RSJ Int. Conf. on Intelligent Robots and Systems (IROS), Macau, pp. 441-448, IEEE 2019

  1. @InProceedings{Lewandowski-IROS-2019,
  2. author = {Lewandowski, Benjamin and Seichter, Daniel and Wengefeld, Tim and Pfennig, Lennard and Drumm, Helge and Gross, Horst-Michael},
  3. title = {Deep Orientation: Fast and Robust Upper Body Orientation Estimation for Mobile Robotic Applications},
  4. booktitle = {IEEE/RSJ Int. Conf. on Intelligent Robots and Systems (IROS), Macau},
  5. year = {2019},
  6. pages = {441--448},
  7. publisher = {IEEE},
  8. }
beyer_depth_and_rgb_biternion_(123, 54)_1647953386744.pdf
beyer_depth_and_rgb_biternion_(46, 46)_1647953387004.pdf
beyer_depth_and_rgb_biternion_(68, 68)_1647953387128.pdf
beyer_depth_and_rgb_classification_(123, 54)_1647953387279.pdf
beyer_depth_and_rgb_classification_(46, 46)_1647953387424.pdf
beyer_depth_and_rgb_classification_(68, 68)_1647953387501.pdf
beyer_depth_and_rgb_regression_(123, 54)_1647953387641.pdf
beyer_depth_and_rgb_regression_(46, 46)_1647953387737.pdf
beyer_depth_and_rgb_regression_(68, 68)_1647953387839.pdf
beyer_depth_biternion_(123, 54)_1647953387965.pdf
beyer_depth_biternion_(46, 46)_1647953388119.pdf
beyer_depth_biternion_(68, 68)_1647953388288.pdf
beyer_depth_classification_(123, 54)_1647953388443.pdf
beyer_depth_classification_(46, 46)_1647953388594.pdf
beyer_depth_classification_(68, 68)_1647953388743.pdf
beyer_depth_regression_(123, 54)_1647953388871.pdf
beyer_depth_regression_(46, 46)_1647953388950.pdf
beyer_depth_regression_(68, 68)_1647953389064.pdf
beyer_rgb_biternion_(123, 54)_1647953389240.pdf
beyer_rgb_biternion_(46, 46)_1647953389345.pdf
beyer_rgb_biternion_(68, 68)_1647953389501.pdf
beyer_rgb_classification_(123, 54)_1647953389667.pdf
beyer_rgb_classification_(46, 46)_1647953389822.pdf
beyer_rgb_classification_(68, 68)_1647953389971.pdf
beyer_rgb_regression_(123, 54)_1647953390147.pdf
beyer_rgb_regression_(46, 46)_1647953390280.pdf
beyer_rgb_regression_(68, 68)_1647953390387.pdf
beyer_mod_relu_depth_and_rgb_biternion_(126, 48)_1647953390539.pdf
beyer_mod_relu_depth_and_rgb_biternion_(48, 48)_1647953390807.pdf
beyer_mod_relu_depth_and_rgb_biternion_(96, 96)_1647953390972.pdf
beyer_mod_relu_depth_and_rgb_classification_(126, 48)_1647953391127.pdf
beyer_mod_relu_depth_and_rgb_classification_(48, 48)_1647953391299.pdf
beyer_mod_relu_depth_and_rgb_classification_(96, 96)_1647953391506.pdf
beyer_mod_relu_depth_and_rgb_regression_(126, 48)_1647953391649.pdf
beyer_mod_relu_depth_and_rgb_regression_(48, 48)_1647953391810.pdf
beyer_mod_relu_depth_and_rgb_regression_(96, 96)_1647953391978.pdf
beyer_mod_relu_depth_biternion_(126, 48)_1647953392129.pdf
beyer_mod_relu_depth_biternion_(48, 48)_1647953392329.pdf
beyer_mod_relu_depth_biternion_(96, 96)_1647953392425.pdf
beyer_mod_relu_depth_classification_(126, 48)_1647953392615.pdf
beyer_mod_relu_depth_classification_(48, 48)_1647953392717.pdf
beyer_mod_relu_depth_classification_(96, 96)_1647953392893.pdf
beyer_mod_relu_depth_regression_(126, 48)_1647953393052.pdf
beyer_mod_relu_depth_regression_(48, 48)_1647953393208.pdf
beyer_mod_relu_depth_regression_(96, 96)_1647953393367.pdf
beyer_mod_relu_rgb_biternion_(126, 48)_1647953393625.pdf
beyer_mod_relu_rgb_biternion_(48, 48)_1647953393752.pdf
beyer_mod_relu_rgb_biternion_(96, 96)_1647953393908.pdf
beyer_mod_relu_rgb_classification_(126, 48)_1647953394046.pdf
beyer_mod_relu_rgb_classification_(48, 48)_1647953394253.pdf
beyer_mod_relu_rgb_classification_(96, 96)_1647953394384.pdf
beyer_mod_relu_rgb_regression_(126, 48)_1647953394524.pdf
beyer_mod_relu_rgb_regression_(48, 48)_1647953394687.pdf
beyer_mod_relu_rgb_regression_(96, 96)_1647953394872.pdf
mobilenet_v2_0_35_depth_biternion_(96, 96)_1647953394999.pdf
mobilenet_v2_0_35_depth_biternion_(96, 96)_mobilenetv2_0.35_96_1647953395192.pdf
mobilenet_v2_0_35_depth_classification_(96, 96)_1647953395277.pdf
mobilenet_v2_0_35_depth_classification_(96, 96)_mobilenetv2_0.35_96_1647953395410.pdf
mobilenet_v2_0_35_depth_regression_(96, 96)_1647953395467.pdf
mobilenet_v2_0_35_depth_regression_(96, 96)_mobilenetv2_0.35_96_1647953395649.pdf
mobilenet_v2_0_35_rgb_biternion_(96, 96)_1647953395680.pdf
mobilenet_v2_0_35_rgb_biternion_(96, 96)_mobilenetv2_0.35_96_1647953395817.pdf
mobilenet_v2_0_35_rgb_classification_(96, 96)_1647953395862.pdf
mobilenet_v2_0_35_rgb_classification_(96, 96)_mobilenetv2_0.35_96_1647953395968.pdf
mobilenet_v2_0_35_rgb_regression_(96, 96)_1647953395984.pdf
mobilenet_v2_0_35_rgb_regression_(96, 96)_mobilenetv2_0.35_96_1647953396128.pdf
mobilenet_v2_0_5_depth_biternion_(96, 96)_1647953396143.pdf
mobilenet_v2_0_5_depth_biternion_(96, 96)_mobilenetv2_0.50_96_1647953396384.pdf
mobilenet_v2_0_5_depth_classification_(96, 96)_1647953396473.pdf
mobilenet_v2_0_5_depth_classification_(96, 96)_mobilenetv2_0.50_96_1647953396599.pdf
mobilenet_v2_0_5_depth_regression_(96, 96)_1647953396614.pdf
mobilenet_v2_0_5_depth_regression_(96, 96)_mobilenetv2_0.50_96_1647953396734.pdf
mobilenet_v2_0_5_rgb_biternion_(96, 96)_1647953396772.pdf
mobilenet_v2_0_5_rgb_biternion_(96, 96)_mobilenetv2_0.50_96_1647953396985.pdf
mobilenet_v2_0_5_rgb_classification_(96, 96)_1647953397039.pdf
mobilenet_v2_0_5_rgb_classification_(96, 96)_mobilenetv2_0.50_96_1647953397173.pdf
mobilenet_v2_0_5_rgb_regression_(96, 96)_1647953397201.pdf
mobilenet_v2_0_5_rgb_regression_(96, 96)_mobilenetv2_0.50_96_1647953397291.pdf
mobilenet_v2_0_75_depth_biternion_(96, 96)_1647953397307.pdf
mobilenet_v2_0_75_depth_biternion_(96, 96)_mobilenetv2_0.75_96_1647953397393.pdf
mobilenet_v2_0_75_depth_classification_(96, 96)_1647953397438.pdf
mobilenet_v2_0_75_depth_classification_(96, 96)_mobilenetv2_0.75_96_1647953397662.pdf
mobilenet_v2_0_75_depth_regression_(96, 96)_1647953397729.pdf
mobilenet_v2_0_75_depth_regression_(96, 96)_mobilenetv2_0.75_96_1647953397876.pdf
mobilenet_v2_0_75_rgb_biternion_(96, 96)_1647953397892.pdf
mobilenet_v2_0_75_rgb_biternion_(96, 96)_mobilenetv2_0.75_96_1647953397987.pdf
mobilenet_v2_0_75_rgb_classification_(96, 96)_1647953398059.pdf
mobilenet_v2_0_75_rgb_classification_(96, 96)_mobilenetv2_0.75_96_1647953398192.pdf
mobilenet_v2_0_75_rgb_regression_(96, 96)_1647953398243.pdf
mobilenet_v2_0_75_rgb_regression_(96, 96)_mobilenetv2_0.75_96_1647953398398.pdf
mobilenet_v2_1_0_depth_biternion_(96, 96)_1647953398453.pdf
mobilenet_v2_1_0_depth_biternion_(96, 96)_mobilenetv2_1.00_96_1647953398545.pdf
mobilenet_v2_1_0_depth_classification_(96, 96)_1647953398612.pdf
mobilenet_v2_1_0_depth_classification_(96, 96)_mobilenetv2_1.00_96_1647953398678.pdf
mobilenet_v2_1_0_depth_regression_(96, 96)_1647953398705.pdf
mobilenet_v2_1_0_depth_regression_(96, 96)_mobilenetv2_1.00_96_1647953398825.pdf
mobilenet_v2_1_0_rgb_biternion_(96, 96)_1647953398858.pdf
mobilenet_v2_1_0_rgb_biternion_(96, 96)_mobilenetv2_1.00_96_1647953398955.pdf
mobilenet_v2_1_0_rgb_classification_(96, 96)_1647953399009.pdf
mobilenet_v2_1_0_rgb_classification_(96, 96)_mobilenetv2_1.00_96_1647953399139.pdf