Skip to content

Commit 1a88663

Browse files
committed
Fix bugs
Former-commit-id: 9248c07
1 parent 632beb0 commit 1a88663

File tree

8 files changed

+37
-19
lines changed

8 files changed

+37
-19
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ If you require further information on tracking development branches, CI/CD proce
88

99
Please contact [contact@insightface.ai](mailto:contact@insightface.ai?subject=InspireFace) for commercial support, including obtaining and integrating higher accuracy models, as well as custom development.
1010

11-
## ChangeLogs
11+
## Change Logs
12+
13+
**`2024-07-02`** Fixed several bugs in the face detector with multi-level input.
1214

1315
**`2024-06-27`** Verified iOS usability and fixed some bugs.
1416

@@ -69,6 +71,9 @@ The '3rdparty' directory already includes the MNN library and specifies a partic
6971
- Prepare the cross-compilation toolchain in advance, such as gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf
7072
- CUDA (version 10.1 or higher)
7173
- GPU-based inference requires installing NVIDIA's CUDA dependencies on the device.
74+
- Eigen3
75+
- If you need to use the tracking-by-detection feature, you must have Eigen3 installed in advance.
76+
7277
- RKNN
7378
- Adjust and select versions currently supported for specific requirements.
7479

@@ -357,7 +362,7 @@ For different scenarios, we currently provide several Packs, each containing mul
357362

