Skip to content

How to use Hand detection script

Hitansh Singla edited this page Jul 1, 2019 · 1 revision

To detect, crop and save hands from the original data, we need the following:

  1. Master branch
  2. Dvc data

Directory structure should look like

  • xray
    • TensorFlow
    • data
      • train
        • XR_HAND
    • src
      • features
        • hand_detection
  1. cd into /src/features/hand_detection
  2. Change the following as per your desires:
  • PATH_TO_TEST_IMAGES_DIR = '../../../train/XR_HAND_CROPPED'
  • SAVE_PATH = r'../../../train/XR_HAND_CENTRED_NEW'
  1. Now you can run the script using python3 detect_and_save_hands.py
  2. It will save the detected hands in the save_path.
  3. Possible errors that may occur:
  • No model found: mainly due to dvc pull issue
  • Protobuf issue: Check this
  • object detection util not found issue: this line should be above that import statement. os.chdir(r'../../../data/TensorFlow/workspace/training_demo/')