Skip to content

Commit

Permalink
Add some threshold tools
Browse files Browse the repository at this point in the history
  • Loading branch information
tunmx committed Jan 21, 2025
1 parent f8baa52 commit 44532d4
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cpp/inspireface/c_api/inspireface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ HResult HFSessionSetTrackModeDetectInterval(HFSession session, HInt32 num) {
if (ctx == nullptr) {
return HERR_INVALID_CONTEXT_HANDLE;
}
return ctx->impl.SetTrackModelDetectInterval(num);
return ctx->impl.SetTrackModeDetectInterval(num);
}

HResult HFExecuteFaceTrack(HFSession session, HFImageStream streamHandle, PHFMultipleFaceData results) {
Expand Down
4 changes: 2 additions & 2 deletions cpp/inspireface/face_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ int32_t FaceSession::SetTrackModeNumSmoothCacheFrame(int value) {
return HSUCCEED;
}

int32_t FaceSession::SetTrackModelDetectInterval(int value) {
m_face_track_->SetTrackModelDetectInterval(value);
int32_t FaceSession::SetTrackModeDetectInterval(int value) {
m_face_track_->SetTrackModeDetectInterval(value);
return HSUCCEED;
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/inspireface/face_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class INSPIRE_API FaceSession {
* @param value The detect interval value
* @return int32_t Status code of the operation.
* */
int32_t SetTrackModelDetectInterval(int value);
int32_t SetTrackModeDetectInterval(int value);

private:
// Private member variables
Expand Down
2 changes: 1 addition & 1 deletion cpp/inspireface/track_module/face_track_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ void FaceTrackModule::SetTrackModeNumSmoothCacheFrame(int value) {
m_track_mode_num_smooth_cache_frame_ = value;
}

void FaceTrackModule::SetTrackModelDetectInterval(int value) {
void FaceTrackModule::SetTrackModeDetectInterval(int value) {
detection_interval_ = value;
}

Expand Down
21 changes: 12 additions & 9 deletions cpp/inspireface/track_module/face_track_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ class INSPIRE_API FaceTrackModule {

public:
/**
* @brief Fix detect threshold
* @brief Set the detect threshold
* */
void SetDetectThreshold(float value);

/**
* @brief Fix detect threshold
* @brief Set the minimum face size
* */
void SetMinimumFacePxSize(float value);

Expand All @@ -160,19 +160,22 @@ class INSPIRE_API FaceTrackModule {
bool IsDetectModeLandmark() const;

/**
* @brief Fix detect threshold
* */
* @brief Sets the smoothing ratio for landmark tracking
* @param value Smoothing ratio between 0 and 1, smaller values mean stronger smoothing
*/
void SetTrackModeSmoothRatio(float value);

/**
* @brief Fix detect threshold
* */
* @brief Set the number of smooth cache frame
* @param value Number of frames to cache for smoothing
*/
void SetTrackModeNumSmoothCacheFrame(int value);

/**
* @brief Fix detect interval
* */
void SetTrackModelDetectInterval(int value);
* @brief Set the detect interval
* @param value Interval between detections
*/
void SetTrackModeDetectInterval(int value);

public:
std::vector<FaceObjectInternal> trackingFace; ///< Vector of FaceObjects currently being tracked.
Expand Down
8 changes: 4 additions & 4 deletions python/inspireface/modules/core/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -1415,10 +1415,10 @@ class struct_HFMultipleFaceData(Structure):
HFSessionSetTrackModeNumSmoothCacheFrame.restype = HResult

# /Users/tunm/work/InspireFace/cpp/inspireface/c_api/inspireface.h: 488
if _libs[_LIBRARY_FILENAME].has("HFSessionSetTrackModelDetectInterval", "cdecl"):
HFSessionSetTrackModelDetectInterval = _libs[_LIBRARY_FILENAME].get("HFSessionSetTrackModelDetectInterval", "cdecl")
HFSessionSetTrackModelDetectInterval.argtypes = [HFSession, HInt32]
HFSessionSetTrackModelDetectInterval.restype = HResult
if _libs[_LIBRARY_FILENAME].has("HFSessionSetTrackModeDetectInterval", "cdecl"):
HFSessionSetTrackModeDetectInterval = _libs[_LIBRARY_FILENAME].get("HFSessionSetTrackModeDetectInterval", "cdecl")
HFSessionSetTrackModeDetectInterval.argtypes = [HFSession, HInt32]
HFSessionSetTrackModeDetectInterval.restype = HResult

# /Users/tunm/work/InspireFace/cpp/inspireface/c_api/inspireface.h: 498
if _libs[_LIBRARY_FILENAME].has("HFExecuteFaceTrack", "cdecl"):
Expand Down
2 changes: 1 addition & 1 deletion python/inspireface/modules/inspireface.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def set_track_mode_num_smooth_cache_frame(self, num=15):
logger.error(f"Set track mode num smooth cache frame error: {ret}")

def set_track_model_detect_interval(self, num=20):
ret = HFSessionSetTrackModelDetectInterval(self._sess, num)
ret = HFSessionSetTrackModeDetectInterval(self._sess, num)
if ret != 0:
logger.error(f"Set track model detect interval error: {ret}")

Expand Down

0 comments on commit 44532d4

Please sign in to comment.