@@ -37,8 +37,123 @@ Windows (MS Visual Studio): |
37 | 37 | - A static library will be written to the "lib" directory. |
38 | 38 | - The execuables can be found in the "bin" directory. |
39 | 39 |
|
| 40 | + |
40 | 41 | ---------------------------------------------------------- |
41 | 42 | Running the various programs: |
42 | 43 | ---------------------------------------------------------- |
43 | 44 | * On Linux or Mac: ./bin/program_name --help |
44 | 45 | * On Windows: bin\Debug\program_name --help |
| 46 | + |
| 47 | + |
| 48 | +---------------------------------------------------------- |
| 49 | +Mini tutorial: |
| 50 | +---------------------------------------------------------- |
| 51 | +(Follow these steps in the order 1 to 10) |
| 52 | + |
| 53 | +1. Create "annotations.yaml": |
| 54 | +--------- |
| 55 | +Usage: |
| 56 | +> ./annotate [-v video] [-m muct_dir] [-d output_dir] |
| 57 | +- video: video containing frames to annotate. |
| 58 | +- muct_dir: directory containing "muct-landmarks/muct76-opencv.csv", the pre-annotated MUCT dataset (http://www.milbo.org/muct/). |
| 59 | +- output_dir: contains the annotation file and annotated images (if using -v) |
| 60 | +Example: |
| 61 | +> mkdir muct |
| 62 | +> ./annotate -m ${MY_MUCT_DIR}/ -d muct/ |
| 63 | + |
| 64 | +2. Visualise annotations: |
| 65 | +---------- |
| 66 | +Usage: |
| 67 | +> ./visualise_annotation annotation_file |
| 68 | +Example: |
| 69 | +> ./visualize_annotations muct/annotations.yaml |
| 70 | +Keys: |
| 71 | +- 'p': show next image and annotations |
| 72 | +- 'o': show previous image and annotations |
| 73 | +- 'f': show flipped image and annotations |
| 74 | + |
| 75 | +3. Train shape model: |
| 76 | +---------- |
| 77 | +Usage: |
| 78 | +> ./train_shape_model annotation_file shape_model_file [-f fraction_of_variation] [-k maximum_modes] [--mirror] |
| 79 | +- annotation_file: generated by "annotate" |
| 80 | +- shape_model_file: output YAML file containing trained shape model |
| 81 | +- fraction_of_variation: A fraction between 0 and 1 specifying ammount of variation to retain |
| 82 | +- maximum_modes: A cap on the number of modes the shape model can have |
| 83 | +- mirror: Use mirrored images as samples (only use if symmety points were specified in "annotate") |
| 84 | +Example: |
| 85 | +> ./train_shape_model muct/annotations.yaml muct/shape_model.yaml |
| 86 | + |
| 87 | +4. Visualise shape model: |
| 88 | +----------- |
| 89 | +Usage: |
| 90 | +> ./visualise_shape_model shape_model |
| 91 | +- shape_model: generated using "train_shape_model" |
| 92 | +Example: |
| 93 | +> ./visualize_shape_model muct/shape_model.yaml |
| 94 | + |
| 95 | +5. Train patch detectors: |
| 96 | +-------------- |
| 97 | +Usage: |
| 98 | +> ./train_patch_model annotation_file shape_model_file patch_model_file[-w face_width] [-p patch_size] [-s search_window_size] [--mirror] |
| 99 | +- annotation_file: generated by "annotate" |
| 100 | +- shape_model_file: generated by "train_shape_model" |
| 101 | +- patch_model_file: output YAML file containing trained patch model |
| 102 | +- face_width: How many pixels-wide the reference face is |
| 103 | +- patch_size: How many pixels-wide the patches are in the reference face image |
| 104 | +- search_window_Size: How many pixels-wide the search region is |
| 105 | +- mirror: Use mirrored images as samples (only use if symmety points were specified in "annotate") |
| 106 | +Example: |
| 107 | +> ./train_patch_model muct/annotations.yaml muct/shape_model.yaml muct/patch_model.yaml |
| 108 | + |
| 109 | +6. Visualise patch detectors: |
| 110 | +------------ |
| 111 | +Usage: |
| 112 | +> ./visualise_patch_model patch_model [-w face_width] |
| 113 | +- patch_model: generated using "train_patch_model" |
| 114 | +- face_width: Width of face to visualise patches on |
| 115 | +Example: |
| 116 | +> ./visualize_patch_model muct/patch_model.yaml |
| 117 | + |
| 118 | +7. Build face detector: |
| 119 | +------------ |
| 120 | +Usage: |
| 121 | +> ./train_face_detector detector_file annotation_file shape_model_file detector_model_file [-f min_frac_of_pts_in_det_rect] [--mirror] |
| 122 | +- detector_file: pre-trained OpenCV cascade face detector (look in the data directory of the OpenCV package) |
| 123 | +- annotation_file: generated using "annotate" |
| 124 | +- shape_model_file: generated using "train_shape_model" |
| 125 | +- detector_model_file: output YAML file containing face detector model |
| 126 | +- min_frac_of_pts_in_det_rect: Minimum fraction of points inside detection window for sample to be considered and inlier for training |
| 127 | +- mirror: Use mirrored images as samples (only use if symmety points were specified in "annotate") |
| 128 | +Example: |
| 129 | +> ./train_face_detector ${MY_OPENCV_DIR}/data/lbpcascades/lbpcascade_frontalface.xml muct/annotations.yaml muct/shape_model.yaml muct/detector.yaml |
| 130 | + |
| 131 | +8. Visualise face detector: |
| 132 | +------------ |
| 133 | +Usage: |
| 134 | +> ./visualise_face detector [video_file] |
| 135 | +- detector: generated using "train_face_detector" |
| 136 | +- video_file: Optional video to test results on. Default is to use webcam |
| 137 | +Example: |
| 138 | +> ./visualize_face_detector muct/detector.yaml |
| 139 | + |
| 140 | +9. Train face tracker: |
| 141 | +----------- |
| 142 | +Usage: |
| 143 | +> ./train_face_tracker shape_model_file patch_models_file face_detector_file face_tracker_file |
| 144 | +- shape_model_file: generated using "train_shape_model" |
| 145 | +- patch_model_file: generated using "train_patch_model" |
| 146 | +- face_detector_file: generated using "train_face_detector" |
| 147 | +- face_tracker_file: output YAML file containing face tracker model |
| 148 | +Example: |
| 149 | +> ./train_face_tracker muct/shape_model.yaml muct/patch_model.yaml muct/detector.yaml muct/tracker.yaml |
| 150 | + |
| 151 | +10. Test face tracker: |
| 152 | +---------- |
| 153 | +Usage: |
| 154 | +> ./visualise_face_tracker tracker [video_file] |
| 155 | +- tracker: generated using "train_face_tracker" |
| 156 | +- video_file: Optional video to test tracker on. Default is to use webcam |
| 157 | +Example: |
| 158 | +./visualize_face_tracker muct/tracker.yaml |
| 159 | + |