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