Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ORT][TRT] support FaceFusion #445

Merged
merged 55 commits into from
Nov 30, 2024

Conversation

wangzijian1010
Copy link
Collaborator

This pull request introduces new features and updates to the face recognition and manipulation functionalities in the project. It includes the addition of several new face-related models and their corresponding test files, as well as updates to the CMake configuration for these new models.

New Features:

  • Added new face-related models and their corresponding headers and source files:
    • face_68landmarks (lite/ort/cv/face_68landmarks.h, lite/ort/cv/face_68landmarks.cpp) [1] [2]
    • face_recognizer (lite/ort/cv/face_recognizer.h, lite/ort/cv/face_recognizer.cpp)
    • face_restoration (lite/ort/cv/face_restoration.h, lite/ort/cv/face_restoration.cpp)
    • face_swap (lite/ort/cv/face_swap.h, lite/ort/cv/face_swap.cpp)
    • face_fusion_pipeline (lite/ort/cv/face_fusion_pipeline.h, lite/ort/cv/face_fusion_pipeline.cpp) [1] [2]

Updates to CMake Configuration:

  • Updated the OpenCV_LIBS variable to include opencv_calib3d in cmake/opencv.cmake.
  • Added new executables for the new face-related models in examples/lite/CMakeLists.txt.

Test Files:

  • Added test files for the new face-related models:
    • test_lite_face_68landmarks.cpp
    • test_lite_face_recognizer.cpp
    • test_lite_face_restoration.cpp
    • test_lite_face_swap.cpp
    • test_lite_facefusion_pipeline.cpp

Header File Updates:

  • Updated lite/models.h to include the new face-related models and their typedefs. [1] [2] [3] [4]

typedef _ONNXYOLOFaceNet YOLOV8Face;
typedef _ONNXFace_Swap InSwapper;
typedef _ONNXFace_Restoration GFPGAN;
typedef _ONNXFace_68Landmarks Face_68Landmarks;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这几个新增了类都属于FaceFusion系列,建议改成FaceFusion68Landmarks, FaceFusionRecognizer, FaceFusionSwap, FaceFusionRestoration, FaceFusionPipeline的风格。本仓库class名称采用驼峰法风格,不采用下划线。

Copy link
Owner

@DefTruth DefTruth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wangzijian1010 wangzijian1010 changed the title [ORT] support FaceFusion [ORT][TRT] support FaceFusion Nov 14, 2024
preprocessed_mat.convertTo(preprocessed_mat,CV_32FC3,1.0 / 255.f);
preprocessed_mat.convertTo(preprocessed_mat,CV_32FC3,1.0 / 1.f,0);

std::vector<float> model_martix = face_utils::load_npy("/home/facefusion-onnxrun/python/model_matrix.npy");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里写了某个绝对路径,是否要修改?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我现在在测试大佬 我准备做完多线程的之后 再一次性全部修复 先不 merge

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

@wangzijian1010 wangzijian1010 merged commit c70e1ff into DefTruth:main Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants