From 70d4f83e7faa45d4e9575d7a25237dc48c884a40 Mon Sep 17 00:00:00 2001 From: youjinghan Date: Wed, 13 Aug 2025 16:24:40 +0800 Subject: [PATCH 1/7] add Library --- packages/tasks/src/model-libraries-snippets.ts | 18 ++++++++++++++++++ packages/tasks/src/model-libraries.ts | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index 15e1774fe7..f4c5a2fd9f 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -1703,6 +1703,24 @@ export const vfimamba = (model: ModelData): string[] => [ model = Model.from_pretrained("${model.id}")`, ]; +export const lvface = (model: ModelData): string[] => [ + `## Initialize the inferencer from inference_onnx.py + inferencer = LVFaceONNXInferencer( + model_path=${model.id}, # Path to your ONNX model + use_gpu=True # Set to False for CPU-only inference + ) + + ## Extract feature from local image + feat1 = inferencer.infer_from_image("path/to/image1.jpg") + + ## Extract feature from URL + feat2 = inferencer.infer_from_url("https://example.com/image1.jpg") + + ## Calculate cosine similarity + similarity = inferencer.calculate_similarity(feat1, feat2) + print(f"Similarity score: {similarity:.6f}") # Output example: 0.872345`, +]; + export const voicecraft = (model: ModelData): string[] => [ `from voicecraft import VoiceCraft diff --git a/packages/tasks/src/model-libraries.ts b/packages/tasks/src/model-libraries.ts index d267b199dd..28ba4d3e55 100644 --- a/packages/tasks/src/model-libraries.ts +++ b/packages/tasks/src/model-libraries.ts @@ -1156,6 +1156,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = { countDownloads: `path_extension:"pkl"`, snippets: snippets.vfimamba, }, + "LVFace": { + prettyLabel: "LVFace", + repoName: "LVFace", + repoUrl: "https://github.com/bytedance/LVFace", + countDownloads: `path_extension:"pt" OR path_extension:"onnx"`, + snippets: snippets.lvface, + }, voicecraft: { prettyLabel: "VoiceCraft", repoName: "VoiceCraft", From ce6e472dee728ace42fbf9cc5fd135e64e88179f Mon Sep 17 00:00:00 2001 From: GitHup2016yjh Date: Fri, 15 Aug 2025 00:12:36 +0800 Subject: [PATCH 2/7] Update Add LVFace library Co-authored-by: vb --- packages/tasks/src/model-libraries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tasks/src/model-libraries.ts b/packages/tasks/src/model-libraries.ts index 28ba4d3e55..ba07298fc5 100644 --- a/packages/tasks/src/model-libraries.ts +++ b/packages/tasks/src/model-libraries.ts @@ -1156,7 +1156,7 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = { countDownloads: `path_extension:"pkl"`, snippets: snippets.vfimamba, }, - "LVFace": { + "lvface": { prettyLabel: "LVFace", repoName: "LVFace", repoUrl: "https://github.com/bytedance/LVFace", From 2da0490894e89a8c0dfa3140ac13f27bdd0c128d Mon Sep 17 00:00:00 2001 From: GitHup2016yjh Date: Fri, 15 Aug 2025 11:46:59 +0800 Subject: [PATCH 3/7] Update LVFace library --- packages/tasks/src/model-libraries-snippets.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index f4c5a2fd9f..4e6f60bdca 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -1704,21 +1704,7 @@ model = Model.from_pretrained("${model.id}")`, ]; export const lvface = (model: ModelData): string[] => [ - `## Initialize the inferencer from inference_onnx.py - inferencer = LVFaceONNXInferencer( - model_path=${model.id}, # Path to your ONNX model - use_gpu=True # Set to False for CPU-only inference - ) - - ## Extract feature from local image - feat1 = inferencer.infer_from_image("path/to/image1.jpg") - - ## Extract feature from URL - feat2 = inferencer.infer_from_url("https://example.com/image1.jpg") - - ## Calculate cosine similarity - similarity = inferencer.calculate_similarity(feat1, feat2) - print(f"Similarity score: {similarity:.6f}") # Output example: 0.872345`, + `inferencer = LVFaceONNXInferencer(model_path=${model.id}, use_gpu=True)`, ]; export const voicecraft = (model: ModelData): string[] => [ From 49433783676bd438dd8d790dbd6b4c2c5b1b5071 Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Fri, 15 Aug 2025 12:29:19 +0200 Subject: [PATCH 4/7] Update packages/tasks/src/model-libraries.ts --- packages/tasks/src/model-libraries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tasks/src/model-libraries.ts b/packages/tasks/src/model-libraries.ts index ba07298fc5..bf1c6c7a33 100644 --- a/packages/tasks/src/model-libraries.ts +++ b/packages/tasks/src/model-libraries.ts @@ -1156,7 +1156,7 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = { countDownloads: `path_extension:"pkl"`, snippets: snippets.vfimamba, }, - "lvface": { + lvface: { prettyLabel: "LVFace", repoName: "LVFace", repoUrl: "https://github.com/bytedance/LVFace", From e5ae24843aaa9349228b9ec4d4cb9164cc4b5d09 Mon Sep 17 00:00:00 2001 From: GitHup2016yjh Date: Fri, 15 Aug 2025 19:26:46 +0800 Subject: [PATCH 5/7] Update LVFace library --- packages/tasks/src/model-libraries-snippets.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index 4e6f60bdca..da5116b44f 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -1704,7 +1704,12 @@ model = Model.from_pretrained("${model.id}")`, ]; export const lvface = (model: ModelData): string[] => [ - `inferencer = LVFaceONNXInferencer(model_path=${model.id}, use_gpu=True)`, + `from huggingface_hub import hf_hub_download + from inference_onnx import LVFaceONNXInferencer + +model_path = hf_hub_download("${model.id}", "LVFace-L_Glint360K.onnx") +inferencer = LVFaceONNXInferencer(model_path, use_gpu=True, timeout=300) +embedding = inferencer.infer_from_image(img_path)`, ]; export const voicecraft = (model: ModelData): string[] => [ From 081377c7b3bede5f8760f2a49972255a2688ff94 Mon Sep 17 00:00:00 2001 From: GitHup2016yjh Date: Mon, 18 Aug 2025 21:38:45 +0800 Subject: [PATCH 6/7] Update LVFace library Co-authored-by: Pedro Cuenca --- packages/tasks/src/model-libraries-snippets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index da5116b44f..6cf472d3fd 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -1707,7 +1707,7 @@ export const lvface = (model: ModelData): string[] => [ `from huggingface_hub import hf_hub_download from inference_onnx import LVFaceONNXInferencer -model_path = hf_hub_download("${model.id}", "LVFace-L_Glint360K.onnx") +model_path = hf_hub_download("${model.id}", "LVFace-L_Glint360K/LVFace-L_Glint360K.onnx") inferencer = LVFaceONNXInferencer(model_path, use_gpu=True, timeout=300) embedding = inferencer.infer_from_image(img_path)`, ]; From e66f85c566c7dbb2da8c957c68ff39c301f10302 Mon Sep 17 00:00:00 2001 From: GitHup2016yjh Date: Wed, 20 Aug 2025 18:56:31 +0800 Subject: [PATCH 7/7] Update LVFace library --- packages/tasks/src/model-libraries-snippets.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index 6cf472d3fd..6d573c849d 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -1709,6 +1709,7 @@ export const lvface = (model: ModelData): string[] => [ model_path = hf_hub_download("${model.id}", "LVFace-L_Glint360K/LVFace-L_Glint360K.onnx") inferencer = LVFaceONNXInferencer(model_path, use_gpu=True, timeout=300) +img_path = 'path/to/image1.jpg' embedding = inferencer.infer_from_image(img_path)`, ];