Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tunmx committed Jul 5, 2024
1 parent 2e73f21 commit 5791a8e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
37 changes: 24 additions & 13 deletions ci/quick_test_linux_x86_usual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
# 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"
BUILD_DIRNAME="ci_ubuntu18"
TEST_DIR="./build/${BUILD_DIRNAME}/test"
TEST_EXECUTABLE="./test/Test"

# Check if the target directory already exists
if [ ! -d "$TARGET_DIR" ]; then
Expand Down Expand Up @@ -43,22 +44,32 @@ 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_BUILD_WITH_TEST=ON \
-DISF_ENABLE_BENCHMARK=ON \
-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 ../../
-DISF_BUILD_SHARED_LIBS=OFF ../../

# Compile the project using 4 parallel jobs
make -j4

cd ${ROOT_DIR}

pip install opencv-python
pip install click

cd python/

python sample_face_detection.py ../test_res/pack/Pikachu ../test_res/data/bulk/woman.png
# Check if the symbolic link or directory already exists
if [ ! -e "$(basename ${FULL_TEST_DIR})" ]; then
# Create a symbolic link to the extracted test data directory
ln -s ${FULL_TEST_DIR} .
echo "Symbolic link to '${TARGET_DIR}' created."
else
echo "Symbolic link or directory '$(basename ${FULL_TEST_DIR})' already exists. Skipping creation."
fi

# Check if the test executable file exists
if [ ! -f "$TEST_EXECUTABLE" ]; then
# If not, print an error message and exit with a non-zero status code
echo "Error: Test executable '$TEST_EXECUTABLE' not found. Please ensure it is built correctly."
exit 1
else
# If it exists, print a message and run the test executable
echo "Test executable found. Running tests..."
"$TEST_EXECUTABLE"
fi
2 changes: 1 addition & 1 deletion python/sample_face_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def case_face_detection_image(resource_path, image_path):
# Apply rotation to the bounding box corners
rect = ((center[0], center[1]), (size[0], size[1]), angle)
box = cv2.boxPoints(rect)
box = np.int0(box)
box = box.astype(int)

# Draw the rotated bounding box
cv2.drawContours(draw, [box], 0, (100, 180, 29), 2)
Expand Down
2 changes: 1 addition & 1 deletion python/sample_face_track_from_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def case_face_tracker_from_video(resource_path, source, show):
# Apply rotation to the bounding box corners
rect = ((center[0], center[1]), (size[0], size[1]), angle)
box = cv2.boxPoints(rect)
box = np.int0(box)
box = box.astype(int)

# Draw the rotated bounding box
cv2.drawContours(frame, [box], 0, (100, 180, 29), 2)
Expand Down

0 comments on commit 5791a8e

Please sign in to comment.