mirror of
https://github.com/deepinsight/insightface.git
synced 2026-08-07 18:57:48 +00:00
Update
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#include <inspirecv/inspirecv.h>
|
||||
#include <inspireface/pipeline_module/attribute/face_attribute_adapt.h>
|
||||
#include "inspireface/initialization_module/launch.h"
|
||||
#include <inspireface/middleware/inspirecv_image_process.h>
|
||||
#include <inspirecv/time_spend.h>
|
||||
#include <inspireface/include/inspireface/launch.h>
|
||||
#include <inspireface/include/inspireface/frame_process.h>
|
||||
#include <inspireface/include/inspireface/spend_timer.h>
|
||||
#include <inspireface/include/inspireface/herror.h>
|
||||
#include <log.h>
|
||||
|
||||
using namespace inspire;
|
||||
@@ -10,8 +11,8 @@ using namespace inspire;
|
||||
int main() {
|
||||
INSPIRE_SET_LOG_LEVEL(ISF_LOG_DEBUG);
|
||||
std::string expansion_path = "";
|
||||
INSPIRE_LAUNCH->Load("test_res/pack/Gundam_RV1106");
|
||||
auto archive = INSPIRE_LAUNCH->getMArchive();
|
||||
INSPIREFACE_CONTEXT->Load("test_res/pack/Gundam_RV1106");
|
||||
auto archive = INSPIREFACE_CONTEXT->getMArchive();
|
||||
InspireModel detModel;
|
||||
auto ret = archive.LoadModel("face_attribute", detModel);
|
||||
if (ret != SARC_SUCCESS) {
|
||||
@@ -20,7 +21,7 @@ int main() {
|
||||
}
|
||||
|
||||
FaceAttributePredictAdapt face_attribute;
|
||||
face_attribute.loadData(detModel, detModel.modelType, false);
|
||||
face_attribute.LoadData(detModel, detModel.modelType, false);
|
||||
|
||||
auto img = inspirecv::Image::Create("test_res/data/crop/crop.png");
|
||||
auto result = face_attribute(img);
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
#include <inspirecv/inspirecv.h>
|
||||
#include <inspireface/track_module/face_track_module.h>
|
||||
#include "inspireface/initialization_module/launch.h"
|
||||
#include <inspireface/middleware/inspirecv_image_process.h>
|
||||
#include <inspirecv/time_spend.h>
|
||||
#include <inspireface/include/inspireface/launch.h>
|
||||
#include <inspireface/include/inspireface/frame_process.h>
|
||||
#include <inspireface/include/inspireface/spend_timer.h>
|
||||
#include <inspireface/include/inspireface/herror.h>
|
||||
|
||||
using namespace inspire;
|
||||
|
||||
int main() {
|
||||
INSPIRE_SET_LOG_LEVEL(ISF_LOG_DEBUG);
|
||||
std::string expansion_path = "";
|
||||
INSPIRE_LAUNCH->Load("test_res/pack/Gundam_RV1106");
|
||||
auto archive = INSPIRE_LAUNCH->getMArchive();
|
||||
INSPIREFACE_CONTEXT->Load("test_res/pack/Gundam_RV1106");
|
||||
auto archive = INSPIREFACE_CONTEXT->getMArchive();
|
||||
InspireModel detModel;
|
||||
auto ret = archive.LoadModel("face_detect_160", detModel);
|
||||
if (ret != SARC_SUCCESS) {
|
||||
@@ -21,7 +22,7 @@ int main() {
|
||||
std::vector<int> input_size;
|
||||
input_size = detModel.Config().get<std::vector<int>>("input_size");
|
||||
|
||||
ret = face_detect.loadData(detModel, detModel.modelType, false);
|
||||
ret = face_detect.LoadData(detModel, detModel.modelType, false);
|
||||
if (ret != 0) {
|
||||
INSPIRE_LOGE("Load %s error: %d", "face_detect_160", ret);
|
||||
return HERR_ARCHIVE_LOAD_MODEL_FAILURE;
|
||||
@@ -31,7 +32,7 @@ int main() {
|
||||
|
||||
auto img = inspirecv::Image::Create("data/bulk/kun.jpg");
|
||||
|
||||
inspirecv::TimeSpend time_spend("Detect");
|
||||
inspire::SpendTimer time_spend("Detect");
|
||||
FaceLocList results;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
time_spend.Start();
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include <inspirecv/inspirecv.h>
|
||||
#include <inspireface/middleware/nexus_processor/image_processor.h>
|
||||
#include <inspireface/image_process/nexus_processor/image_processor.h>
|
||||
#include "log.h"
|
||||
#include <inspirecv/time_spend.h>
|
||||
#include <inspireface/include/inspireface/spend_timer.h>
|
||||
#include <inspireface/include/inspireface/herror.h>
|
||||
|
||||
using namespace inspire;
|
||||
|
||||
@@ -18,7 +19,7 @@ int main() {
|
||||
uint8_t* resized_data = nullptr;
|
||||
int resized_width = 100;
|
||||
int resized_height = 100;
|
||||
inspirecv::TimeSpend time_spend("RGA resize");
|
||||
inspire::SpendTimer time_spend("RGA resize");
|
||||
for (int i = 0; i < 10; i++) {
|
||||
time_spend.Start();
|
||||
auto ret = processor->Resize(img.Data(), img.Width(), img.Height(), img.Channels(), &resized_data, resized_width, resized_height);
|
||||
@@ -37,7 +38,7 @@ int main() {
|
||||
processor->MarkDone();
|
||||
|
||||
uint8_t* swapped_data = nullptr;
|
||||
inspirecv::TimeSpend swap_time_spend("RGA swap color");
|
||||
inspire::SpendTimer swap_time_spend("RGA swap color");
|
||||
for (int i = 0; i < 10; i++) {
|
||||
swap_time_spend.Start();
|
||||
auto ret = processor->SwapColor(resized_img.Data(), resized_img.Width(), resized_img.Height(), resized_img.Channels(), &swapped_data);
|
||||
@@ -57,7 +58,7 @@ int main() {
|
||||
int bottom = 10;
|
||||
int left = 10;
|
||||
int right = 10;
|
||||
inspirecv::TimeSpend padding_time_spend("RGA padding");
|
||||
inspire::SpendTimer padding_time_spend("RGA padding");
|
||||
int padded_width = 0;
|
||||
int padded_height = 0;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
@@ -76,7 +77,7 @@ int main() {
|
||||
|
||||
// inspirecv crop
|
||||
inspirecv::Rect2i rect(30, 30, 70, 70);
|
||||
inspirecv::TimeSpend inspirecv_crop_time_spend("InspireCV crop");
|
||||
inspire::SpendTimer inspirecv_crop_time_spend("InspireCV crop");
|
||||
inspirecv::Image inspirecv_cropped_img;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
inspirecv_crop_time_spend.Start();
|
||||
@@ -91,7 +92,7 @@ int main() {
|
||||
int dst_width = 320;
|
||||
int dst_height = 320;
|
||||
float scale = 0.0f;
|
||||
inspirecv::TimeSpend padded_crop_time_spend("RGA padded and cropped");
|
||||
inspire::SpendTimer padded_crop_time_spend("RGA padded and cropped");
|
||||
for (int i = 0; i < 10; i++) {
|
||||
padded_crop_time_spend.Start();
|
||||
auto ret = processor->ResizeAndPadding(image.Data(), image.Width(), image.Height(), image.Channels(), dst_width, dst_height,
|
||||
@@ -110,7 +111,7 @@ int main() {
|
||||
uint8_t* resized_data_2 = nullptr;
|
||||
int resized_width_2 = 512;
|
||||
int resized_height_2 = 512;
|
||||
inspirecv::TimeSpend time_spend_2("RGA resize 2");
|
||||
inspire::SpendTimer time_spend_2("RGA resize 2");
|
||||
for (int i = 0; i < 10; i++) {
|
||||
time_spend_2.Start();
|
||||
auto ret = processor->Resize(padded_cropped_img.Data(), padded_cropped_img.Width(), padded_cropped_img.Height(),
|
||||
|
||||
Reference in New Issue
Block a user