Skip to content

Commit 36fc470

Browse files
authored
Merge pull request #232 from HyperInspire/bugfix/det_resize
Bugfix/det resize
2 parents a989c0a + 650db4a commit 36fc470

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cpp/inspireface/track_module/face_detect/face_detect_adapt.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ FaceLocList FaceDetectAdapt::operator()(const inspirecv::Image &bgr) {
2222
inspirecv::Image pad;
2323

2424
uint8_t *resized_data = nullptr;
25-
m_processor_->ResizeAndPadding(bgr.Data(), bgr.Width(), bgr.Height(), bgr.Channels(), m_input_size_, m_input_size_, &resized_data, scale);
25+
if (ori_w == m_input_size_ && ori_h == m_input_size_) {
26+
scale = 1.0f;
27+
resized_data = (uint8_t *)bgr.Data();
28+
} else {
29+
m_processor_->ResizeAndPadding(bgr.Data(), bgr.Width(), bgr.Height(), bgr.Channels(), m_input_size_, m_input_size_, &resized_data, scale);
30+
}
2631

2732
pad = inspirecv::Image::Create(m_input_size_, m_input_size_, bgr.Channels(), resized_data, false);
2833

cpp/sample/api/sample_face_track.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ int main(int argc, char* argv[]) {
9898
/* Maximum number of faces detected */
9999
maxDetectNum = 20;
100100
/* Face detection image input level */
101-
detectPixelLevel = 160;
101+
detectPixelLevel = 320;
102102
/* Handle of the current face SDK algorithm context */
103103
session = NULL;
104104
ret = HFCreateInspireFaceSessionOptional(option, detMode, maxDetectNum, detectPixelLevel, -1, &session);

0 commit comments

Comments
 (0)