mirror of
https://github.com/deepinsight/insightface.git
synced 2025-12-30 08:02:27 +00:00
Fix the issue of rga image processing for face detection
This commit is contained in:
@@ -22,7 +22,12 @@ FaceLocList FaceDetectAdapt::operator()(const inspirecv::Image &bgr) {
|
||||
inspirecv::Image pad;
|
||||
|
||||
uint8_t *resized_data = nullptr;
|
||||
m_processor_->ResizeAndPadding(bgr.Data(), bgr.Width(), bgr.Height(), bgr.Channels(), m_input_size_, m_input_size_, &resized_data, scale);
|
||||
if (ori_w == m_input_size_ && ori_h == m_input_size_) {
|
||||
scale = 1.0f;
|
||||
resized_data = (uint8_t *)bgr.Data();
|
||||
} else {
|
||||
m_processor_->ResizeAndPadding(bgr.Data(), bgr.Width(), bgr.Height(), bgr.Channels(), m_input_size_, m_input_size_, &resized_data, scale);
|
||||
}
|
||||
|
||||
pad = inspirecv::Image::Create(m_input_size_, m_input_size_, bgr.Channels(), resized_data, false);
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ int main(int argc, char* argv[]) {
|
||||
/* Maximum number of faces detected */
|
||||
maxDetectNum = 20;
|
||||
/* Face detection image input level */
|
||||
detectPixelLevel = 160;
|
||||
detectPixelLevel = 320;
|
||||
/* Handle of the current face SDK algorithm context */
|
||||
session = NULL;
|
||||
ret = HFCreateInspireFaceSessionOptional(option, detMode, maxDetectNum, detectPixelLevel, -1, &session);
|
||||
|
||||
Reference in New Issue
Block a user