Skip to content

Commit e00f6f6

Browse files
committed
Replaced the raw_input() calls with a call into dlib since raw_input() isn't
available in python3.
1 parent e2680f0 commit e00f6f6

5 files changed

Lines changed: 16 additions & 5 deletions

File tree

python_examples/face_detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@
5858
win.clear_overlay()
5959
win.set_image(img)
6060
win.add_overlay(dets)
61-
raw_input("Hit enter to continue")
61+
dlib.hit_enter_to_continue()

python_examples/face_landmark_detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@
8181
win.add_overlay(shape)
8282

8383
win.add_overlay(dets)
84-
raw_input("Hit enter to continue")
84+
dlib.hit_enter_to_continue()

python_examples/train_object_detector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
win.clear_overlay()
118118
win.set_image(img)
119119
win.add_overlay(dets)
120-
raw_input("Hit enter to continue")
120+
dlib.hit_enter_to_continue()
121121

122122

123123

@@ -150,7 +150,7 @@
150150

151151
# Now let's look at its HOG filter!
152152
win_det.set_image(detector2)
153-
raw_input("Hit enter to continue")
153+
dlib.hit_enter_to_continue()
154154

155155
# Note that you don't have to use the XML based input to
156156
# test_simple_object_detector(). If you have already loaded your training

python_examples/train_shape_predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,5 @@
123123
win.add_overlay(shape)
124124

125125
win.add_overlay(dets)
126-
raw_input("Hit enter to continue")
126+
dlib.hit_enter_to_continue()
127127

tools/python/src/other.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ double _assignment_cost (
7474

7575
// ----------------------------------------------------------------------------------------
7676

77+
void hit_enter_to_continue()
78+
{
79+
std::cout << "Hit enter to continue";
80+
std::cin.get();
81+
}
82+
83+
// ----------------------------------------------------------------------------------------
84+
7785
void bind_other()
7886
{
7987
using boost::python::arg;
@@ -140,5 +148,8 @@ present in the output. "
140148
ensures \n\
141149
- saves the data to the given file in libsvm format "
142150
);
151+
152+
def("hit_enter_to_continue", hit_enter_to_continue,
153+
"Asks the user to hit enter to continue and pauses until they do so.");
143154
}
144155

0 commit comments

Comments
 (0)