Commit ba42e0b
authored
Make ultralytics code snippet generic (#1101)
Follow-up PR after
#1093 and especially
this thread
#1093 (comment).
I agree with @NielsRogge's point that `ultralytics` _is_ the library
name. Yolov8 or Yolov10 are "just" model names.
---
_originally from @merveenoyan
(#1093 (comment)
> there's no way of knowing which yolo version would it be because
there's no config file.
The solution I suggest in this PR is to use the repo tags instead. I
have checked and all 258 [ultralytics
models](https://huggingface.co/models?other=ultralytics) have a "yolovX"
tag.
~In parallel I suggest to remove the `yolov10` library since code
snippet is now correctly generated for them as well. I have checked and
[29 out of 63 yolov10
models](https://huggingface.co/models?other=yolov10) don't have the
`ultranalytics` tag so they'll loose the code snippet. If we agree on
this solution I'll open PRs on these repos and everything should be
good.~ See below: in the end, I kept `yolov10` but unified the code
snippet generation.
@merveenoyan @NielsRogge @pcuenca let me know what you think. Will this
definitely close the yolo/ultranalytics tags matter ?
**Note:** some models have multiple yolo tags (e.g.
https://huggingface.co/Ultralytics/YOLOv8 has v10, v8, v3, v5, v9). In
that case I suggest to only take the first one (v10 in this case). But
to be honest, this looks more like something to fix in the model's
metadata
[here](https://huggingface.co/Ultralytics/YOLOv8/blob/main/README.md?code=true#L13).1 parent 51413a4 commit ba42e0b
File tree
2 files changed
+32
-30
lines changed- packages/tasks/src
2 files changed
+32
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
1031 | | - | |
1032 | | - | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
1033 | 1034 | | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
1039 | 1039 | | |
1040 | | - | |
1041 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1042 | 1043 | | |
1043 | | - | |
| 1044 | + | |
1044 | 1045 | | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1048 | 1049 | | |
1049 | 1050 | | |
1050 | 1051 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
822 | 831 | | |
823 | 832 | | |
824 | 833 | | |
| |||
848 | 857 | | |
849 | 858 | | |
850 | 859 | | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | 860 | | |
869 | 861 | | |
870 | 862 | | |
| |||
873 | 865 | | |
874 | 866 | | |
875 | 867 | | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
876 | 877 | | |
877 | 878 | | |
878 | 879 | | |
| |||
0 commit comments