358363
| Name | Supported Devices | Note | Link |
359364
| --- | --- | --- | --- |
360-
| Pikachu | CPU | Lightweight edge-side model | [GDrive](https://drive.google.com/file/d/1i4uC-dZTQxdVgn2rP0ZdfJTMkJIXgYY4/view?usp=drive_link) |
361-
| Megatron | CPU, GPU | Local or server-side model | [GDrive](https://drive.google.com/file/d/1i4uC-dZTQxdVgn2rP0ZdfJTMkJIXgYY4/view?usp=drive_link) |
362-
| Gundam-RV1109 | RKNPU | Supports RK1109 and RK1126 | [GDrive](https://drive.google.com/file/d/1i4uC-dZTQxdVgn2rP0ZdfJTMkJIXgYY4/view?usp=drive_link) |
365+
| Pikachu | CPU | Lightweight edge-side model | [GDrive](https://drive.google.com/drive/folders/1krmv9Pj0XEZXR1GRPHjW_Sl7t4l0dNSS?usp=sharing) |
366+
| Megatron | CPU, GPU | Local or server-side model | [GDrive](https://drive.google.com/drive/folders/1krmv9Pj0XEZXR1GRPHjW_Sl7t4l0dNSS?usp=sharing) |
367+
| Gundam-RV1109 | RKNPU | Supports RK1109 and RK1126 | [GDrive](https://drive.google.com/drive/folders/1krmv9Pj0XEZXR1GRPHjW_Sl7t4l0dNSS?usp=sharing) |
363368

command/build_cross_rv1109rv1126_armhf.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ cmake -DCMAKE_SYSTEM_NAME=Linux \
4848
-DISF_BUILD_LINUX_ARM7=ON \
4949
-DISF_ENABLE_RKNN=ON \
5050
-DISF_RK_DEVICE_TYPE=RV1109RV1126 \
51-
-DISF_BUILD_WITH_SAMPLE=ON \
52-
-DISF_BUILD_WITH_TEST=ON \
53-
-DISF_ENABLE_BENCHMARK=ON \
51+
-DISF_BUILD_WITH_SAMPLE=OFF \
52+
-DISF_BUILD_WITH_TEST=OFF \
53+
-DISF_ENABLE_BENCHMARK=OFF \
5454
-DISF_ENABLE_USE_LFW_DATA=OFF \
5555
-DISF_ENABLE_TEST_EVALUATION=OFF \
5656
-DISF_BUILD_SHARED_LIBS=ON ${SCRIPT_DIR}
5757

5858
make -j1
5959
make install
6060

61-
# move_install_files "$(pwd)"
61+
move_install_files "$(pwd)"

cpp/inspireface/c_api/inspireface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ HYPER_CAPI_EXPORT extern HResult HFCreateInspireFaceSession(
171171
* @param detectMode Detection mode to be used.
172172
* @param maxDetectFaceNum Maximum number of faces to detect.
173173
* @param detectPixelLevel Modify the input resolution level of the detector, the larger the better,
174-
* the need to input a multiple of 160, such as 160, 320, 640, the default value -1 is 160.
174+
* the need to input a multiple of 160, such as 160, 320, 640, the default value -1 is 320.
175175
* @param trackByDetectModeFPS If you are using the MODE_TRACK_BY_DETECTION tracking mode,
176176
* this value is used to set the fps frame rate of your current incoming video stream, which defaults to -1 at 30fps.
177177
* @param handle Pointer to the context handle that will be returned.

cpp/inspireface/feature_hub/feature_hub.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ using DatabaseConfiguration = struct DatabaseConfiguration {
4444
int feature_block_num = 20;
4545
bool enable_use_db = false; ///< Whether to enable data persistence.
4646
std::string db_path; ///< Path to the database file.
47-
float recognition_threshold = 0.46f; ///< Face search threshold
47+
float recognition_threshold = 0.48f; ///< Face search threshold
4848
SearchMode search_mode = SEARCH_MODE_EAGER; ///< Search mode
4949
};
5050

cpp/test/settings/enviro.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Enviro {
1818
void operator=(Enviro const&) = delete;
1919

2020
std::string getPackName() const { return packName; }
21+
2122
void setPackName(const std::string& name) { packName = name; }
2223

2324
const std::string &getTestResDir() const { return testResDir; }

cpp/test/test.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//
22
// Created by tunm on 2023/10/11.
33
//
4+
#include <string>
45
#define CATCH_CONFIG_RUNNER
56

67
#include <iostream>
@@ -54,11 +55,13 @@ int main(int argc, char* argv[]) {
5455
// Pack file name and test directory
5556
std::string pack;
5657
std::string testDir;
58+
std::string packPath;
5759

5860
// Add command line options
5961
auto cli = session.cli()
6062
| Catch::clara::Opt(pack, "value")["--pack"]("Resource pack filename")
61-
| Catch::clara::Opt(testDir, "value")["--test_dir"]("Test dir resource");
63+
| Catch::clara::Opt(testDir, "value")["--test_dir"]("Test dir resource")
64+
| Catch::clara::Opt(packPath, "value")["--pack_path"]("The specified path to the pack file");
6265

6366
// Set combined CLI to the session
6467
session.cli(cli);
@@ -75,15 +78,22 @@ int main(int argc, char* argv[]) {
7578
TEST_PRINT("Using default test dir: {}", getTestDataDir());
7679
}
7780

81+
std::string fullPath;
7882
// Check whether custom parameters are set
7983
if (!pack.empty()) {
8084
SET_PACK_NAME(pack);
85+
fullPath = GET_MODEL_FILE();
8186
TEST_PRINT("Updated global Pack to: {}", TEST_MODEL_FILE);
87+
} else if (!packPath.empty()) {
88+
fullPath = packPath;
89+
TEST_PRINT("Updated global Pack File to: {}", packPath);
8290
} else {
91+
fullPath = GET_MODEL_FILE();
8392
TEST_PRINT("Using default global Pack: {}", TEST_MODEL_FILE);
8493
}
8594

86-
auto ret = HFLaunchInspireFace(GET_MODEL_FILE().c_str());
95+
std::cout << fullPath << std::endl;
96+
auto ret = HFLaunchInspireFace(fullPath.c_str());
8797
if (ret != HSUCCEED) {
8898
spdlog::error("An error occurred while starting InspireFace: {}", ret);
8999
return ret;

cpp/test/unit/api/test_feature_manage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ TEST_CASE("test_SearchTopK", "[feature_search_top_k]") {
335335
configuration.dbPath = dbPathStr;
336336
configuration.featureBlockNum = 20;
337337
configuration.searchMode = HF_SEARCH_MODE_EXHAUSTIVE;
338-
configuration.searchThreshold = 0.48f;
338+
configuration.searchThreshold = 0.46f;
339339
// Delete the previous data before testing
340340
if (std::remove(configuration.dbPath) != 0) {
341341
spdlog::trace("Error deleting file");

doc/Benchmark-Remark(Updating).md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ The benchmark tests will be continuously updated.
55
### Device: Macbook pro 16-inch, 2019 2.6 GHz Intel Core i7
66
| **Benchmark** | **Loops** | **Total Time** | **Average Time** |
77
| --- | --- | --- | --- |
8-
| Face Detect | 1000 | 4371.79 ms | **4.3718 ms** |
9-
| Face Track | 1000 | 1957.73 ms | **1.9577 ms** |
8+
| Face Detect@160 | 1000 | 4170.91578 ms | **4.1709 ms** |
9+
| Face Detect@320 | 1000 | 8493.06583 ms | **8.4893 ms** |
10+
| Face Detect@640 | 1000 | 25808.39749 ms | **25.808 ms** |
11+
| Face Light-Track | 1000 | 1957.73 ms | **1.9577 ms** |
1012
| Face alignment & Extract | 1000 | 6139.67 ms | **6.1397 ms** |
1113
| Face Comparison | 1000 | 0.24ms | **0.0002ms** |
1214
| Search Face from 1k | 1000 | 72.39ms | **0.07ms** |
@@ -17,14 +19,14 @@ The benchmark tests will be continuously updated.
1719
### Device: RV1126
1820
| **Benchmark** | **Loops** | **Total Time** | **Average Time** |
1921
| --- | --- | --- | --- |
20-
| Face Detect | 1000 | 22638.11865ms | **22.63812ms** |
21-
| Face Track | 1000 | 8858.03802ms | **8.85804ms** |
22+
| Face Detect@160 | 1000 | 17342.88616ms | **17.34289ms** |
23+
| Face Detect@320 | 1000 | 22638.11865ms | **22.63812ms** |
24+
| Face Detect@640 | 1000 | 39745.28562ms | **39.74529ms** |
25+
| Face Light-Track | 1000 | 8858.03802ms | **8.85804ms** |
2226
| Face alignment & Extract | 1000 | 42352.03367ms | **42.35203ms** |
2327
| Face Comparison | 1000 | 1.30754ms | **0.00131ms** |
2428
| Search Face from 1k | 1000 | 3198.13874ms | **3.19814ms** |
2529
| Search Face from 5k | 1000 | 15745.00533ms | **15.74501ms** |
2630
| Search Face from 10k | 1000 | 31267.2301ms | **31.26723ms** |
2731

28-
##
29-
3032
**Note**: The test results are all calculated by the test programs in the '**cpp/test**' subproject.

0 commit comments

Comments
 (0)