hzt_asc 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +22 -9
- package/ask.cc +23 -10
- package/linux_so/libarcsoft_face_engine.so +0 -0
- package/package.json +1 -1
- package/sample/demo.js +1382 -1379
package/CMakeLists.txt
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 3.3)
|
|
2
2
|
cmake_policy(SET CMP0042 NEW)
|
|
3
3
|
set (CMAKE_CXX_STANDARD 11)
|
|
4
|
+
#set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
5
|
+
|
|
6
|
+
#set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
|
7
|
+
#set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
|
8
|
+
#set(CMAKE_INSTALL_RPATH $ORIGIN)
|
|
9
|
+
#set(CMAKE_PREFIX_PATH "/home/myusername/Documents/mylibleveldb")
|
|
10
|
+
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
4
11
|
|
|
5
12
|
project (hzt_asc_v3)
|
|
6
13
|
|
|
@@ -8,31 +15,37 @@ find_package( OpenCV REQUIRED )
|
|
|
8
15
|
include_directories( ${OpenCV_INCLUDE_DIRS} )
|
|
9
16
|
include_directories(${CMAKE_JS_INC})
|
|
10
17
|
|
|
11
|
-
#
|
|
18
|
+
#message(status " This is the OpenCV_INCLUDE_DIRS srcs:" ${OpenCV_INCLUDE_DIRS})
|
|
19
|
+
#message(status " This is the OpenCV_LIBS srcs:" ${OpenCV_LIBS})
|
|
20
|
+
#message(status " This is the CMAKE_JS_INC srcs:" ${CMAKE_JS_INC})
|
|
21
|
+
#message(status " This is the CMAKE_JS_LIB srcs:" ${CMAKE_JS_LIB})
|
|
22
|
+
|
|
12
23
|
|
|
13
24
|
#指定头文件目录
|
|
14
25
|
include_directories(./)
|
|
15
26
|
include_directories(./inc)
|
|
16
27
|
#指定静态和动态文件目录
|
|
17
|
-
link_directories(linux_so)
|
|
18
|
-
link_directories(lib)
|
|
19
|
-
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} SRC)
|
|
28
|
+
link_directories(./linux_so)
|
|
20
29
|
|
|
30
|
+
|
|
31
|
+
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} SRC)
|
|
21
32
|
add_library(${PROJECT_NAME} SHARED ${SRC} ${CMAKE_JS_SRC})
|
|
22
33
|
|
|
23
34
|
|
|
24
35
|
|
|
36
|
+
find_library(ARC_LIBRARY arcsoft_face HINTS ${CMAKE_CURRENT_SOURCE_DIR}/linux_so)
|
|
37
|
+
message(status " This is the ARC_LIBRARY srcs:" ${ARC_LIBRARY})
|
|
25
38
|
|
|
26
39
|
#链接库文件
|
|
27
|
-
target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB})
|
|
40
|
+
#target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB})
|
|
28
41
|
|
|
29
|
-
target_link_libraries(${PROJECT_NAME}
|
|
30
|
-
|
|
31
|
-
target_link_libraries(${PROJECT_NAME} arcsoft_face_engine)
|
|
42
|
+
#target_link_libraries(${PROJECT_NAME} -larcsoft_face)
|
|
43
|
+
target_link_libraries(${PROJECT_NAME} -larcsoft_face_engine)
|
|
32
44
|
|
|
45
|
+
target_link_libraries(${PROJECT_NAME} ${ARC_LIBRARY})
|
|
33
46
|
|
|
34
47
|
target_link_libraries(${PROJECT_NAME} curl)
|
|
35
|
-
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS}
|
|
48
|
+
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
|
|
36
49
|
|
|
37
50
|
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
|
|
38
51
|
# Include Node-API wrappers
|
package/ask.cc
CHANGED
|
@@ -579,8 +579,6 @@ Napi::Value ASK::ImageFaceCompareUrl2(const Napi::CallbackInfo& info) {
|
|
|
579
579
|
return obj;
|
|
580
580
|
}
|
|
581
581
|
|
|
582
|
-
|
|
583
|
-
|
|
584
582
|
Napi::Value ASK::ImageFaceCompareUrl(const Napi::CallbackInfo& info) {
|
|
585
583
|
Napi::Env env = info.Env();
|
|
586
584
|
int length = info.Length();
|
|
@@ -633,7 +631,6 @@ Napi::Value ASK::ImageFaceCompareUrl(const Napi::CallbackInfo& info) {
|
|
|
633
631
|
return obj;
|
|
634
632
|
}
|
|
635
633
|
|
|
636
|
-
|
|
637
634
|
////获取激活信息(采集离线激活信息、激活文件信息、SDK版本信息)
|
|
638
635
|
void ASK::getSdkRelatedInfo() {
|
|
639
636
|
printf("\n************* ArcFace SDK Info *****************\n");
|
|
@@ -716,8 +713,6 @@ int ASK::ColorSpaceConversion(MInt32 width, MInt32 height, MInt32 format, MUInt8
|
|
|
716
713
|
return 1;
|
|
717
714
|
}
|
|
718
715
|
|
|
719
|
-
|
|
720
|
-
|
|
721
716
|
MUInt8* ASK::processFile(const char* filePath, int& picWidth, int& picHeight) {
|
|
722
717
|
cv::Mat src = imread(filePath);
|
|
723
718
|
cout<<filePath<<endl;
|
|
@@ -777,7 +772,7 @@ cv::Mat curlImg(const char *img_url, int timeout=100000)
|
|
|
777
772
|
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); //重定向一次
|
|
778
773
|
CURLcode res = curl_easy_perform(curl); // start curl
|
|
779
774
|
curl_easy_cleanup(curl); // cleanup
|
|
780
|
-
cout<<res<<"xxxx" << stream.size() << " " << stream.max_size()<<endl;
|
|
775
|
+
cout<<res<<" xxxx " << stream.size() << " " << stream.max_size()<<endl;
|
|
781
776
|
return imdecode(stream, -1); // 'keep-as-is'
|
|
782
777
|
}
|
|
783
778
|
|
|
@@ -785,7 +780,8 @@ MUInt8* ASK::processFileUrl(const char* url, int& picWidth, int& picHeight) {
|
|
|
785
780
|
cv::Mat src = curlImg(url);
|
|
786
781
|
int Width = src.cols;
|
|
787
782
|
int Height = src.rows;
|
|
788
|
-
|
|
783
|
+
//const int Depth = src.depth;
|
|
784
|
+
cout << "Width:" << Width << ",Height:"<<Height << " " <<endl;
|
|
789
785
|
int wScore = Width % 4;
|
|
790
786
|
int hScore = Height % 2;
|
|
791
787
|
cv::Mat dest;
|
|
@@ -795,11 +791,28 @@ MUInt8* ASK::processFileUrl(const char* url, int& picWidth, int& picHeight) {
|
|
|
795
791
|
cv::Mat dst;
|
|
796
792
|
cv::resize(src, dst, cv::Size(Width, Height));
|
|
797
793
|
src.release();
|
|
798
|
-
|
|
794
|
+
|
|
795
|
+
cv::Mat mid;
|
|
796
|
+
dst.convertTo(mid, CV_8UC3);
|
|
797
|
+
cvtColor(mid, dest, COLOR_BGR2YUV_I420);
|
|
798
|
+
//cout << "processFileUrl3:" << mid.cols << ",mid.rows:"<<Height<<endl;
|
|
799
|
+
mid.release();
|
|
800
|
+
|
|
801
|
+
//cvtColor(dst, dest, COLOR_BGR2YUV_I420);
|
|
799
802
|
dst.release();
|
|
800
803
|
} else {
|
|
801
|
-
cvtColor(src, dest, COLOR_BGR2YUV_I420);
|
|
802
|
-
|
|
804
|
+
//cvtColor(src, dest, COLOR_BGR2YUV_I420);
|
|
805
|
+
cv::Mat mid;
|
|
806
|
+
src.convertTo(mid, CV_8UC3);
|
|
807
|
+
cvtColor(mid, dest, COLOR_BGR2YUV_I420);
|
|
808
|
+
//cout << "processFileUrl3:" << mid.cols << ",mid.rows:"<<Height<<endl;
|
|
809
|
+
mid.release();
|
|
810
|
+
}
|
|
811
|
+
// cv::Mat mid;
|
|
812
|
+
// src.convertTo(mid, CV_8UC3);
|
|
813
|
+
// cout << "processFileUrl2:" << Width << ",Height:"<<Height<<endl;
|
|
814
|
+
// cvtColor(mid, dest, COLOR_BGR2YUV_I420);
|
|
815
|
+
// cout << "processFileUrl3:" << mid.cols << ",mid.rows:"<<Height<<endl;
|
|
803
816
|
int len = Height*Width*3/2;
|
|
804
817
|
MUInt8* imageData = (MUInt8*)malloc(len);
|
|
805
818
|
memset(imageData, 0, len);
|
|
Binary file
|