Skip to content

Commit 6cf7768

Browse files
committed
Update README.md
1 parent 0a71262 commit 6cf7768

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

README.md

+16-9
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,32 @@ pip install git+https://github.com/geekysethi/headpose_estimation
2828

2929
You can also install with the `setup.py`
3030

31-
## Simple API with Face Detection
31+
## With Face Detection
3232
To perform detection you can simple use the following lines:
3333

3434
```python
35-
36-
3735
import cv2
3836
from headpose_estimation import Headpose
37+
headpose = Headpose()
38+
img = cv2.imread("path_to_im.jpg")
39+
detections,image = headpose.run(img)
40+
```
3941

40-
if __name__ == "__main__":
42+
This will return a list of dictionary which looks like this `[{'bbox': [xmin, ymin, xmax, ymax], 'yaw': yaw_value, 'pitch': pitch_value, 'roll': roll_value}`
4143

42-
headpose = Headpose()
4344

44-
img = cv2.imread("path_to_im.jpg")
45-
detections,image = headpose.run(img)
46-
```
45+
## Without Face Detection
46+
To perform detection you can simple use the following lines:
4747

48-
This will return a list of dictionary which looks like this `[{'bbox': [xmin, ymin, xmax, ymax], 'yaw': yaw_value, 'pitch': pitch_value, 'roll': roll_value}`
48+
```python
49+
import cv2
50+
from headpose_estimation import Headpose
51+
headpose = Headpose(face_detection=False)
52+
imgcrop = cv2.imread("path_to_im.jpg")
53+
detections,image = headpose.run(imgcrop)
54+
```
4955

56+
In this case it will return a list of dictionary which looks like this `[{'yaw': yaw_value, 'pitch': pitch_value, 'roll': roll_value}`
5057

5158
## Dependncies
5259
* EfficientNet https://github.com/qubvel/efficientnet

headpose_estimation/headpose.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def run(self,image):
107107

108108
yaw,pitch,roll = self.detect_headpose(image)
109109

110-
final_output.append({"bbox":np.array(current_bbox),"yaw":yaw,"pitch": pitch,"roll": roll})
110+
final_output.append({"yaw":yaw,"pitch": pitch,"roll": roll})
111111
if(self.draw):
112112
height,width,_ = image.shape
113113
x_min, y_min, x_max,y_max = 0,0,width,height

0 commit comments

Comments
 (0)