Skip to content

Commit 83a9cb6

Browse files
authored
Add YOLOv10 as library (#884)
The YOLOv10 author already added `library_name: yolov10` into each of his model repos, e.g. https://huggingface.co/jameslahm/yolov10x. This PR adds a "How to use this model" button along with a code snippet. cc @jameslahm
1 parent a087416 commit 83a9cb6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,15 @@ wavs = chat.infer(texts, )
891891
torchaudio.save("output1.wav", torch.from_numpy(wavs[0]), 24000)`,
892892
];
893893

894+
export const yolov10 = (model: ModelData): string[] => [
895+
`from ultralytics import YOLOv10
896+
897+
model = YOLOv10.from_pretrained("${model.id}")
898+
source = 'http://images.cocodataset.org/val2017/000000039769.jpg'
899+
model.predict(source=source, save=True)
900+
`,
901+
];
902+
894903
export const birefnet = (model: ModelData): string[] => [
895904
`# Option 1: use with transformers
896905

packages/tasks/src/model-libraries.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
657657
docsUrl: "https://github.com/jasonppy/VoiceCraft",
658658
snippets: snippets.voicecraft,
659659
},
660+
yolov10: {
661+
prettyLabel: "YOLOv10",
662+
repoName: "yolov10",
663+
repoUrl: "https://github.com/THU-MIG/yolov10",
664+
docsUrl: "https://github.com/THU-MIG/yolov10",
665+
snippets: snippets.yolov10,
666+
},
660667
whisperkit: {
661668
prettyLabel: "WhisperKit",
662669
repoName: "WhisperKit",

0 commit comments

Comments
 (0)