Skip to content

Commit

Permalink
There were some problems testing on the rv1106
Browse files Browse the repository at this point in the history
  • Loading branch information
tunmx committed Jan 12, 2025
1 parent d139850 commit 23de522
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build Wheels

on:
push:
branches: ["dev/patch-4"]
branches: ["release/wheels"]
pull_request:
branches: ["dev/patch-4"]
branches: ["release/wheels"]

env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions command/build_cross_rv1106_armhf_uclibc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ cmake -DCMAKE_SYSTEM_NAME=Linux \
-DISF_RK_COMPILER_TYPE=armhf-uclibc \
-DISF_ENABLE_RGA=ON \
-DISF_ENABLE_COST_TIME=OFF \
-DISF_BUILD_WITH_SAMPLE=OFF \
-DISF_BUILD_WITH_SAMPLE=ON \
-DISF_BUILD_WITH_TEST=ON \
-DISF_ENABLE_BENCHMARK=ON \
-DISF_ENABLE_USE_LFW_DATA=OFF \
-DISF_ENABLE_TEST_EVALUATION=OFF \
-DISF_BUILD_SHARED_LIBS=ON ${SCRIPT_DIR}
-DISF_BUILD_SHARED_LIBS=OFF ${SCRIPT_DIR}

make -j4
make install
# make install

move_install_files "$(pwd)"
# move_install_files "$(pwd)"
6 changes: 6 additions & 0 deletions cpp/sample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ if(ISF_RK_DEVICE_TYPE STREQUAL "RV1106")
set_target_properties(FaceTrackSampleRV1106 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/sample/"
)

add_executable(FaceAttributeSampleRV1106 rv1106/face_attribute.cpp)
target_link_libraries(FaceAttributeSampleRV1106 InspireFace ${ext})
set_target_properties(FaceAttributeSampleRV1106 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/sample/"
)
endif()

add_executable(NexusImageSample rv1106/rga_image.cpp)
Expand Down
30 changes: 30 additions & 0 deletions cpp/sample/rv1106/face_attribute.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#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 <log.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();
InspireModel detModel;
auto ret = archive.LoadModel("face_attribute", detModel);
if (ret != SARC_SUCCESS) {
INSPIRE_LOGE("Load %s error: %d", "face_detect_160", ret);
return HERR_ARCHIVE_LOAD_MODEL_FAILURE;
}

FaceAttributePredictAdapt face_attribute;
face_attribute.loadData(detModel, detModel.modelType, false);

auto img = inspirecv::Image::Create("test_res/data/crop/crop.png");
auto result = face_attribute(img);
std::cout << "result: " << result[0] << ", " << result[1] << ", " << result[2] << std::endl;

return 0;
}
3 changes: 2 additions & 1 deletion cpp/sample/rv1106/face_detect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
using namespace inspire;

int main() {
INSPIRE_SET_LOG_LEVEL(ISF_LOG_DEBUG);
std::string expansion_path = "";
INSPIRE_LAUNCH->Load("Gundam_RV1106");
INSPIRE_LAUNCH->Load("test_res/pack/Gundam_RV1106");
auto archive = INSPIRE_LAUNCH->getMArchive();
InspireModel detModel;
auto ret = archive.LoadModel("face_detect_160", detModel);
Expand Down
8 changes: 7 additions & 1 deletion cpp/test/unit/api/test_session_parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ TEST_CASE("test_SessionParallel", "[Session][Parallel]") {
}

SECTION("Parallel") {
const int N = 4; // Use 4 sessions in parallel
int N = 4; // Use 4 sessions in parallel
#ifdef ISF_RKNPU_RV1106
N = 1; // Use 1 session in parallel
#endif
inspire::parallel::ResourcePool<HFSession> sessionPool(N, [](HFSession& session) {
auto ret = HFReleaseInspireFaceSession(session);
if (ret != HSUCCEED) {
Expand Down Expand Up @@ -126,6 +129,9 @@ TEST_CASE("test_SessionParallel_Memory", "[Session][Parallel][Memory]") {
size_t memoryUsage = getCurrentMemoryUsage();
TEST_PRINT("Current memory usage: {}MB", memoryUsage);
int loop = 4;
#ifdef ISF_RKNPU_RV1106
loop = 1;
#endif
std::vector<HFSession> sessions;
for (int i = 0; i < loop; ++i) {
HFSessionCustomParameter parameter = {0};
Expand Down

0 comments on commit 23de522

Please sign in to comment.