You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

new.tmpl 20 kB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. {{template "base/head" .}}
  2. <style>
  3. .unite {
  4. font-family: SourceHanSansSC-medium !important;
  5. color: rgba(16, 16, 16, 100) !important;
  6. }
  7. .title {
  8. font-size: 16px !important;
  9. padding-left: 3rem !important;
  10. }
  11. .min_title{
  12. font-size: 14px !important;
  13. margin-bottom: 2rem !important;
  14. }
  15. .width81 {
  16. margin-left: 1.5rem;
  17. width: 81% !important;
  18. }
  19. .width48 {
  20. width: 48.5% !important;
  21. }
  22. .nowrapx {
  23. white-space: nowrap !important;
  24. }
  25. </style>
  26. <!-- <div class="ui page dimmer">
  27. <div class="ui text loader">{{.i18n.Tr "loading"}}</div>
  28. </div> -->
  29. <div id="mask">
  30. <div id="loadingPage">
  31. <div class="rect1"></div>
  32. <div class="rect2"></div>
  33. <div class="rect3"></div>
  34. <div class="rect4"></div>
  35. <div class="rect5"></div>
  36. </div>
  37. </div>
  38. <div class="repository">
  39. {{template "repo/header" .}}
  40. <div class="ui container">
  41. {{template "base/alert" .}}
  42. <h4 class="ui top attached header">
  43. {{.i18n.Tr "repo.modelarts.evaluate_job.new_job"}}
  44. </h4>
  45. <div class="ui attached segment">
  46. <input type="hidden" name="benchmarkMode" value="{{.benchmarkMode}}">
  47. {{if eq .benchmarkMode "model"}}
  48. <form class="ui form model_form" action="{{.Link}}?benchmarkMode=model" method="post">
  49. {{.CsrfTokenHtml}}
  50. <input type="hidden" name="action" value="update">
  51. <div class="required min_title inline field">
  52. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_scenes"}}</label>
  53. <div class="ui blue small menu compact selectcloudbrain">
  54. <a class="item alogrithm_benchmark"
  55. href="{{.Link}}?benchmarkMode=alogrithm">{{.i18n.Tr "repo.cloudbrain.benchmark.algorithm"}}</a>
  56. <a class="active item model_benchmark"
  57. href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
  58. </div>
  59. {{template "custom/wait_count_train" Dict "ctx" $ "type" .benchmark_gpu_types}}
  60. </div>
  61. <div>
  62. <div class="required min_title inline field">
  63. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
  64. <input style="width: 80%;" name="display_job_name" id="trainjob_job_name"
  65. placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}"
  66. tabindex="3" autofocus required maxlength="254">
  67. <span class="tooltips" style="display: block;margin-left:11.5rem;">{{.i18n.Tr "cloudbrain.job_name_rule"}}</span>
  68. </div>
  69. <div class="required min_title inline field">
  70. <label class="label-fix-width" style="font-weight: normal;"
  71. for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label>
  72. <textarea style="width: 80%;" id="description" name="description" rows="3" required
  73. maxlength="254" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}
  74. onchange="this.value=this.value.substring(0, 255)"
  75. onkeydown="this.value=this.value.substring(0, 255)"
  76. onkeyup="this.value=this.value.substring(0, 255)">{{.description}}</textarea>
  77. </div>
  78. <div class="required min_title inline field">
  79. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label>
  80. <select id="cloudbrain_gpu_type" class="ui search dropdown width48" placeholder="选择GPU类型"
  81. name="gpu_type">
  82. {{range .benchmark_gpu_types}}
  83. <option value="{{.Queue}}">{{.Value}}</option>
  84. {{end}}
  85. </select>
  86. </div>
  87. <div class="required unite min_title two inline fields" style="margin-left: 80px;">
  88. <div class="required ten wide field" style="width: 26.5% !important;">
  89. <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.task_type"}}</label>&nbsp;
  90. <select id="cloudbrain_job_type" class="ui search dropdown job_type"
  91. placeholder="select {{.i18n.Tr "cloudbrain.task_type"}}" name="job_type">
  92. <option value="SNN4IMAGENET">SNN4IMAGENET</option>
  93. <option value="BRAINSCORE">BRAINSCORE</option>
  94. </select>
  95. </div>
  96. <div class="required six widde field" id="brainscore_child_type"
  97. style="width: 15% !important;display: none;">
  98. <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.brain_area"}}</label>
  99. <select class="ui search dropdown" placeholder="select {{.i18n.Tr "cloudbrain.brain_area"}}"
  100. name="benchmark_child_types_id">
  101. <option value="0">V1</option>
  102. <option value="1">V2</option>
  103. <option value="2">V4</option>
  104. <option value="3">IT</option>
  105. </select>
  106. </div>
  107. <span>
  108. <i class="question circle icon link"
  109. data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}}
  110. data-position="right center" data-variation="mini"></i>
  111. </span>
  112. <a id="benchmark_model_example" href="https://git.openi.org.cn/BDIP/snn4imagenet"
  113. target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
  114. </div>
  115. <div id="images-new-cb">
  116. </div>
  117. {{template "custom/select_dataset_train" .}}
  118. <div class="required min_title inline field" style="margin-top:2rem;">
  119. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
  120. <select id="cloudbrain_resource_spec" class="ui search dropdown"
  121. placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px'
  122. name="resource_spec_id">
  123. {{range .benchmark_resource_specs}}
  124. <option name="resource_spec_id" value="{{.Id}}">
  125. {{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}
  126. </option>
  127. {{end}}
  128. </select>
  129. </div>
  130. <div class="inline min_title field">
  131. <label class="label-fix-width" style="font-weight: normal;"></label>
  132. <button class="ui create_train_job green button">
  133. {{.i18n.Tr "repo.cloudbrain.new"}}
  134. </button>
  135. <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  136. </div>
  137. </div>
  138. </form>
  139. {{else}}
  140. <form class="ui form alogrithm_form" action="{{.Link}}?benchmarkMode=alogrithm" method="post">
  141. {{.CsrfTokenHtml}}
  142. <input type="hidden" name="action" value="update">
  143. <input type="hidden" name="job_type" value="BENCHMARK">
  144. <div class="required min_title inline field">
  145. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_scenes"}}</label>
  146. <div class="ui blue small menu compact selectcloudbrain">
  147. <a class="active item alogrithm_benchmark"
  148. href="{{.Link}}?benchmarkMode=alogrithm">{{.i18n.Tr "repo.cloudbrain.benchmark.algorithm"}}</a>
  149. <a class="item model_benchmark"
  150. href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
  151. </div>
  152. {{template "custom/wait_count_train" Dict "ctx" $ "type" .benchmark_gpu_types}}
  153. </div>
  154. <div>
  155. <div class="required min_title inline field">
  156. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
  157. <input style="width: 80%;" name="display_job_name" id="trainjob_job_name"
  158. placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}"
  159. tabindex="3" autofocus required maxlength="254">
  160. <span class="tooltips" style="display: block;margin-left: 11.5rem;">{{.i18n.Tr "cloudbrain.job_name_rule"}}</span>
  161. </div>
  162. <div class="min_title inline field">
  163. <label class="label-fix-width" style="font-weight: normal;"
  164. for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label>
  165. <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="254"
  166. placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}
  167. onchange="this.value=this.value.substring(0, 255)"
  168. onkeydown="this.value=this.value.substring(0, 255)"
  169. onkeyup="this.value=this.value.substring(0, 255)">{{.description}}</textarea>
  170. </div>
  171. <div class="required min_title inline field">
  172. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label>
  173. <select id="cloudbrain_gpu_type" class="ui search dropdown" placeholder="选择GPU类型"
  174. style='width:385px' name="gpu_type">
  175. {{range .benchmark_gpu_types}}
  176. <option value="{{.Queue}}">{{.Value}}</option>
  177. {{end}}
  178. </select>
  179. </div>
  180. <div class="required unite inline min_title fields" style="width: 90%;margin-left: 5.7rem;">&nbsp;
  181. <div class="required eight wide field">
  182. <label
  183. style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_type"}}</label>
  184. <select class="ui fluid selection search dropdown" id="benchmark_types_id"
  185. name="benchmark_types_id">
  186. {{range .benchmark_types}}
  187. {{if eq .Id $.benchmarkTypeID}}
  188. <option value="{{.Id}}" selected="true">{{.First}}</option>
  189. {{else}}
  190. <option value="{{.Id}}">{{.First}}</option>
  191. {{end}}
  192. {{end}}
  193. </select>
  194. </div>
  195. <div class="eight wide field" id="engine_name">
  196. <input type="hidden" id="benchmark_child_types_id_hidden"
  197. name="benchmark_child_types_id_hidden" value="{{.benchmark_child_types_id_hidden}}">
  198. <label
  199. style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_child_type"}}</label>
  200. <select class="ui fluid selection dropdown nowrapx" id="benchmark_child_types_id"
  201. style='width: 100%;' name="benchmark_child_types_id">
  202. </select>
  203. </div>
  204. </div>
  205. <div id="images-new-cb">
  206. </div>
  207. <div class="required min_title inline field">
  208. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
  209. <select id="cloudbrain_resource_spec" class="ui search dropdown"
  210. placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px'
  211. name="resource_spec_id">
  212. {{range .benchmark_resource_specs}}
  213. <option name="resource_spec_id" value="{{.Id}}">
  214. {{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}
  215. </option>
  216. {{end}}
  217. </select>
  218. </div>
  219. <div class="inline min_title field required">
  220. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_train"}}</label>
  221. <input disabled="disabled" style="width: 33.5%;" name="train_file" id="train_file"
  222. value="train.py" tabindex="3" autofocus required maxlength="254">
  223. <a id="train_href_id" href="https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark"
  224. target="_blank">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_train"}}</a>
  225. </div>
  226. <div class="inline min_title field required">
  227. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_test"}}</label>
  228. <input disabled="disabled" style="width: 33.5%;" name="test_file" id="test_file" value="test.py"
  229. tabindex="3" autofocus required maxlength="254">
  230. <a id="test_href_id" href="https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark"
  231. target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
  232. </div>
  233. <div class="inline unite min_title field">
  234. <label class="label-fix-width" style="font-weight: normal;"></label>
  235. <button class="ui create_train_job green button">
  236. {{.i18n.Tr "repo.cloudbrain.new"}}
  237. </button>
  238. <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  239. </div>
  240. </div>
  241. </form>
  242. {{end}}
  243. </div>
  244. </div>
  245. </div>
  246. {{template "base/footer" .}}
  247. <script>
  248. let repolink = {{.RepoLink }}
  249. let url_href = window.location.pathname.split('create')[0]
  250. $(".ui.button").attr('href', url_href)
  251. $('.menu .item')
  252. .tab();
  253. $('#benchmark_types_id').change(function () {
  254. setChildType();
  255. })
  256. $(document).ready(() => {
  257. $('.ui.search.dropdown.job_type').dropdown({
  258. onChange: function (value, text, $selectedItem) {
  259. if (value === "BRAINSCORE") {
  260. $('#brainscore_child_type').css('display', 'block')
  261. $('#benchmark_model_example').attr('href', 'https://git.openi.org.cn/BDIP/similarity2brain_ann')
  262. } else {
  263. $('#brainscore_child_type').css('display', 'none')
  264. $('#benchmark_model_example').attr('href', 'https://git.openi.org.cn/BDIP/snn4imagenet')
  265. }
  266. }
  267. })
  268. })
  269. function setChildType() {
  270. let type_id = $('#benchmark_types_id').val();
  271. if (type_id == 3) {
  272. $('#train_href_id').attr('href', 'https://git.openi.org.cn/CV_benchmark/CV_MOT_benchmark');
  273. $('#test_href_id').attr('href', 'https://git.openi.org.cn/CV_benchmark/CV_MOT_benchmark');
  274. } else {
  275. $('#train_href_id').attr('href', 'https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark');
  276. $('#test_href_id').attr('href', 'https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark');
  277. }
  278. let child_selected_id = $('#benchmark_child_types_id_hidden').val();
  279. $.get(`${repolink}/cloudbrain/benchmark/get_child_types?benchmark_type_id=${type_id}`, (data) => {
  280. const n_length = data['child_types'].length
  281. let html = ''
  282. for (let i = 0; i < n_length; i++) {
  283. if (child_selected_id == data['child_types'][i].id) {
  284. html += `<option value="${data['child_types'][i].id}" selected="true">${data['child_types'][i].value}</option>`;
  285. } else {
  286. html += `<option value="${data['child_types'][i].id}">${data['child_types'][i].value}</option>`;
  287. }
  288. }
  289. document.getElementById("benchmark_child_types_id").innerHTML = html;
  290. })
  291. }
  292. document.onreadystatechange = function () {
  293. if (document.readyState === "complete") {
  294. if ($('input[name=benchmarkMode]').val() === 'alogrithm' || $('input[name=benchmarkMode]').val() === '') {
  295. setChildType();
  296. }
  297. }
  298. }
  299. function validate() {
  300. $('.ui.form')
  301. .form({
  302. on: 'blur',
  303. fields: {
  304. image: {
  305. identifier: 'image',
  306. rules: [
  307. {
  308. type: 'empty',
  309. promt: ''
  310. }
  311. ]
  312. },
  313. display_job_name: {
  314. identifier: 'display_job_name',
  315. rules: [
  316. {
  317. type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[a-zA-Z0-9_]$/]',
  318. promt: ''
  319. }
  320. ]
  321. },
  322. },
  323. onSuccess: function () {
  324. // $('.ui.page.dimmer').dimmer('show')
  325. document.getElementById("mask").style.display = "block"
  326. },
  327. onFailure: function (e) {
  328. return false;
  329. }
  330. })
  331. }
  332. validate()
  333. $('.ui.create_train_job.green.button').click(function (e) {
  334. validate()
  335. })
  336. </script>