Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#20413 YOLOE: Fix visual prompt training

Merged
Ghost merged 1 commits into Ultralytics:main from ultralytics:yoloe-vp-fix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
  1. // Ultralytics ๐Ÿš€ AGPL-3.0 License - https://ultralytics.com/license
  2. // Apply theme colors based on dark/light mode
  3. const applyTheme = (isDark) => {
  4. document.body.setAttribute(
  5. "data-md-color-scheme",
  6. isDark ? "slate" : "default",
  7. );
  8. document.body.setAttribute(
  9. "data-md-color-primary",
  10. isDark ? "black" : "indigo",
  11. );
  12. };
  13. // Check and apply appropriate theme based on system/user preference
  14. const checkTheme = () => {
  15. const palette = JSON.parse(localStorage.getItem(".__palette") || "{}");
  16. if (palette.index === 0) {
  17. // Auto mode is selected
  18. applyTheme(window.matchMedia("(prefers-color-scheme: dark)").matches);
  19. }
  20. };
  21. // Watch for system theme changes
  22. window
  23. .matchMedia("(prefers-color-scheme: dark)")
  24. .addEventListener("change", checkTheme);
  25. // Initialize theme handling on page load
  26. document.addEventListener("DOMContentLoaded", () => {
  27. // Watch for theme toggle changes
  28. document
  29. .getElementById("__palette_1")
  30. ?.addEventListener(
  31. "change",
  32. (e) => e.target.checked && setTimeout(checkTheme),
  33. );
  34. // Initial theme check
  35. checkTheme();
  36. });
  37. // Inkeep --------------------------------------------------------------------------------------------------------------
  38. document.addEventListener("DOMContentLoaded", () => {
  39. const enableSearchBar = true;
  40. const inkeepScript = document.createElement("script");
  41. inkeepScript.src =
  42. "https://cdn.jsdelivr.net/npm/@inkeep/cxkit-js@0.5/dist/embed.js";
  43. inkeepScript.type = "module";
  44. inkeepScript.defer = true;
  45. document.head.appendChild(inkeepScript);
  46. if (enableSearchBar) {
  47. const containerDiv = document.createElement("div");
  48. containerDiv.style.transform = "scale(0.7)";
  49. containerDiv.style.transformOrigin = "left center";
  50. const inkeepDiv = document.createElement("div");
  51. inkeepDiv.id = "inkeepSearchBar";
  52. containerDiv.appendChild(inkeepDiv);
  53. const headerElement = document.querySelector(".md-header__inner");
  54. const searchContainer = headerElement.querySelector(".md-header__source");
  55. if (headerElement && searchContainer) {
  56. headerElement.insertBefore(containerDiv, searchContainer);
  57. }
  58. }
  59. // Configuration object for Inkeep
  60. const config = {
  61. baseSettings: {
  62. apiKey: "13dfec2e75982bc9bae3199a08e13b86b5fbacd64e9b2f89",
  63. integrationId: "cm1shscmm00y26sj83lgxzvkw",
  64. organizationId: "org_e3869az6hQZ0mXdF",
  65. primaryBrandColor: "#E1FF25",
  66. organizationDisplayName: "Ultralytics",
  67. colorMode: {
  68. enableSystem: true,
  69. },
  70. theme: {
  71. styles: [
  72. {
  73. key: "main",
  74. type: "link",
  75. value: "/stylesheets/style.css",
  76. },
  77. {
  78. key: "chat-button",
  79. type: "style",
  80. value: `
  81. /* Light mode styling */
  82. .ikp-chat-button__button {
  83. background-color: #E1FF25;
  84. color: #111F68;
  85. }
  86. /* Dark mode styling */
  87. [data-theme="dark"] .ikp-chat-button__button {
  88. background-color: #40434f;
  89. color: #ffffff;
  90. }
  91. .ikp-chat-button__container {
  92. position: fixed;
  93. right: 1rem;
  94. bottom: 3rem;
  95. }
  96. `,
  97. },
  98. ],
  99. },
  100. },
  101. searchSettings: {
  102. placeholder: "Search",
  103. },
  104. aiChatSettings: {
  105. chatSubjectName: "Ultralytics",
  106. aiAssistantAvatar:
  107. "https://storage.googleapis.com/organization-image-assets/ultralytics-botAvatarSrcUrl-1729379860806.svg",
  108. exampleQuestions: [
  109. "What's new in Ultralytics YOLO11?",
  110. "How can I get started with Ultralytics HUB?",
  111. "How does Ultralytics Enterprise Licensing work?",
  112. ],
  113. getHelpOptions: [
  114. {
  115. name: "Ask on Ultralytics GitHub",
  116. icon: {
  117. builtIn: "FaGithub",
  118. },
  119. action: {
  120. type: "open_link",
  121. url: "https://github.com/ultralytics/ultralytics",
  122. },
  123. },
  124. {
  125. name: "Ask on Ultralytics Discourse",
  126. icon: {
  127. builtIn: "FaDiscourse",
  128. },
  129. action: {
  130. type: "open_link",
  131. url: "https://community.ultralytics.com/",
  132. },
  133. },
  134. {
  135. name: "Ask on Ultralytics Discord",
  136. icon: {
  137. builtIn: "FaDiscord",
  138. },
  139. action: {
  140. type: "open_link",
  141. url: "https://discord.com/invite/ultralytics",
  142. },
  143. },
  144. ],
  145. },
  146. };
  147. // Initialize Inkeep widgets when script loads
  148. inkeepScript.addEventListener("load", () => {
  149. const widgetContainer = document.getElementById("inkeepSearchBar");
  150. Inkeep.ChatButton(config);
  151. widgetContainer && Inkeep.SearchBar("#inkeepSearchBar", config);
  152. });
  153. });
Discard
Tip!

Press p or to see the previous file or, n or to see the next file