-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from HyperInspire/dev/attribute
Dev/attribute
- Loading branch information
Showing
62 changed files
with
867 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This GitHub Actions workflow is designed for a CMake project running on a single platform (Ubuntu-x86). | ||
# For multi-platform testing, see the link provided. | ||
# Refer to: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml | ||
name: Run Ubuntu-x86 Test Pikachu from Python Native | ||
|
||
# Trigger this workflow on push or pull request to the "feature/sub" branch | ||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
|
||
# Define environment variables shared across jobs | ||
env: | ||
# Set the CMake build type (e.g., Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
|
||
# Jobs section defines all individual tasks for the CI workflow | ||
jobs: | ||
build: | ||
# Specify that this job should run on the latest Ubuntu environment provided by GitHub | ||
runs-on: ubuntu-latest | ||
|
||
# Define steps for this job | ||
steps: | ||
# Step 1: Check out the code from the repository | ||
- uses: actions/checkout@v4 | ||
|
||
# Step 2: Update Git submodules recursively | ||
- name: Update submodules | ||
run: | | ||
git clone --recurse-submodules https://github.com/HyperInspire/3rdparty.git | ||
# Step 3: Install necessary dependencies for building the CMake project | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update # Update package lists | ||
# Install build tools and required libraries for video processing | ||
sudo apt-get install -y build-essential libgtk-3-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev | ||
# Step 4: Run a separate script for CMake configuration and building | ||
- name: Download Dataset And Configure CMake | ||
# Execute a pre-existing script to handle CMake configuration and building | ||
# The script is assumed to be located at `ci/quick_test_linux_x86_usual.sh` | ||
run: bash ci/quick_test_linux_x86_usual_python_native_interface.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
|
||
# Exit immediately if any command exits with a non-zero status | ||
set -e | ||
|
||
ROOT_DIR="$(pwd)" | ||
TARGET_DIR="test_res" | ||
DOWNLOAD_URL="https://github.com/tunmx/inspireface-store/raw/main/resource/test_res-lite.zip" | ||
ZIP_FILE="test_res-lite.zip" | ||
BUILD_DIRNAME="ubuntu18_shared" | ||
|
||
# Check if the target directory already exists | ||
if [ ! -d "$TARGET_DIR" ]; then | ||
echo "Directory '$TARGET_DIR' does not exist. Downloading..." | ||
|
||
# Download the dataset zip file | ||
wget -q "$DOWNLOAD_URL" -O "$ZIP_FILE" | ||
|
||
echo "Extracting '$ZIP_FILE' to '$TARGET_DIR'..." | ||
# Unzip the downloaded file | ||
unzip "$ZIP_FILE" | ||
|
||
# Remove the downloaded zip file and unnecessary folders | ||
rm "$ZIP_FILE" | ||
rm -rf "__MACOSX" | ||
|
||
echo "Download and extraction complete." | ||
else | ||
echo "Directory '$TARGET_DIR' already exists. Skipping download." | ||
fi | ||
|
||
# Get the absolute path of the target directory | ||
FULL_TEST_DIR="$(realpath ${TARGET_DIR})" | ||
|
||
# Create the build directory if it doesn't exist | ||
mkdir -p build/${BUILD_DIRNAME}/ | ||
|
||
# Change directory to the build directory | ||
# Disable the shellcheck warning for potential directory changes | ||
# shellcheck disable=SC2164 | ||
cd build/${BUILD_DIRNAME}/ | ||
|
||
# Configure the CMake build system | ||
cmake -DCMAKE_BUILD_TYPE=Release \ | ||
-DISF_BUILD_WITH_SAMPLE=OFF \ | ||
-DISF_BUILD_WITH_TEST=OFF \ | ||
-DISF_ENABLE_BENCHMARK=OFF \ | ||
-DISF_ENABLE_USE_LFW_DATA=OFF \ | ||
-DISF_ENABLE_TEST_EVALUATION=OFF \ | ||
-DOpenCV_DIR=3rdparty/inspireface-precompile/opencv/4.5.1/opencv-ubuntu18-x86/lib/cmake/opencv4 \ | ||
-DISF_BUILD_SHARED_LIBS=ON ../../ | ||
|
||
# Compile the project using 4 parallel jobs | ||
make -j4 | ||
|
||
# Come back to project root dir | ||
cd ${ROOT_DIR} | ||
|
||
# Important: You must copy the compiled dynamic library to this path! | ||
cp build/${BUILD_DIRNAME}/lib/libInspireFace.so python/inspireface/modules/core/ | ||
|
||
# Install dependency | ||
pip install opencv-python | ||
pip install click | ||
pip install loguru | ||
|
||
cd python/ | ||
|
||
# Run sample | ||
python sample_face_detection.py ../test_res/pack/Pikachu ../test_res/data/bulk/woman.png | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,3 +66,5 @@ else | |
echo "Test executable found. Running tests..." | ||
"$TEST_EXECUTABLE" | ||
fi | ||
|
||
# Executing python scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.