Skip to content

Commit db3f727

Browse files
GitHup2016yjhVaibhavs10pcuenca
authored
Add LVFace library (#1685)
This PR adds LVFace, a new ViT-based face model, as a library. Thanks. - https://github.com/bytedance/LVFace - https://huggingface.co/bytedance-research/LVFace/tree/main --------- Co-authored-by: vb <vaibhavs10@gmail.com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
1 parent 483b19f commit db3f727

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,16 @@ export const vfimamba = (model: ModelData): string[] => [
17031703
model = Model.from_pretrained("${model.id}")`,
17041704
];
17051705

1706+
export const lvface = (model: ModelData): string[] => [
1707+
`from huggingface_hub import hf_hub_download
1708+
from inference_onnx import LVFaceONNXInferencer
1709+
1710+
model_path = hf_hub_download("${model.id}", "LVFace-L_Glint360K/LVFace-L_Glint360K.onnx")
1711+
inferencer = LVFaceONNXInferencer(model_path, use_gpu=True, timeout=300)
1712+
img_path = 'path/to/image1.jpg'
1713+
embedding = inferencer.infer_from_image(img_path)`,
1714+
];
1715+
17061716
export const voicecraft = (model: ModelData): string[] => [
17071717
`from voicecraft import VoiceCraft
17081718

packages/tasks/src/model-libraries.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
11561156
countDownloads: `path_extension:"pkl"`,
11571157
snippets: snippets.vfimamba,
11581158
},
1159+
lvface: {
1160+
prettyLabel: "LVFace",
1161+
repoName: "LVFace",
1162+
repoUrl: "https://github.com/bytedance/LVFace",
1163+
countDownloads: `path_extension:"pt" OR path_extension:"onnx"`,
1164+
snippets: snippets.lvface,
1165+
},
11591166
voicecraft: {
11601167
prettyLabel: "VoiceCraft",
11611168
repoName: "VoiceCraft",

0 commit comments

Comments
 (0)