Skip to content

Commit 6a4dddf

Browse files
merveenoyanMerve Noyanpcuenca
authored
add yolov8 as a library (#1093)
ping @NielsRogge also @pcuenca for review I feel like it makes sense to add this as a separate library rather than "yolo" since other orgs can come up with new yolo models, which would have a separate link (like yolov10) --------- Co-authored-by: Merve Noyan <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]>
1 parent 86b1f2e commit 6a4dddf

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

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

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

1031+
export const ultralytics = (model: ModelData): string[] => [
1032+
`from ultralytics import YOLOv8 # modify the yolo version here
1033+
1034+
model = YOLOv8.from_pretrained("${model.id}")
1035+
source = 'http://images.cocodataset.org/val2017/000000039769.jpg'
1036+
model.predict(source=source, save=True)
1037+
`,
1038+
];
1039+
10311040
export const yolov10 = (model: ModelData): string[] => [
10321041
`from ultralytics import YOLOv10
10331042

packages/tasks/src/model-libraries.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,11 +843,21 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
843843
docsUrl: "https://github.com/jasonppy/VoiceCraft",
844844
snippets: snippets.voicecraft,
845845
},
846+
ultralytics: {
847+
prettyLabel: "ultralytics",
848+
repoName: "ultralytics",
849+
repoUrl: "https://github.com/ultralytics/ultralytics",
850+
docsUrl: "https://github.com/ultralytics/ultralytics",
851+
filter: false,
852+
countDownloads: `path_extension:"pt"`,
853+
snippets: snippets.ultralytics,
854+
},
846855
yolov10: {
847856
prettyLabel: "YOLOv10",
848857
repoName: "yolov10",
849858
repoUrl: "https://github.com/THU-MIG/yolov10",
850859
docsUrl: "https://github.com/THU-MIG/yolov10",
860+
countDownloads: `path_extension:"pt"`,
851861
snippets: snippets.yolov10,
852862
},
853863
whisperkit: {

0 commit comments

Comments
 (0)