Skip to content

Commit

Permalink
Add YOLOv10 as library (#884)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
NielsRogge authored Sep 5, 2024
1 parent a087416 commit 83a9cb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,15 @@ wavs = chat.infer(texts, )
torchaudio.save("output1.wav", torch.from_numpy(wavs[0]), 24000)`,
];

export const yolov10 = (model: ModelData): string[] => [
`from ultralytics import YOLOv10
model = YOLOv10.from_pretrained("${model.id}")
source = 'http://images.cocodataset.org/val2017/000000039769.jpg'
model.predict(source=source, save=True)
`,
];

export const birefnet = (model: ModelData): string[] => [
`# Option 1: use with transformers
Expand Down
7 changes: 7 additions & 0 deletions packages/tasks/src/model-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
docsUrl: "https://github.com/jasonppy/VoiceCraft",
snippets: snippets.voicecraft,
},
yolov10: {
prettyLabel: "YOLOv10",
repoName: "yolov10",
repoUrl: "https://github.com/THU-MIG/yolov10",
docsUrl: "https://github.com/THU-MIG/yolov10",
snippets: snippets.yolov10,
},
whisperkit: {
prettyLabel: "WhisperKit",
repoName: "WhisperKit",
Expand Down

0 comments on commit 83a9cb6

Please sign in to comment.