Skip to content

Commit a10f83c

Browse files
authored
Merge branch 'master' into smartlab_models
2 parents dedf359 + d155e5d commit a10f83c

File tree

8 files changed

+67
-26
lines changed

8 files changed

+67
-26
lines changed

demos/gaze_estimation_demo/cpp/src/results_marker.cpp

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,34 @@ void ResultsMarker::mark(cv::Mat& image, const FaceInferenceResults& faceInferen
6060
auto xCenter = faceBoundingBox.x + faceBoundingBoxWidth / 2;
6161
auto yCenter = faceBoundingBox.y + faceBoundingBoxHeight / 2;
6262

63-
// center to right
63+
// OX points from face center to camera
64+
// OY points from face center to right
65+
// OZ points from face center to up
66+
67+
// Rotation matrix:
68+
// Yaw - counterclockwise Pitch - counterclockwise Roll - clockwise
69+
// [cosY -sinY 0] [ cosP 0 sinP] [1 0 0 ]
70+
// [sinY cosY 0] * [ 0 1 0 ] * [0 cosR sinR] =
71+
// [ 0 0 1] [-sinP 0 cosP] [0 -sinR cosR]
72+
73+
// [cosY*cosP cosY*sinP*sinR-sinY*cosR cosY*sinP*cosR+sinY*sinR]
74+
// = [sinY*cosP cosY*cosR-sinY*sinP*sinR sinY*sinP*cosR+cosY*sinR]
75+
// [ -sinP -cosP*sinR cosP*cosR ]
76+
77+
// Multiply third row by -1 because screen drawing axis points down
78+
// Drop first row to project to a screen plane
79+
80+
// OY: center to right
6481
cv::line(image, cv::Point(xCenter, yCenter),
65-
cv::Point(static_cast<int>(xCenter + axisLength * (cosR * cosY + sinY * sinP * sinR)),
82+
cv::Point(static_cast<int>(xCenter + axisLength * (cosR * cosY - sinY * sinP * sinR)),
6683
static_cast<int>(yCenter + axisLength * cosP * sinR)),
6784
cv::Scalar(0, 0, 255), 2);
68-
// center to top
85+
// OZ: center to top
6986
cv::line(image, cv::Point(xCenter, yCenter),
7087
cv::Point(static_cast<int>(xCenter + axisLength * (cosR * sinY * sinP + cosY * sinR)),
7188
static_cast<int>(yCenter - axisLength * cosP * cosR)),
7289
cv::Scalar(0, 255, 0), 2);
73-
// center to forward
90+
// OX: center to camera
7491
cv::line(image, cv::Point(xCenter, yCenter),
7592
cv::Point(static_cast<int>(xCenter + axisLength * sinY * cosP),
7693
static_cast<int>(yCenter + axisLength * sinP)),

demos/gaze_estimation_demo/cpp_gapi/src/results_marker.cpp

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,38 @@ void ResultsMarker::mark(cv::Mat& image, const FaceInferenceResults& faceInferen
6666
auto xCenter = faceBoundingBox.x + faceBoundingBoxWidth / 2;
6767
auto yCenter = faceBoundingBox.y + faceBoundingBoxHeight / 2;
6868

69-
// center to right
70-
cv::line(image,
71-
cv::Point(xCenter, yCenter),
72-
cv::Point(static_cast<int>(xCenter + axisLength * (cosR * cosY + sinY * sinP * sinR)),
69+
// OX points from face center to camera
70+
// OY points from face center to right
71+
// OZ points from face center to up
72+
73+
// Rotation matrix:
74+
// Yaw - counterclockwise Pitch - counterclockwise Roll - clockwise
75+
// [cosY -sinY 0] [ cosP 0 sinP] [1 0 0 ]
76+
// [sinY cosY 0] * [ 0 1 0 ] * [0 cosR sinR] =
77+
// [ 0 0 1] [-sinP 0 cosP] [0 -sinR cosR]
78+
79+
// [cosY*cosP cosY*sinP*sinR-sinY*cosR cosY*sinP*cosR+sinY*sinR]
80+
// = [sinY*cosP cosY*cosR-sinY*sinP*sinR sinY*sinP*cosR+cosY*sinR]
81+
// [ -sinP -cosP*sinR cosP*cosR ]
82+
83+
// Multiply third row by -1 because screen drawing axis points down
84+
// Drop first row to project to a screen plane
85+
86+
// OY: center to right
87+
cv::line(image, cv::Point(xCenter, yCenter),
88+
cv::Point(static_cast<int>(xCenter + axisLength * (cosR * cosY - sinY * sinP * sinR)),
7389
static_cast<int>(yCenter + axisLength * cosP * sinR)),
74-
cv::Scalar(0, 0, 255),
75-
2);
76-
// center to top
77-
cv::line(image,
78-
cv::Point(xCenter, yCenter),
90+
cv::Scalar(0, 0, 255), 2);
91+
// OZ: center to top
92+
cv::line(image, cv::Point(xCenter, yCenter),
7993
cv::Point(static_cast<int>(xCenter + axisLength * (cosR * sinY * sinP + cosY * sinR)),
8094
static_cast<int>(yCenter - axisLength * cosP * cosR)),
81-
cv::Scalar(0, 255, 0),
82-
2);
83-
// center to forward
84-
cv::line(image,
85-
cv::Point(xCenter, yCenter),
95+
cv::Scalar(0, 255, 0), 2);
96+
// OX: center to camera
97+
cv::line(image, cv::Point(xCenter, yCenter),
8698
cv::Point(static_cast<int>(xCenter + axisLength * sinY * cosP),
8799
static_cast<int>(yCenter + axisLength * sinP)),
88-
cv::Scalar(255, 0, 255),
89-
2);
100+
cv::Scalar(255, 0, 255), 2);
90101

91102
putHighlightedText(
92103
image,

models/intel/head-pose-estimation-adas-0001/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ Head pose estimation network based on simple, handmade CNN architecture. Angle r
66
layers are convolutions + ReLU + batch norm + fully connected with
77
one output.
88

9+
The estimator outputs yaw pitch and roll angles measured in degrees. Suppose the following coordinate system:
10+
* OX points from face center to camera
11+
* OY points from face center to right
12+
* OZ points from face center to up
13+
14+
The predicted angles show how the face is rotated according to a rotation matrix:
15+
```
16+
Yaw - counterclockwise Pitch - counterclockwise Roll - clockwise
17+
[cosY -sinY 0] [ cosP 0 sinP] [1 0 0 ] [cosY*cosP cosY*sinP*sinR-sinY*cosR cosY*sinP*cosR+sinY*sinR]
18+
[sinY cosY 0] * [ 0 1 0 ] * [0 cosR sinR] = [sinY*cosP cosY*cosR-sinY*sinP*sinR sinY*sinP*cosR+cosY*sinR]
19+
[ 0 0 1] [-sinP 0 cosP] [0 -sinR cosR] [ -sinP -cosP*sinR cosP*cosR ]
20+
```
21+
922
## Validation Dataset
1023

1124
[Biwi Kinect Head Pose Database](https://icu.ee.ethz.ch/research/datsets.html)

models/intel/machine-translation-nar-de-en-0002/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Use Case and High-Level Description
44

5-
This is a Deutsch-English machine translation model based on non-autoregressive Transformer topology.
5+
This is a Deutsch-English machine translation model based on non-autoregressive Transformer topology. The model is [trained](https://github.com/openvinotoolkit/training_extensions/tree/089de2f24667329a58e8560ed4e01ef203e99def/misc/pytorch_toolkit/machine_translation) on internal dataset.
66

77
Tokenization occurs using the SentencePieceBPETokenizer (see the demo code for implementation details) and the enclosed tokenizer_src and tokenizer_tgt folders.
88

models/intel/machine-translation-nar-en-de-0002/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Use Case and High-Level Description
44

5-
This is an English-Deutsch machine translation model based on non-autoregressive Transformer topology.
5+
This is an English-Deutsch machine translation model based on non-autoregressive Transformer topology. The model is [trained](https://github.com/openvinotoolkit/training_extensions/tree/089de2f24667329a58e8560ed4e01ef203e99def/misc/pytorch_toolkit/machine_translation) on internal dataset.
66

77
Tokenization occurs using the SentencePieceBPETokenizer (see the demo code for implementation details) and the enclosed tokenizer_src and tokenizer_tgt folders.
88

models/intel/machine-translation-nar-en-ru-0002/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Use Case and High-Level Description
44

5-
This is an English-Russian machine translation model based on non-autoregressive Transformer topology.
5+
This is an English-Russian machine translation model based on non-autoregressive Transformer topology. The model is [trained](https://github.com/openvinotoolkit/training_extensions/tree/089de2f24667329a58e8560ed4e01ef203e99def/misc/pytorch_toolkit/machine_translation) on internal dataset.
66

77
Tokenization occurs using the SentencePieceBPETokenizer (see the demo code for implementation details) and is enclosed in tokenizer_src and tokenizer_tgt folders.
88

models/intel/machine-translation-nar-ru-en-0002/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Use Case and High-Level Description
44

5-
This is a Russian-English machine translation model based on non-autoregressive Transformer topology.
5+
This is a Russian-English machine translation model based on non-autoregressive Transformer topology. The model is [trained](https://github.com/openvinotoolkit/training_extensions/tree/089de2f24667329a58e8560ed4e01ef203e99def/misc/pytorch_toolkit/machine_translation) on internal dataset.
66

77
Tokenization occurs using the SentencePieceBPETokenizer (see the demo code for implementation details) and the enclosed tokenizer_src and tokenizer_tgt folders.
88

models/public/detr-resnet50/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Expected color order is `BGR`.
6666
- `w` - width of bounding box(values are in normalized format, in range [0, 1])
6767
- `h` - height of bounding box(values are in normalized format, in range [0, 1])
6868

69-
2. Scores, name: `scores`, shape - `1, 100, 92`. Contains scores for 91 [Common Objects in Context (COCO)](https://cocodataset.org/#home) object classes. The last class is `no-object` class.
69+
2. Scores, name: `scores`, shape - `1, 100, 92`. Contains scores in logits format for 91 [Common Objects in Context (COCO)](https://cocodataset.org/#home) object classes. The last class is `no-object` class.
7070

7171
### Converted model
7272

@@ -81,7 +81,7 @@ Expected color order is `BGR`.
8181
- `w` - width of bounding box(values are in normalized format, in range [0, 1])
8282
- `h` - height of bounding box(values are in normalized format, in range [0, 1])
8383

84-
2. Scores, name: `scores`, shape - `1, 100, 92`. Contains scores for 91 [Common Objects in Context (COCO)](https://cocodataset.org/#home) object classes. The last class is `no-object` class.
84+
2. Scores, name: `scores`, shape - `1, 100, 92`. Contains scores in logits format for 91 [Common Objects in Context (COCO)](https://cocodataset.org/#home) object classes. The last class is `no-object` class.
8585

8686
## Download a Model and Convert it into OpenVINO™ IR Format
8787

0 commit comments

Comments
 (0)