paddlex_restful_demo.html 142 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905
  1. <!--
  2. # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. -->
  16. <!doctype html>
  17. <html>
  18. <head>
  19. <meta charset="utf-8">
  20. <title>欢迎使用 PaddleX RestfulAPI Demo示例程序</title>
  21. <style type="text/css">
  22. h1{
  23. font:400 40px 'pt sans',sans-serif;
  24. text-align:center;
  25. }
  26. .nav a{
  27. text-decoration:none;
  28. }
  29. .nav{
  30. height:70px;
  31. background:#0000cd;
  32. position:relative;
  33. z-index:6;
  34. }
  35. .nav>ul{
  36. position:relative;
  37. list-style:none;
  38. padding:0;
  39. margin:0;
  40. }
  41. .nav>ul>li>ul{
  42. position:absolute;
  43. left:0;
  44. padding:0;
  45. margin:0;
  46. list-style:none;
  47. }
  48. .nav>ul>li:hover>ul li a{
  49. opacity:1;
  50. height:50px;
  51. transition:all .3s linear;
  52. -o-transition:all .3s linear;
  53. -moz-transition:all .3s linear;
  54. -webkit-transition:all .3s linear;
  55. }
  56. .nav>ul>li>ul a{
  57. display:block;
  58. color:#222;
  59. width:150px;
  60. line-height:50px !important;
  61. font:700 16px 'pt sans',sans-serif;
  62. background:#eee;
  63. border-bottom:1px solid #ddd;
  64. text-align:center;
  65. padding:0 5px;
  66. height:0;
  67. overflow:hidden;
  68. opacity:0;
  69. transition:all .3s linear .2s;
  70. -o-transition:all .3s linear .2s;
  71. -moz-transition:all .3s linear .2s;
  72. -webkit-transition:all .3s linear .2s;
  73. }
  74. .nav>ul>li>ul a:hover{
  75. display:block;
  76. color:#222;
  77. width:150px;
  78. line-height:50px !important;
  79. font:700 16px 'pt sans',sans-serif;
  80. background:#A8D9FF;
  81. border-bottom:1px solid #ddd;
  82. text-align:center;
  83. padding:0 5px;
  84. height:0;
  85. overflow:hidden;
  86. opacity:0;
  87. transition:all .3s linear .2s;
  88. -o-transition:all .3s linear .2s;
  89. -moz-transition:all .3s linear .2s;
  90. -webkit-transition:all .3s linear .2s;
  91. }
  92. .nav>ul>li{
  93. float:left;
  94. position:relative;
  95. }
  96. .nav>ul>li>a{
  97. padding:0 20px;
  98. color:#fff;
  99. display:block;
  100. line-height:70px !important;
  101. font:400 15px 'PT Sans', sans-serif;
  102. text-decoration:none;
  103. }
  104. .lamp span{
  105. display:block;
  106. height:4px;
  107. background:#ee6666;
  108. position: relative;
  109. }
  110. .lamp span:after {
  111. bottom: 100%;
  112. left: 50%;
  113. border: solid transparent;
  114. content: " ";
  115. height: 0;
  116. width: 0;
  117. position: absolute;
  118. pointer-events: none;
  119. border-color: rgba(238, 102, 102, 0);
  120. border-bottom-color: #ee6666;
  121. border-width: 4px;
  122. margin-left: -4px;
  123. }
  124. .lamp{
  125. position:absolute !important;
  126. height:4px;
  127. top:66px;
  128. background:#333;
  129. transition:all .3s linear;
  130. -o-transition:all .3s linear;
  131. -moz-transition:all .3s linear;
  132. -webkit-transition:all .3s linear;
  133. }
  134. .selected.active>a,.active>a{
  135. transition:all .3s linear;
  136. -o-transition:all .3s linear;
  137. -moz-transition:all .3s linear;
  138. -webkit-transition:all .3s linear;
  139. color:#fff;
  140. }
  141. .credit{
  142. text-align:center;
  143. margin:20px 0;
  144. }
  145. .blog-link{
  146. color:#fff;
  147. text-decoration:none;
  148. background:#eee;
  149. background-size:40px;
  150. line-height:50px;
  151. display:inline-block;
  152. padding:0 10px;
  153. border-radius:px;
  154. border-bottom:3px solid #ddd;
  155. color:#333;
  156. font-family:'open sans',sans-serif;
  157. margin:10px;
  158. }
  159. .dgithub{
  160. color:#fff;
  161. text-decoration:none;
  162. background-size:40px;
  163. line-height:50px;
  164. display:inline-block;
  165. padding:0 10px 0 50px;
  166. background-position:5px;
  167. border-radius:4px;
  168. border-bottom:3px solid #ddd;
  169. color:#333;
  170. font-family:'open sans',sans-serif;
  171. margin:10px;
  172. }
  173. #draw-border {
  174. display: flex;
  175. align-items: center;
  176. justify-content: center;
  177. height: 10vh;
  178. }
  179. view_item {
  180. border: 1px solid;
  181. background: none;
  182. width: 300px;
  183. height:170px;
  184. text-transform: uppercase;
  185. text-align:left;
  186. color: #4361ee;
  187. font-weight: bold;
  188. position: relative;
  189. outline: none;
  190. padding: 10px 10px;
  191. box-sizing: border-box;
  192. border-radius: 8px;
  193. cursor: pointer;
  194. value: "";
  195. }
  196. view_item::before, view_item::after {
  197. box-sizing: inherit;
  198. position: absolute;
  199. content: '';
  200. border: 2px solid transparent;
  201. width: 0;
  202. height: 0;
  203. border-radius: 6px;
  204. }
  205. view_item::after {
  206. bottom: 0;
  207. right: 0;
  208. }
  209. view_item::before {
  210. top: 0;
  211. left: 0;
  212. }
  213. view_item:hover::before, view_item:hover::after {
  214. width: 100%;
  215. height: 100%;
  216. }
  217. view_item:hover::before {
  218. border-top-color: #4361ee;
  219. border-right-color: #4361ee;
  220. transition: width 0s ease-out, height 0s ease-out 0s;
  221. }
  222. view_item:hover::after {
  223. border-bottom-color: #4361ee;
  224. border-left-color: #4361ee;
  225. transition: border-color 0s ease-out 0s, width 0s ease-out 0s, height 0s ease-out 0s;
  226. }
  227. body { background: #f6f6f6;}
  228. .btn {
  229. width: 120px;
  230. height: 40px;
  231. display: inline-block;
  232. //padding: 2px;
  233. border-radius: 10px;
  234. vertical-align: middle;
  235. background: #0000cd;
  236. //background: linear-gradient(268deg,#e3164e,#7f1ba7,#841c39,#e993e7,#d27228);
  237. background-size: 1000% 1000%;
  238. -webkit-animation: gradient 10s ease infinite;
  239. -moz-animation: gradient 10s ease infinite;
  240. -o-animation: Agradient 10s ease infinite;
  241. animation: gradient 10s ease infinite;
  242. }
  243. .btn input {
  244. font: 300 14px/14px 'Source Sans Pro',sans-serif;
  245. letter-spacing: 1px;
  246. display: block;
  247. position: relative;
  248. width: 100%;
  249. height: 100%;
  250. text-transform: uppercase;
  251. background: #0000cd;
  252. border: none;
  253. outline: none;
  254. border-radius: 10px;
  255. color: #f6f6f6;
  256. cursor: pointer;
  257. transition: all 0.3s cubic-bezier(0.645,0.045,0.355,1)
  258. }
  259. .btn:hover input {
  260. background: transparent;
  261. color: #f6f6f6;
  262. letter-spacing: 1px;
  263. outline: 1px;
  264. background: #0000e7;
  265. }
  266. .btn-toggle-mx {
  267. -webkit-transform: rotateY(0deg);
  268. transform: rotateY(0deg);
  269. -webkit-transition: 0.8s all;
  270. -o-transition: 0.8s all;
  271. transition: 0.8s all
  272. }
  273. .btn-toggle-mx.transmx {
  274. -webkit-transform: rotateY(180deg);
  275. transform: rotateY(180deg);
  276. }
  277. .progress {
  278. height:20px;
  279. background:#ebebeb;
  280. border-left:1px solid transparent;
  281. border-right:1px solid transparent;
  282. border-radius:10px;
  283. }
  284. .progress > span {
  285. position:relative;
  286. float:left;
  287. margin:0 -1px;
  288. min-width:30px;
  289. height:18px;
  290. line-height:16px;
  291. text-align:right;
  292. background:#cccccc;
  293. border:1px solid;
  294. border-color:#bfbfbf #b3b3b3 #9e9e9e;
  295. border-radius:10px;
  296. background-image:-webkit-linear-gradient(top,#f0f0f0 0%,#dbdbdb 70%,#cccccc 100%);
  297. background-image:-moz-linear-gradient(top,#f0f0f0 0%,#dbdbdb 70%,#cccccc 100%);
  298. background-image:-o-linear-gradient(top,#f0f0f0 0%,#dbdbdb 70%,#cccccc 100%);
  299. background-image:linear-gradient(to bottom,#f0f0f0 0%,#dbdbdb 70%,#cccccc 100%);
  300. -webkit-box-shadow:inset 0 1px rgba(255,255,255,0.3),0 1px 2px rgba(0,0,0,0.2);
  301. box-shadow:inset 0 1px rgba(255,255,255,0.3),0 1px 2px rgba(0,0,0,0.2);
  302. }
  303. .progress > span > span {
  304. padding:0 8px;
  305. font-size:9px;
  306. font-weight:bold;
  307. color:#404040;
  308. color:rgba(0,0,0,0.7);
  309. text-shadow:0 1px rgba(255,255,255,0.4);
  310. }
  311. .progress > span:before {
  312. content:'';
  313. position:absolute;
  314. top:0;
  315. bottom:0;
  316. left:0;
  317. right:0;
  318. z-index:1;
  319. height:18px;
  320. border-radius:10px;
  321. }
  322. .progress .green {
  323. background:#85c440;
  324. border-color:#78b337 #6ba031 #568128;
  325. background-image:-webkit-linear-gradient(top,#b7dc8e 0%,#99ce5f 70%,#85c440 100%);
  326. background-image:-moz-linear-gradient(top,#b7dc8e 0%,#99ce5f 70%,#85c440 100%);
  327. background-image:-o-linear-gradient(top,#b7dc8e 0%,#99ce5f 70%,#85c440 100%);
  328. background-image:linear-gradient(to bottom,#b7dc8e 0%,#99ce5f 70%,#85c440 100%);
  329. }
  330. .progress .blue {
  331. background:#5aaadb;
  332. border-color:#459fd6 #3094d2 #277db2;
  333. background-image:-webkit-linear-gradient(top,#aed5ed 0%,#7bbbe2 70%,#5aaadb 100%);
  334. background-image:-moz-linear-gradient(top,#aed5ed 0%,#7bbbe2 70%,#5aaadb 100%);
  335. background-image:-o-linear-gradient(top,#aed5ed 0%,#7bbbe2 70%,#5aaadb 100%);
  336. background-image:linear-gradient(to bottom,#aed5ed 0%,#7bbbe2 70%,#5aaadb 100%);
  337. }
  338. #popupmenu_project{
  339. border:1px solid #ddd;
  340. background: #eee;
  341. position: absolute;
  342. width: 200px;
  343. height: 140px;
  344. display: none;
  345. z-index:8;
  346. }
  347. .popupmenu_project tr:hover{background:#A8D9FF;}
  348. #popupmenu_dataset{
  349. border:1px solid #ddd;
  350. background: #eee;
  351. position: absolute;
  352. width: 200px;
  353. height: 50px;
  354. display: none;
  355. z-index:8;
  356. }
  357. .popupmenu_dataset tr:hover{background:#A8D9FF;}
  358. #popupmenu_task{
  359. border:1px solid #ddd;
  360. background: #eee;
  361. position: absolute;
  362. width: 200px;
  363. height: 50px;
  364. display: none;
  365. z-index:8;
  366. }
  367. .popupmenu_task tr:hover{background:#A8D9FF;}
  368. #popupmenu_model{
  369. border:1px solid #ddd;
  370. background: #eee;
  371. position: absolute;
  372. width: 200px;
  373. height: 50px;
  374. display: none;
  375. z-index:8;
  376. }
  377. .popupmenu_model tr:hover{background:#A8D9FF;}
  378. .scroll-content{
  379. height: 220px;
  380. }
  381. .table-parms-head{padding-right:17px;background-color:#999;color:#000;}
  382. .table-parms-head table,.table-body table{width:100%;}
  383. .table-parms-body{width:100%; height:210px;overflow-y:scroll;}
  384. .table-parms-body table tr:nth-child(2n+1){background-color:#f2f2f2;}
  385. .table-dataset-labels{width:100%; height:210px; border:1px solid #D6D6D6; overflow-y:scroll; padding:0px 0px;}
  386. .table-dataset-labels table tr:nth-child(2n){background-color:#f2f2f2; padding:0px 0px;}
  387. .table-dataset-labels table td{border:solid #f2f2f2; border-width:0px 1px 1px 0px; padding:0px 0px;}
  388. .table-dataset-imgs{width:100%; height:210px; border:1px solid #D6D6D6; overflow-y:scroll;}
  389. </style>
  390. <script type="text/javascript">
  391. //server url address
  392. var str_srv_url = "http://0.0.0.0:8080";
  393. //数据集选择列表,用于创建项目时下拉选择
  394. var g_dataset_list = {};
  395. //创建任务时任务参数dic
  396. var g_train_task_parms = {};
  397. //保存刷新项目任务时需要使用的项目id及type
  398. var g_view_project_task_id = "";
  399. var g_view_project_task_type = "classification";
  400. //用于刷新任务定时器句柄
  401. var g_instance_refresh_clock;
  402. //浏览数据集变量
  403. var g_dataset_files = {};
  404. var g_dataset_train_files = {};
  405. var g_dataset_evaluate_files = {};
  406. var g_dataset_test_files = {};
  407. //记录当前页
  408. var g_current_dataset_page = 1;
  409. //每页显示几张图片
  410. var g_const_imgs_per_page = 3;
  411. //当前标签
  412. var g_current_dataset_lable_name = "";
  413. //是否显示标注
  414. var g_b_show_img_labels = false;
  415. //显示数据集范围(默认全量数据)
  416. var g_b_show_dataset_type = "all";
  417. //数据集状态
  418. var DatasetStatus = {
  419. XEMPTY:0, //空数据集
  420. XCHECKING:1, //正在验证数据集
  421. XCHECKFAIL:2, //数据集验证失败
  422. XCOPYING:3, //正在导入数据集
  423. XCOPYDONE:4, //数据集导入成功
  424. XCOPYFAIL:5, //数据集导入失败
  425. XSPLITED:6 //数据集已经切分
  426. };
  427. //任务状态
  428. var TaskStatus = {
  429. XUNINIT:0, //任务还未初始化
  430. XINIT:1, //任务初始化
  431. XDOWNLOADING:2, //正在下载预训练模型
  432. XTRAINING:3, //任务正在运行中,该状态下任务不能被删除
  433. XTRAINDONE:4, //任务完成运行
  434. XEVALUATED:5, //任务评估完成
  435. XEXPORTING:6, //任务正在导出inference模型
  436. XEXPORTED:7, //任务已经导出模型
  437. XTRAINEXIT:8, //任务运行中止
  438. XDOWNLOADFAIL:9, //任务下载失败
  439. XTRAINFAIL:10, //任务运行失败
  440. XEVALUATING:11, //任务评估中
  441. XEVALUATEFAIL:12, //任务评估失败
  442. XEXPORTFAIL:13, //任务导出模型失败
  443. XPRUNEING:14, //裁剪分析任务运行中
  444. XPRUNETRAIN:15 //裁剪训练任务运行中
  445. };
  446. //参数范围
  447. var Model_List = {
  448. "classification":["MobileNetV2", "ResNet18", "ResNet34", "ResNet50", "ResNet101",
  449. "ResNet50_vd", "ResNet101_vd", "ResNet50_vd_ssld", "ResNet101_vd_ssld",
  450. "DarkNet53", "MobileNetV1", "MobileNetV3_small", "MobileNetV3_large",
  451. "MobileNetV3_small_ssld", "MobileNetV3_large_ssld", "Xception41",
  452. "Xception65", "DenseNet121", "DenseNet161", "DenseNet201","ShuffleNetV2"],
  453. "detection":["YOLOv3", "FasterRCNN", "PPYOLO"],
  454. "segmentation":["DeepLabv3p", "U-Net", "HRNet_W18", "FastSCNN"],
  455. "instance_segmentation":["MaskRCNN"]
  456. }
  457. var Backbone_List = {
  458. "YOLOv3": ["DarkNet53", "ResNet34", "MobileNetV1", "MobileNetV3_large"],
  459. "PPYOLO": ["ResNet50_vd_ssld"],
  460. "FasterRCNN": ["ResNet18", "ResNet50", "ResNet50_vd", "ResNet101", "ResNet101_vd", "HRNet_W18"],
  461. "DeepLabv3p": ["Xception65", "Xception41", "MobileNetV3_large_x1_0_ssld", "MobileNetV2_x0.25",
  462. "MobileNetV2_x0.5", "MobileNetV2_x1.0", "MobileNetV2_x1.5","MobileNetV2_x2.0"],
  463. "MaskRCNN": ["ResNet18", "ResNet50", "ResNet50_vd", "ResNet101", "ResNet101_vd", "HRNet_W18"]
  464. }
  465. //显示服务器配置窗口
  466. function show_server_info(input_data)
  467. {
  468. var srv_url_text = document.getElementById('server_url_text');
  469. srv_url_text.value = str_srv_url;
  470. var input_crt_prj_win = document.getElementById('input_win_cfg_server');
  471. var input_crt_prj_win_over = document.getElementById('input_win_cfg_server_over');
  472. input_crt_prj_win.style.display = "block";
  473. input_crt_prj_win_over.style.display = "block";
  474. }
  475. //隐藏服务器配置窗口
  476. function hide_server_info(input_data)
  477. {
  478. var on_win_user = document.getElementById('input_win_cfg_server');
  479. var over_win_user = document.getElementById('input_win_cfg_server_over');
  480. on_win_user.style.display = "none";
  481. over_win_user.style.display = "none";
  482. }
  483. //创建项目弹出窗口
  484. function show_create_project_win_modal(obj)
  485. {
  486. var prj_name_text = document.getElementById('project_name_text');
  487. project_name_text.value='新建项目';
  488. //加载项目对应的数据集列表
  489. str_project_type = "classification";
  490. var obj_sel_create_project_type = document.getElementById('project_type_text');
  491. obj_sel_create_project_type.value=str_project_type;
  492. //加载数据集信息及默认参数
  493. var obj_sel_create_project_dataset_id = document.getElementById('create_project_dataset_id_text');
  494. obj_sel_create_project_dataset_id.options.length = 0
  495. obj_sel_create_project_dataset_id.options[0] = new Option("请选择项目对应数据集", 0);
  496. var http_request = new XMLHttpRequest();
  497. http_request.open("GET", str_srv_url + "/dataset", false);
  498. http_request.send(null);
  499. str_json_datasets = http_request.responseText;
  500. //取出对应类型的数据集
  501. var str_json = eval('(' + str_json_datasets + ')');
  502. var obj_datasets = str_json["datasets"];
  503. g_dataset_list = obj_datasets;
  504. for(var p in obj_datasets)
  505. {
  506. str_id = obj_datasets[p].id;
  507. str_attr = obj_datasets[p].attr;
  508. str_name = str_attr["name"];
  509. str_desc = str_attr["desc"];
  510. str_type = str_attr["type"];
  511. //str_crttime = str_attr["create_time"]
  512. str_status = str_attr["dataset_status"]
  513. if(str_status == DatasetStatus.XSPLITED && str_type == str_project_type)
  514. {
  515. obj_sel_create_project_dataset_id.options[obj_sel_create_project_dataset_id.options.length] = new Option(str_name, str_id);
  516. }
  517. }
  518. var input_crt_prj_win = document.getElementById('input_win_create_project');
  519. var input_crt_prj_win_over = document.getElementById('input_win_create_project_over');
  520. input_crt_prj_win.style.display = "block";
  521. input_crt_prj_win_over.style.display = "block";
  522. }
  523. //隐藏创建项目弹出窗口
  524. function hide_create_prj_win_modal(obj)
  525. {
  526. var on_win_create_prj = document.getElementById('input_win_create_project');
  527. var over_win_create_prj = document.getElementById('input_win_create_project_over');
  528. on_win_create_prj.style.display = "none";
  529. over_win_create_prj.style.display = "none";
  530. }
  531. //显示创建数据集弹出窗口
  532. function show_create_dataset_win_modal(obj)
  533. {
  534. var dataset_name_text = document.getElementById('dataset_name_text');
  535. dataset_name_text.value='新建数据集';
  536. var input_crt_dataset_win = document.getElementById('input_win_create_dataset');
  537. var input_crt_dataset_win_over = document.getElementById('input_win_create_dataset_over');
  538. input_crt_dataset_win.style.display = "block";
  539. input_crt_dataset_win_over.style.display = "block";
  540. }
  541. //隐藏创建数据集弹出窗口
  542. function hide_create_dataset_win_modal(obj)
  543. {
  544. var on_win_create_dataset = document.getElementById('input_win_create_dataset');
  545. var over_win_create_dataset = document.getElementById('input_win_create_dataset_over');
  546. on_win_create_dataset.style.display = "none";
  547. over_win_create_dataset.style.display = "none";
  548. }
  549. //显示导入数据集弹出窗口
  550. function show_import_dataset_win_modal(obj)
  551. {
  552. var on_win_import_dataset = document.getElementById('input_win_import_dataset');
  553. var over_win_import_dataset = document.getElementById('input_win_import_dataset_over');
  554. var input_import_dataset_id = document.getElementById('import_dataset_id');
  555. on_win_import_dataset.style.display = "block";
  556. over_win_import_dataset.style.display = "block";
  557. input_import_dataset_id.value = obj.id;
  558. }
  559. //隐藏导入数据集弹出窗口
  560. function hide_import_dataset_win_modal(obj)
  561. {
  562. var on_win_import_dataset = document.getElementById('input_win_import_dataset');
  563. var over_win_import_dataset = document.getElementById('input_win_import_dataset_over');
  564. var input_import_dataset_id = document.getElementById('import_dataset_id');
  565. on_win_import_dataset.style.display = "none";
  566. over_win_import_dataset.style.display = "none";
  567. input_import_dataset_id.value = "";
  568. }
  569. function re_split_dataset(obj)
  570. {
  571. var on_win_split_dataset = document.getElementById('input_win_split_dataset');
  572. var over_win_split_dataset = document.getElementById('input_win_split_dataset_over');
  573. //获取需要切分的数据集ID
  574. document.getElementById('split_dataset_id').value = document.getElementById('browse_dataset_id').value;
  575. on_win_split_dataset.style.display = "block";
  576. over_win_split_dataset.style.display = "block";
  577. }
  578. //切分数据集弹出窗口
  579. function show_split_dataset_win_modal(obj)
  580. {
  581. var on_win_split_dataset = document.getElementById('input_win_split_dataset');
  582. var over_win_split_dataset = document.getElementById('input_win_split_dataset_over');
  583. var input_split_dataset_id = document.getElementById('split_dataset_id');
  584. on_win_split_dataset.style.display = "block";
  585. over_win_split_dataset.style.display = "block";
  586. input_split_dataset_id.value = obj.id;
  587. }
  588. //隐藏切分数据集弹出窗口
  589. function hide_split_dataset_win_modal(obj)
  590. {
  591. var on_win_split_dataset = document.getElementById('input_win_split_dataset');
  592. var over_win_split_dataset = document.getElementById('input_win_split_dataset_over');
  593. var input_split_dataset_id = document.getElementById('split_dataset_id');
  594. on_win_split_dataset.style.display = "none";
  595. over_win_split_dataset.style.display = "none";
  596. input_split_dataset_id.value = "";
  597. }
  598. //获取数据集详细信息
  599. function get_dataset_detail_info(str_dataset_id)
  600. {
  601. var http_request;
  602. if (window.XMLHttpRequest)
  603. {
  604. http_request=new XMLHttpRequest();
  605. http_request.withCredentials = true;
  606. }
  607. else
  608. {
  609. http_request=new ActiveXObject("Microsoft.XMLHTTP");
  610. }
  611. http_request.open("GET",str_srv_url + "/dataset/details?did=" + str_dataset_id, false);
  612. http_request.send(null);
  613. var str_dataset_detail_info = http_request.responseText;
  614. return str_dataset_detail_info;
  615. }
  616. //加载图片
  617. function load_labels_imgs(str_lbl_name, int_page = 1)
  618. {
  619. var lst_img_files = g_dataset_files[str_lbl_name];
  620. if (g_b_show_dataset_type == "all")
  621. {
  622. lst_img_files = g_dataset_files[str_lbl_name];
  623. }
  624. else if (g_b_show_dataset_type == "train")
  625. {
  626. lst_img_files = g_dataset_train_files[str_lbl_name];
  627. }
  628. else if (g_b_show_dataset_type == "evaluate")
  629. {
  630. lst_img_files = g_dataset_evaluate_files[str_lbl_name];
  631. }
  632. else if (g_b_show_dataset_type == "test")
  633. {
  634. lst_img_files = g_dataset_test_files[str_lbl_name];
  635. }
  636. var str_dataset_id = document.getElementById('browse_dataset_id').value;
  637. //获取数据集路径
  638. var str_dataset_path = document.getElementById('view_dataset_path_' + str_dataset_id).value;
  639. var curr_file_idx = g_const_imgs_per_page * (int_page - 1);
  640. var img_count = 0;
  641. for(var j=curr_file_idx;j<lst_img_files.length;j++)
  642. {
  643. var str_img_file_name = lst_img_files[j];
  644. var str_img_file = str_dataset_path + "/" + str_img_file_name;
  645. //是否显示标注
  646. var str_img_file_content = "";
  647. if(g_b_show_img_labels == true)
  648. {
  649. str_img_file_content = get_img_file_from_server(str_img_file, str_dataset_id);
  650. }
  651. else
  652. {
  653. str_img_file_content = get_img_file_from_server(str_img_file);
  654. }
  655. //更新img框内容
  656. img_count = img_count + 1;
  657. var obj_img = document.getElementById('dataset_img_' + img_count);
  658. var idx_file_postfix = str_img_file_name.lastIndexOf(".");
  659. var str_file_type = "jpeg";
  660. if(idx_file_postfix >= 0)
  661. {
  662. str_file_type = str_img_file_name.substring(idx_file_postfix + 1,str_img_file_name.length);
  663. }
  664. str_file_type = str_file_type.toLowerCase();
  665. var str_b64_type = "data:image/jpeg;base64,";
  666. if(str_file_type == "jpg" || str_file_type == "jpeg")
  667. str_b64_type = "data:image/jpeg;base64,";
  668. else if (str_file_type == "bmp")
  669. str_b64_type = "data:image/jpeg;base64,";
  670. else if (str_file_type == "png")
  671. str_b64_type = "data:image/png;base64,";
  672. obj_img.src = str_b64_type + str_img_file_content;
  673. obj_img.style.visibility='';
  674. //更新文件名称
  675. var idx_path_split = str_img_file_name.lastIndexOf("/");
  676. var str_img_file_shot_name = str_img_file_name;
  677. if(idx_path_split >= 0)
  678. {
  679. str_img_file_shot_name = str_img_file_name.substring(idx_path_split + 1,str_img_file_name.length);
  680. }
  681. document.getElementById('dataset_img_' + img_count + "_file_name").innerText = str_img_file_shot_name;
  682. if(img_count >= g_const_imgs_per_page)
  683. {
  684. break;
  685. }
  686. }
  687. //清除无需显示的图像框
  688. if(img_count < g_const_imgs_per_page)
  689. {
  690. for(var k=img_count + 1;k<=g_const_imgs_per_page;k++)
  691. {
  692. document.getElementById('dataset_img_' + k).src = " ";
  693. document.getElementById('dataset_img_' + k).style.visibility='hidden';
  694. document.getElementById('dataset_img_' + k + "_file_name").innerText = "";
  695. }
  696. }
  697. }
  698. //从服务端请求文件内容
  699. function get_img_file_from_server(str_file_name, str_dataset_id = "")
  700. {
  701. var http_request = new XMLHttpRequest();
  702. if(str_dataset_id == "")
  703. {
  704. http_request.open("GET", str_srv_url + "/file?path=" + str_file_name, false);
  705. }
  706. else
  707. {
  708. http_request.open("GET", str_srv_url + "/file?path=" + str_file_name + "&did=" + str_dataset_id, false);
  709. }
  710. http_request.send(null);
  711. var obj_json = eval('(' + http_request.responseText + ')');
  712. var str_data = obj_json["img_data"];
  713. return str_data;
  714. }
  715. //从服务端获取日志文件
  716. function get_log_file_from_server(str_log_file_name)
  717. {
  718. var http_request = new XMLHttpRequest();
  719. http_request.open("GET", str_srv_url + "/file?path=" + str_log_file_name, false);
  720. http_request.send(null);
  721. return http_request.responseText;
  722. }
  723. //刷新翻页按纽
  724. function refresh_dataset_page_buttons()
  725. {
  726. var int_file_count = g_dataset_files[g_current_dataset_lable_name].length;
  727. if (g_b_show_dataset_type == "all")
  728. {
  729. int_file_count = g_dataset_files[g_current_dataset_lable_name].length;
  730. }
  731. else if (g_b_show_dataset_type == "train")
  732. {
  733. int_file_count = g_dataset_train_files[g_current_dataset_lable_name].length;
  734. }
  735. else if (g_b_show_dataset_type == "evaluate")
  736. {
  737. int_file_count = g_dataset_evaluate_files[g_current_dataset_lable_name].length;
  738. }
  739. else if (g_b_show_dataset_type == "test")
  740. {
  741. int_file_count = g_dataset_test_files[g_current_dataset_lable_name].length;
  742. }
  743. var max_page_num = Math.ceil(int_file_count / g_const_imgs_per_page);
  744. document.getElementById('dataset_page_info').innerText = "第" + g_current_dataset_page + "页/共" + max_page_num + "页";
  745. }
  746. //加载数据标签信息
  747. function add_labels_to_table(str_lbl_list,dic_file_lst,dic_train_lst,dic_evaluate_lst,dic_test_lst)
  748. {
  749. g_dataset_files = dic_file_lst;
  750. g_dataset_train_files = dic_train_lst;
  751. g_dataset_evaluate_files = dic_evaluate_lst;
  752. g_dataset_test_files = dic_test_lst;
  753. var rows = table_dataset_labels.rows.length;
  754. for (i=rows-1;i>=1;i--)
  755. {
  756. table_dataset_labels.deleteRow(i);
  757. }
  758. for(var j=0;j<str_lbl_list.length;j++)
  759. {
  760. var str_lbl_name = str_lbl_list[j];
  761. var lst_files = dic_file_lst[str_lbl_name];
  762. var lst_train_files = dic_train_lst[str_lbl_name];
  763. var lst_evaluate_files = dic_evaluate_lst[str_lbl_name];
  764. var lst_test_files = dic_test_lst[str_lbl_name];
  765. var rows = table_dataset_labels.rows.length;
  766. var newTr = table_dataset_labels.insertRow(rows);
  767. newTr.id = str_lbl_name;
  768. newTr.onclick=function()
  769. {
  770. g_current_dataset_page = 1;
  771. g_current_dataset_lable_name = this.id;
  772. var tbl_trs = table_dataset_labels.getElementsByTagName("tr");
  773. for(var k = 1; k < tbl_trs.length; k++)
  774. {
  775. var bg_color = "#f2f2f2";
  776. if(k % 2 == 0)
  777. {
  778. bg_color = "#ffffff";
  779. }
  780. else
  781. {
  782. bg_color = "#f2f2f2";
  783. }
  784. if(k == this.rowIndex)
  785. {
  786. bg_color = "#76D6FF";
  787. }
  788. tbl_trs[k].style.backgroundColor = bg_color;
  789. }
  790. load_labels_imgs(this.id, g_current_dataset_page);
  791. refresh_dataset_page_buttons();
  792. }
  793. newTr.style.cursor="pointer";
  794. if(j == 0)
  795. {
  796. newTr.style.backgroundColor = "#76D6FF";
  797. }
  798. var newTd0=newTr.insertCell();
  799. newTd0.innerText = str_lbl_name;
  800. var newTd1=newTr.insertCell();
  801. newTd1.innerText = lst_files.length;
  802. var newTd2=newTr.insertCell();
  803. newTd2.innerText = lst_train_files.length;
  804. var newTd3=newTr.insertCell();
  805. newTd3.innerText = lst_evaluate_files.length;
  806. var newTd4=newTr.insertCell();
  807. newTd4.innerText = lst_test_files.length;
  808. }
  809. }
  810. //浏览数据集弹出窗口
  811. function show_browse_dataset_win_modal(obj)
  812. {
  813. var on_win_browse_dataset = document.getElementById('win_browse_dataset');
  814. var over_win_browse_dataset = document.getElementById('win_browse_dataset_over');
  815. document.getElementById('browse_dataset_id').value = obj.id;
  816. var str_dataset_details = get_dataset_detail_info(obj.id);
  817. var obj_json_dataset_details = eval('(' + str_dataset_details + ')');
  818. var lst_labels = obj_json_dataset_details["details"]["labels"];
  819. var lst_files = obj_json_dataset_details["details"]["label_info"];
  820. //训练集及测试集
  821. var lst_train_files = obj_json_dataset_details["details"]["class_train_file_list"];
  822. var lst_evaluate_files = obj_json_dataset_details["details"]["class_val_file_list"];
  823. var lst_test_files = obj_json_dataset_details["details"]["class_test_file_list"];
  824. //数据集详情
  825. document.getElementById('browse_dataset_name_text').value = document.getElementById('view_dataset_name_' + obj.id).value;
  826. document.getElementById('browse_dataset_type_text').value = document.getElementById('view_dataset_type_' + obj.id).value;
  827. document.getElementById('browse_dataset_desc_text').value = document.getElementById('view_dataset_desc_' + obj.id).value;
  828. //分类不需要显示标注
  829. if(document.getElementById('browse_dataset_type_text').value == "图像分类")
  830. {
  831. document.getElementById('dataset_chk_show_label').style.visibility = "hidden";
  832. document.getElementById('dataset_chk_show_label_txt').style.visibility = "hidden";
  833. }
  834. else
  835. {
  836. document.getElementById('dataset_chk_show_label').style.visibility = "";
  837. document.getElementById('dataset_chk_show_label_txt').style.visibility = "";
  838. }
  839. //默认不显示标注
  840. g_b_show_img_labels = false;
  841. document.getElementById('dataset_chk_show_label').checked = false;
  842. //默认显示全量数据
  843. g_b_show_dataset_type = "all";
  844. document.getElementById('sel_dataset_view_type')[0].selected = true;
  845. //刷新标签
  846. add_labels_to_table(lst_labels, lst_files, lst_train_files, lst_evaluate_files, lst_test_files);
  847. //加载预览图片
  848. g_current_dataset_lable_name = lst_labels[0];
  849. load_labels_imgs(lst_labels[0],g_current_dataset_page);
  850. //刷新翻页按纽
  851. refresh_dataset_page_buttons();
  852. on_win_browse_dataset.style.display = "block";
  853. over_win_browse_dataset.style.display = "block";
  854. }
  855. //关闭浏览数据集
  856. function hide_browse_dataset_win_modal(obj)
  857. {
  858. //当前页重置
  859. g_current_dataset_page = 1;
  860. g_b_show_dataset_type = "all";
  861. var on_win_browse_dataset = document.getElementById('win_browse_dataset');
  862. var over_win_browse_dataset = document.getElementById('win_browse_dataset_over');
  863. document.getElementById('browse_dataset_id').value = "";
  864. on_win_browse_dataset.style.display = "none";
  865. over_win_browse_dataset.style.display = "none";
  866. }
  867. //双击放大图像
  868. function zoom_image(obj)
  869. {
  870. if(obj.src != "")
  871. {
  872. document.getElementById('dataset_browse_img').src = obj.src;
  873. var on_win_browse_img = document.getElementById('win_browse_img');
  874. var over_win_browse_img = document.getElementById('win_browse_img_over');
  875. on_win_browse_img.style.display = "block";
  876. over_win_browse_img.style.display = "block";
  877. }
  878. }
  879. //关闭放大预览图片窗口
  880. function hide_zoom_img(obj)
  881. {
  882. var on_win_browse_img = document.getElementById('win_browse_img');
  883. var over_win_browse_img = document.getElementById('win_browse_img_over');
  884. on_win_browse_img.style.display = "none";
  885. over_win_browse_img.style.display = "none";
  886. }
  887. //关闭日志查看窗口
  888. function hide_log_win(obj)
  889. {
  890. var on_win_view_log = document.getElementById('win_view_log');
  891. var over_win_view_log = document.getElementById('win_view_log_over');
  892. on_win_view_log.style.display = "none";
  893. on_win_view_log.style.display = "none";
  894. }
  895. //上一页
  896. function dataset_pre_page()
  897. {
  898. g_current_dataset_page = g_current_dataset_page - 1;
  899. if(g_current_dataset_page <= 0)
  900. {
  901. g_current_dataset_page = 1;
  902. }
  903. load_labels_imgs(g_current_dataset_lable_name, g_current_dataset_page);
  904. refresh_dataset_page_buttons();
  905. }
  906. //下一页
  907. function dataset_next_page()
  908. {
  909. g_current_dataset_page = g_current_dataset_page + 1;
  910. //是否大于最大页
  911. var int_file_max_count = g_dataset_files[g_current_dataset_lable_name].length;
  912. if (g_b_show_dataset_type == "all")
  913. {
  914. int_file_max_count = g_dataset_files[g_current_dataset_lable_name].length;
  915. }
  916. else if (g_b_show_dataset_type == "train")
  917. {
  918. int_file_max_count = g_dataset_train_files[g_current_dataset_lable_name].length;
  919. }
  920. else if (g_b_show_dataset_type == "evaluate")
  921. {
  922. int_file_max_count = g_dataset_evaluate_files[g_current_dataset_lable_name].length;
  923. }
  924. else if (g_b_show_dataset_type == "test")
  925. {
  926. int_file_max_count = g_dataset_test_files[g_current_dataset_lable_name].length;
  927. }
  928. if(g_current_dataset_page * g_const_imgs_per_page > int_file_max_count + 2)
  929. {
  930. g_current_dataset_page = g_current_dataset_page - 1;
  931. }
  932. load_labels_imgs(g_current_dataset_lable_name, g_current_dataset_page);
  933. refresh_dataset_page_buttons();
  934. }
  935. //显示全量数据或者其他数据
  936. function change_dataset_view_type(obj)
  937. {
  938. g_b_show_dataset_type = obj.value;
  939. g_current_dataset_page = 1;
  940. load_labels_imgs(g_current_dataset_lable_name, g_current_dataset_page);
  941. refresh_dataset_page_buttons();
  942. }
  943. //显示标注
  944. function show_dataset_labels()
  945. {
  946. g_b_show_img_labels = !g_b_show_img_labels;
  947. load_labels_imgs(g_current_dataset_lable_name, g_current_dataset_page);
  948. }
  949. //根据任务状态更新任务信息UI
  950. function update_task_detail_info_ui(str_view_task_id, b_get_task_parms = false)
  951. {
  952. //获取任务信息,刷新任务窗口
  953. var http_request = new XMLHttpRequest();
  954. http_request.open("GET", str_srv_url + "/project/task?tid=" + str_view_task_id, false);
  955. http_request.send(null);
  956. var obj_json = eval('(' + http_request.responseText + ')');
  957. var str_task_msg = obj_json["message"];
  958. var str_task_status = obj_json["task_status"];
  959. var running_duration = "NA";
  960. var progress_bar_value = 0;
  961. var str_view_task_status_text = "任务初始化";
  962. var str_task_next_button_lable = "关闭"
  963. var obj_task_next_button = document.getElementById('btn_next_task_info');
  964. //停止任务按纽
  965. var obj_stop_task_div = document.getElementById('div_btn_stop_task');
  966. var b_show_stop_task_btn = false;
  967. if (str_task_status == TaskStatus.XINIT)
  968. {
  969. str_view_task_status_text = "任务初始化";
  970. }
  971. else if (str_task_status == TaskStatus.XTRAINFAIL)
  972. {
  973. str_view_task_status_text = "任务训练失败";
  974. str_task_next_button_lable = "查看错误日志";
  975. }
  976. else if (str_task_status == TaskStatus.XTRAINDONE)
  977. {
  978. str_view_task_status_text = "任务训练完成";
  979. progress_bar_value = 100;
  980. str_task_msg = "任务训练完成,请进行模型评估或者导出模型";
  981. //取消按纽更新为评估&导出模型
  982. str_task_next_button_lable = "评估&导出模型";
  983. }
  984. else if (str_task_status == TaskStatus.XTRAINING)
  985. {
  986. str_view_task_status_text = "任务训练中";
  987. b_show_stop_task_btn = true;
  988. //获取任务参数
  989. if(b_get_task_parms == true)
  990. {
  991. var train_parms_http_request = new XMLHttpRequest();
  992. train_parms_http_request.open("GET", str_srv_url + "/project/task/params?tid=" + str_view_task_id, false);
  993. train_parms_http_request.send(null);
  994. var obj_parms_json = eval('(' + train_parms_http_request.responseText + ')');
  995. g_train_task_parms = obj_parms_json["train"];
  996. }
  997. //获取训练状态
  998. var train_http_request = new XMLHttpRequest();
  999. train_http_request.open("GET", str_srv_url + "/project/task/metrics?tid=" + str_view_task_id + "&type=train", false);
  1000. train_http_request.send(null);
  1001. str_task_msg = train_http_request.responseText;
  1002. try
  1003. {
  1004. var obj_train_msg_json = eval('(' + str_task_msg + ')');
  1005. var dic_train_log_metric = obj_train_msg_json["train_log"]["train_metrics"];
  1006. running_duration = obj_train_msg_json["train_log"]["running_duration"];
  1007. var curr_epoc = dic_train_log_metric["Epoch"];
  1008. var curr_step = dic_train_log_metric["Step"];
  1009. var curr_acc1 = dic_train_log_metric["acc1"];
  1010. var curr_acc5 = dic_train_log_metric["acc5"];
  1011. var curr_loss = dic_train_log_metric["loss"];
  1012. var curr_lr = dic_train_log_metric["lr"];
  1013. //计算进度
  1014. var cur_progress = parseInt((parseInt(curr_epoc)-1)/parseInt(g_train_task_parms["num_epochs"]) * 100);
  1015. if(cur_progress > 100)
  1016. cur_progress = 100;
  1017. progress_bar_value = cur_progress;
  1018. }
  1019. catch(err)
  1020. {
  1021. str_view_task_status_text = "任务训练中(启动训练中)";
  1022. progress_bar_value = 0;
  1023. str_task_msg = "任务训练中(启动训练中),请稍等...";
  1024. }
  1025. //启动定时器,用于定时刷新任务状态
  1026. if(b_get_task_parms)
  1027. {
  1028. g_instance_refresh_clock = self.setInterval("refresh_task_detail_info_win()",1000);
  1029. }
  1030. }
  1031. else if (str_task_status == TaskStatus.XEXPORTING)
  1032. {
  1033. str_view_task_status_text = "任务训练完成(模型导出中)";
  1034. progress_bar_value = 100;
  1035. str_task_msg = "任务训练完成(模型导出中),可以重新进行模型评估或者导出模型";
  1036. //取消按纽更新为评估&导出模型
  1037. str_task_next_button_lable = "评估&导出模型";
  1038. }
  1039. else if (str_task_status == TaskStatus.XEXPORTED)
  1040. {
  1041. str_view_task_status_text = "任务训练完成(模型已导出)";
  1042. progress_bar_value = 100;
  1043. str_task_msg = "任务训练完成(模型已导出),可以重新进行模型评估或者导出模型";
  1044. //取消按纽更新为评估&导出模型
  1045. str_task_next_button_lable = "评估&导出模型";
  1046. }
  1047. else if (str_task_status == TaskStatus.XTRAINEXIT)
  1048. {
  1049. str_view_task_status_text = "任务已中止";
  1050. progress_bar_value = 0;
  1051. str_task_msg = "任务已中止,可以重新启动模型训练";
  1052. //取消按纽更新为评估&导出模型
  1053. str_task_next_button_lable = "继续训练";
  1054. }
  1055. var obj_view_task_status_text = document.getElementById('task_detail_status_text');
  1056. obj_view_task_status_text.value = str_view_task_status_text;
  1057. var obj_view_task_log_text = document.getElementById('task_detail_log_text');
  1058. obj_view_task_log_text.value = str_task_msg;
  1059. var obj_view_task_running_duration_text = document.getElementById('task_detail_running_duration_text');
  1060. obj_view_task_running_duration_text.value = running_duration;
  1061. //进度条
  1062. var obj_view_task_status_progress_value = document.getElementById('task_detail_status_progress_bar_value');
  1063. obj_view_task_status_progress_value.style = "width: " + progress_bar_value + "%;";
  1064. var obj_view_task_status_progress_bar = document.getElementById('task_detail_status_progress_bar');
  1065. obj_view_task_status_progress_value.innerText = progress_bar_value + "%";
  1066. //按纽标题
  1067. obj_task_next_button.value = str_task_next_button_lable;
  1068. //停止任务按纽显示
  1069. if(b_show_stop_task_btn == true)
  1070. {
  1071. obj_stop_task_div.style.visibility = "";
  1072. }
  1073. else
  1074. {
  1075. obj_stop_task_div.style.visibility = "hidden";
  1076. }
  1077. }
  1078. //显示任务运行状态窗口
  1079. function show_task_detail_info_win_modal(obj)
  1080. {
  1081. var input_task_detail_id = document.getElementById('task_detail_id');
  1082. input_task_detail_id.value = obj.id;
  1083. //获取任务信息,刷新任务窗口
  1084. var str_view_task_id = obj.id;
  1085. update_task_detail_info_ui(str_view_task_id, true);
  1086. var task_detail_info_win = document.getElementById('task_detail_info');
  1087. var task_detail_info_win_over = document.getElementById('task_detail_info_over');
  1088. task_detail_info_win.style.display = "block";
  1089. task_detail_info_win_over.style.display = "block";
  1090. }
  1091. //用于定时刷新任务运行状态窗口
  1092. function refresh_task_detail_info_win()
  1093. {
  1094. var input_task_detail_id = document.getElementById('task_detail_id');
  1095. var str_view_task_id = input_task_detail_id.value;
  1096. update_task_detail_info_ui(str_view_task_id, false);
  1097. }
  1098. //关闭任务运行信息弹出窗口
  1099. function hide_task_detail_info_win_modal()
  1100. {
  1101. var task_detail_info_win = document.getElementById('task_detail_info');
  1102. var task_detail_info_win_over = document.getElementById('task_detail_info_over');
  1103. var input_task_detail_id = document.getElementById('task_detail_id');
  1104. task_detail_info_win.style.display = "none";
  1105. task_detail_info_win_over.style.display = "none";
  1106. input_task_detail_id.value = "";
  1107. //关闭定时器
  1108. g_instance_refresh_clock=window.clearInterval(g_instance_refresh_clock);
  1109. }
  1110. //模型训练结束下一步处理(模型评估&导出)
  1111. function task_next_step_process(obj)
  1112. {
  1113. var str_btn_label = obj.value;
  1114. if(str_btn_label == "关闭")
  1115. {
  1116. hide_task_detail_info_win_modal();
  1117. }
  1118. else if(str_btn_label == "查看错误日志")
  1119. {
  1120. var str_error_tid = document.getElementById('task_detail_id').value;
  1121. var str_error_task_pid = document.getElementById('view_task_pid_' + str_error_tid).value;
  1122. //日志路径
  1123. var http_request = new XMLHttpRequest();
  1124. http_request.open('GET', str_srv_url + "/workspace", false);
  1125. http_request.send(null);
  1126. var obj_json = eval('(' + http_request.responseText + ')');
  1127. var str_server_workspace_path = obj_json["dirname"];
  1128. var str_error_log_path = str_server_workspace_path + "/projects/" + str_error_task_pid + "/" + str_error_tid + "/err.log";
  1129. var str_error_info = get_log_file_from_server(str_error_log_path);
  1130. //显示错误信息
  1131. document.getElementById('view_log_text').value = str_error_info;
  1132. var on_win_view_log = document.getElementById('win_view_log');
  1133. var over_win_view_log = document.getElementById('win_view_log_over');
  1134. on_win_view_log.style.display = "block";
  1135. on_win_view_log.style.display = "block";
  1136. }
  1137. else if(str_btn_label == "评估&导出模型")
  1138. {
  1139. //启动模型评估
  1140. show_evaluate_export_win_modal(obj);
  1141. //隐藏原来窗口
  1142. hide_task_detail_info_win_modal();
  1143. }
  1144. else if(str_btn_label == "继续训练")
  1145. {
  1146. //重新启动模型训练
  1147. var str_start_tid = "";
  1148. var obj_start_task_id_input = document.getElementById('task_detail_id');
  1149. str_start_tid = obj_start_task_id_input.value;
  1150. start_task(str_start_tid);
  1151. load_tasks();
  1152. //隐藏原来窗口
  1153. hide_task_detail_info_win_modal();
  1154. }
  1155. }
  1156. //打开VDL链接
  1157. function open_task_vdl_window()
  1158. {
  1159. var input_task_detail_id = document.getElementById('task_detail_id');
  1160. var str_view_task_id = input_task_detail_id.value;
  1161. var http_request;
  1162. if (window.XMLHttpRequest)
  1163. {
  1164. http_request=new XMLHttpRequest();
  1165. }
  1166. else
  1167. {
  1168. http_request=new ActiveXObject("Microsoft.XMLHTTP");
  1169. }
  1170. http_request.onreadystatechange=function()
  1171. {
  1172. if (http_request.readyState==4)
  1173. {
  1174. if (http_request.status==200)
  1175. {
  1176. //获取URL并打开
  1177. str_json = http_request.responseText;
  1178. var obj_json = eval('(' + str_json + ')');
  1179. var str_vdl_url = obj_json["url"];
  1180. //alert(str_vdl_url);
  1181. window.open("http://" + str_vdl_url);
  1182. }
  1183. else
  1184. {
  1185. alert("打开失败,请检查服务器配置\n" + http_request.responseText);
  1186. }
  1187. }
  1188. }
  1189. http_request.open("GET", str_srv_url + "/project/task/vdl?tid=" + str_view_task_id, true);
  1190. http_request.send(null);
  1191. }
  1192. //关闭评估&导出模型弹出窗口
  1193. function hide_evaluate_export_win_modal(obj)
  1194. {
  1195. var obj_evaluate_export_task_project_id = document.getElementById('evaluate_export_task_project_id');
  1196. obj_evaluate_export_task_project_id.value = "";
  1197. var on_win_evaluate_export_model = document.getElementById('input_win_evaluate_export_model');
  1198. var over_win_evaluate_export_model = document.getElementById('input_win_evaluate_export_model_over');
  1199. on_win_evaluate_export_model.style.display = "none";
  1200. over_win_evaluate_export_model.style.display = "none";
  1201. }
  1202. //显示评估&导出模型弹出窗口
  1203. function show_evaluate_export_win_modal(obj)
  1204. {
  1205. var obj_detail_task_id = document.getElementById('task_detail_id');
  1206. var obj_export_task_id = document.getElementById('evaluate_export_task_id');
  1207. obj_export_task_id.value = obj_detail_task_id.value;
  1208. if(null == obj_export_task_id.value || 'undefined' == typeof(obj_export_task_id.value) || '' == obj_export_task_id.value)
  1209. {
  1210. obj_export_task_id.value = obj.id;
  1211. }
  1212. //初始化路径(workspace/projects/TXXX/export_model)
  1213. var http_request = new XMLHttpRequest();
  1214. http_request.open('GET', str_srv_url + "/workspace", false);
  1215. http_request.send(null);
  1216. var obj_json = eval('(' + http_request.responseText + ')');
  1217. var str_init_model_save_path = obj_json["dirname"];
  1218. var str_obj_task_prj_key = "view_task_pid_" + obj_export_task_id.value;
  1219. var obj_project_id = document.getElementById(str_obj_task_prj_key);
  1220. var str_project_id = obj_project_id.value;
  1221. var obj_evaluate_export_task_project_id = document.getElementById('evaluate_export_task_project_id');
  1222. obj_evaluate_export_task_project_id.value = str_project_id;
  1223. var obj_model_save_path = document.getElementById('export_model_path_text');
  1224. obj_model_save_path.value = str_init_model_save_path + "/projects/" + str_project_id + "/" + obj_export_task_id.value + "/export_model";
  1225. var on_win_evaluate_export_model = document.getElementById('input_win_evaluate_export_model');
  1226. var over_win_evaluate_export_model = document.getElementById('input_win_evaluate_export_model_over');
  1227. on_win_evaluate_export_model.style.display = "block";
  1228. over_win_evaluate_export_model.style.display = "block";
  1229. }
  1230. //评估任务
  1231. function evaluate_task(obj)
  1232. {
  1233. var obj_evaluate_task_id = document.getElementById('evaluate_export_task_id');
  1234. var str_evaluate_task_id = obj_evaluate_task_id.value;
  1235. //启动评估
  1236. var http_request;
  1237. if (window.XMLHttpRequest)
  1238. {
  1239. http_request=new XMLHttpRequest();
  1240. }
  1241. else
  1242. {
  1243. http_request=new ActiveXObject("Microsoft.XMLHTTP");
  1244. }
  1245. http_request.onreadystatechange=function()
  1246. {
  1247. if (http_request.readyState==4)
  1248. {
  1249. if (http_request.status==200)
  1250. {
  1251. //查看评估报告
  1252. http_request.open("GET", str_srv_url + "/project/task/evaluate?tid=" + str_evaluate_task_id, false);
  1253. http_request.send(null);
  1254. alert("评估完成,评估结果:\n" + http_request.responseText);
  1255. }
  1256. else
  1257. {
  1258. alert("评估失败,请检查服务器配置\n" + http_request.responseText);
  1259. }
  1260. }
  1261. }
  1262. var data = {"tid":str_evaluate_task_id,"epoch":null,"topk":5,'score_thresh':null, 'overlap_thresh':null};
  1263. http_request.open("POST", str_srv_url + "/project/task/evaluate", true);
  1264. http_request.setRequestHeader("Content-type","application/json");
  1265. http_request.send(JSON.stringify(data));
  1266. }
  1267. //导出任务模型
  1268. function export_model(obj)
  1269. {
  1270. //任务id
  1271. var obj_export_task_id = document.getElementById('evaluate_export_task_id');
  1272. var str_export_task_id = obj_export_task_id.value;
  1273. //导出路径
  1274. var str_model_save_path = "";
  1275. var obj_model_save_path = document.getElementById('export_model_path_text');
  1276. str_model_save_path = obj_model_save_path.value;
  1277. var http_request;
  1278. if (window.XMLHttpRequest)
  1279. {
  1280. http_request=new XMLHttpRequest();
  1281. }
  1282. else
  1283. {
  1284. http_request=new ActiveXObject("Microsoft.XMLHTTP");
  1285. }
  1286. http_request.onreadystatechange=function()
  1287. {
  1288. if (http_request.readyState==4)
  1289. {
  1290. if (http_request.status==200)
  1291. {
  1292. //获取URL并打开
  1293. alert("导出成功! 模型保存路径:" + str_model_save_path);
  1294. //追加到导出模型列表
  1295. var str_project_id = "";
  1296. var obj_task_project_id = document.getElementById('evaluate_export_task_project_id');
  1297. str_project_id = obj_task_project_id.value;
  1298. var model_data = {"pid":str_project_id,"tid":str_export_task_id,"name":str_export_task_id + "_export_model","type":"exported","source_path":"","path":str_model_save_path,"exported_type":0,"eval_results":{}};
  1299. var model_http_request = new XMLHttpRequest();
  1300. model_http_request.open("POST", str_srv_url + "/model", false);
  1301. model_http_request.setRequestHeader("Content-type","application/json");
  1302. model_http_request.send(JSON.stringify(model_data));
  1303. }
  1304. else
  1305. {
  1306. alert("导出失败,请检查服务器配置\n" + http_request.responseText);
  1307. }
  1308. }
  1309. }
  1310. //默认epoch为自动获取最优
  1311. var data = {"tid":str_export_task_id,"type":"infer","save_dir":str_model_save_path,'quant': false};
  1312. http_request.open("POST", str_srv_url + "/project/task/export", true);
  1313. http_request.setRequestHeader("Content-type","application/json");
  1314. http_request.send(JSON.stringify(data));
  1315. }
  1316. //联系方式
  1317. function contact_us()
  1318. {
  1319. alert("PaddleX QQ群:1045148026");
  1320. }
  1321. //刷新按纽
  1322. function refresh_contents(obj)
  1323. {
  1324. if(obj.value == "刷新项目信息")
  1325. load_projects(obj);
  1326. else if (obj.value == "刷新数据集信息")
  1327. load_datasets(obj);
  1328. else if (obj.value == "刷新所有任务信息")
  1329. load_tasks(obj);
  1330. else if (obj.value == "刷新项目任务信息")
  1331. {
  1332. load_project_tasks(g_view_project_task_id);
  1333. }
  1334. else if (obj.value == "刷新模型信息")
  1335. load_models(obj);
  1336. else
  1337. load_projects(obj);
  1338. }
  1339. //项目对象右键弹出菜单
  1340. function show_project_popupmenu(obj)
  1341. {
  1342. var obj_project_id = document.getElementById('popup_menu_project_id');
  1343. obj_project_id.value = obj.id;
  1344. var menu = document.getElementById('popupmenu_project');
  1345. menu.style.display = 'block';
  1346. menu.style.left = document.documentElement.scrollLeft + document.body.scrollLeft+ window.event.clientX + 'px';
  1347. menu.style.top = document.documentElement.scrollTop + document.body.scrollTop+ window.event.clientY + 'px';
  1348. window.event.returnValue=false;
  1349. window.event.cancelBubble=true;
  1350. window.event.preventDafault();
  1351. window.event.stopPropagation();
  1352. return false;
  1353. }
  1354. //数据集对象右键弹出菜单
  1355. function show_dataset_popupmenu(obj)
  1356. {
  1357. var obj_dataset_id = document.getElementById('popup_menu_dataset_id');
  1358. obj_dataset_id.value = obj.id;
  1359. var menu = document.getElementById('popupmenu_dataset');
  1360. menu.style.display = 'block';
  1361. menu.style.left = document.documentElement.scrollLeft + document.body.scrollLeft+ window.event.clientX + 'px';
  1362. menu.style.top = document.documentElement.scrollTop + document.body.scrollTop+ window.event.clientY + 'px';
  1363. window.event.returnValue=false;
  1364. window.event.cancelBubble=true;
  1365. window.event.preventDafault();
  1366. window.event.stopPropagation();
  1367. return false;
  1368. }
  1369. //任务对象右键弹出菜单
  1370. function show_task_popupmenu(obj)
  1371. {
  1372. var obj_task_id = document.getElementById('popup_menu_task_id');
  1373. obj_task_id.value = obj.id;
  1374. var menu = document.getElementById('popupmenu_task');
  1375. menu.style.display = 'block';
  1376. menu.style.left = document.documentElement.scrollLeft + document.body.scrollLeft+ window.event.clientX + 'px';
  1377. menu.style.top = document.documentElement.scrollTop + document.body.scrollTop+ window.event.clientY + 'px';
  1378. window.event.returnValue=false;
  1379. window.event.cancelBubble=true;
  1380. window.event.preventDafault();
  1381. window.event.stopPropagation();
  1382. return false;
  1383. }
  1384. //任务对象右键弹出菜单
  1385. function show_models_popupmenu(obj)
  1386. {
  1387. var obj_model_id = document.getElementById('popup_menu_model_id');
  1388. obj_model_id.value = obj.id;
  1389. var menu = document.getElementById('popupmenu_model');
  1390. menu.style.display = 'block';
  1391. menu.style.left = document.documentElement.scrollLeft + document.body.scrollLeft+ window.event.clientX + 'px';
  1392. menu.style.top = document.documentElement.scrollTop + document.body.scrollTop+ window.event.clientY + 'px';
  1393. window.event.returnValue=false;
  1394. window.event.cancelBubble=true;
  1395. window.event.preventDafault();
  1396. window.event.stopPropagation();
  1397. return false;
  1398. }
  1399. //隐藏右键菜单
  1400. document.onclick = function()
  1401. {
  1402. var menu = document.getElementById('popupmenu_project');
  1403. menu.style.display = 'none';
  1404. var obj_project_id = document.getElementById('popup_menu_project_id');
  1405. obj_project_id.value = "";
  1406. menu = document.getElementById('popupmenu_dataset');
  1407. menu.style.display = 'none';
  1408. var obj_dataset_id = document.getElementById('popup_menu_dataset_id');
  1409. obj_dataset_id.value = "";
  1410. menu = document.getElementById('popupmenu_task');
  1411. menu.style.display = 'none';
  1412. var obj_task_id = document.getElementById('popup_menu_task_id');
  1413. obj_task_id.value = "";
  1414. menu = document.getElementById('popupmenu_model');
  1415. menu.style.display = 'none';
  1416. var obj_model_id = document.getElementById('popup_menu_model_id');
  1417. obj_model_id.value = "";
  1418. }
  1419. //PaddleX RestfulAPI Demo Code
  1420. //设置远端服务器地址
  1421. function set_server_addr(input_data)
  1422. {
  1423. var input_srv_url = document.getElementById('server_url_text');
  1424. str_srv_url = input_srv_url.value;
  1425. var last_pos = str_srv_url.length - 1;
  1426. var last_char = str_srv_url.charAt(last_pos);
  1427. if(last_char == '/')
  1428. {
  1429. str_srv_url = str_srv_url.substring(0, (str_srv_url.length - 1));
  1430. }
  1431. var http_request = new XMLHttpRequest();
  1432. http_request.onreadystatechange=function()
  1433. {
  1434. if (http_request.readyState==4)
  1435. {
  1436. if (http_request.status==200)
  1437. {
  1438. str_json = http_request.responseText;
  1439. var obj_json = eval('(' + str_json + ')');
  1440. var str_workspace_dir = obj_json["dirname"];
  1441. alert("设置成功!\n服务器地址:" + str_srv_url + "\n服务器工作区路径:" + str_workspace_dir);
  1442. hide_server_info(null);
  1443. load_projects();
  1444. }
  1445. else
  1446. {
  1447. alert("设置失败,服务器连接失败,请检查服务器地址是否正确!" + http_request.responseText)
  1448. }
  1449. }
  1450. }
  1451. http_request.open('GET', str_srv_url + "/workspace", true);
  1452. http_request.send(null);
  1453. }
  1454. //获取服务器系统信息
  1455. function get_server_system_info(str_info_type = "machine_info")
  1456. {
  1457. var http_request = new XMLHttpRequest();
  1458. http_request.open('GET', str_srv_url + "/system?type=" + str_info_type, false);
  1459. http_request.send(null);
  1460. return http_request.responseText;
  1461. }
  1462. //获取工作区所有项目信息
  1463. function load_projects()
  1464. {
  1465. var http_request;
  1466. if (window.XMLHttpRequest)
  1467. {
  1468. http_request=new XMLHttpRequest();
  1469. }
  1470. else
  1471. {
  1472. http_request=new ActiveXObject("Microsoft.XMLHTTP");
  1473. }
  1474. http_request.onreadystatechange=function()
  1475. {
  1476. if(http_request.readyState==4 && http_request.status==200)
  1477. {
  1478. //更新表格内容
  1479. fill_table_contents(http_request.responseText, "project");
  1480. }
  1481. else
  1482. {
  1483. fill_table_with_error();
  1484. }
  1485. }
  1486. http_request.open("GET",str_srv_url + "/project",true);
  1487. http_request.send(null);
  1488. }
  1489. //创建项目
  1490. function create_project(input_data)
  1491. {
  1492. var input_prj_name = document.getElementById('project_name_text');
  1493. var input_prj_type = document.getElementById('project_type_text');
  1494. var input_prj_desc = document.getElementById('project_desc_text');
  1495. var input_prj_dataset = document.getElementById('create_project_dataset_id_text');
  1496. var str_prj_name = input_prj_name.value;
  1497. var str_prj_type = input_prj_type.value;
  1498. var str_prj_desc = input_prj_desc.value;
  1499. var str_prj_dataset_id = input_prj_dataset.value;
  1500. if(str_prj_name == "")
  1501. {
  1502. alert("请输入项目名称");
  1503. return;
  1504. }
  1505. if(str_prj_dataset_id == 0)
  1506. {
  1507. alert("请选择项目对应数据集或者创建数据集");
  1508. return;
  1509. }
  1510. var http_request = new XMLHttpRequest();
  1511. http_request.onreadystatechange=function()
  1512. {
  1513. if (http_request.readyState==4)
  1514. {
  1515. if (http_request.status==200)
  1516. {
  1517. str_json = http_request.responseText;
  1518. alert("项目创建成功!\n" + str_json);
  1519. var obj_json = eval('(' + str_json + ')');
  1520. var str_new_pid = obj_json["pid"];
  1521. //绑定数据集
  1522. var attr_dict = {'did': str_prj_dataset_id};
  1523. var bind_params = {'struct': 'project', 'id': str_new_pid, 'attr_dict': attr_dict}
  1524. var bind_http_request = new XMLHttpRequest();
  1525. bind_http_request.open("PUT", str_srv_url + "/workspace", false);
  1526. bind_http_request.setRequestHeader("Content-type","application/json");
  1527. bind_http_request.send(JSON.stringify(bind_params));
  1528. hide_create_prj_win_modal();
  1529. load_projects();
  1530. }
  1531. else
  1532. {
  1533. alert("项目创建失败,请检查服务器配置" + http_request.responseText);
  1534. }
  1535. }
  1536. }
  1537. var data = {"name":str_prj_name,"desc":str_prj_desc,"project_type":str_prj_type};
  1538. http_request.open("POST", str_srv_url + "/project", true);
  1539. http_request.setRequestHeader("Content-type","application/json");
  1540. http_request.send(JSON.stringify(data));
  1541. }
  1542. //查看一个项目
  1543. function show_project(data)
  1544. {
  1545. g_view_project_task_id = data.id;
  1546. g_view_project_task_type = document.getElementById("view_project_type_" + g_view_project_task_id).value;
  1547. //查看项目下的任务
  1548. load_project_tasks(data.id);
  1549. }
  1550. //获取工作区所有数据集信息
  1551. function load_datasets()
  1552. {
  1553. var http_request;
  1554. if (window.XMLHttpRequest)
  1555. {
  1556. http_request=new XMLHttpRequest();
  1557. }
  1558. else
  1559. {
  1560. http_request=new ActiveXObject("Microsoft.XMLHTTP");
  1561. }
  1562. http_request.onreadystatechange=function()
  1563. {
  1564. if(http_request.readyState==4 && http_request.status==200)
  1565. {
  1566. //更新表格内容
  1567. fill_table_contents(http_request.responseText, "dataset");
  1568. }
  1569. else
  1570. {
  1571. fill_table_with_error();
  1572. }
  1573. }
  1574. http_request.open("GET",str_srv_url + "/dataset",false);
  1575. http_request.send(null);
  1576. }
  1577. //获取所有任务信息
  1578. function load_tasks()
  1579. {
  1580. document.getElementById("btn_refresh").value = "刷新所有任务信息";
  1581. document.getElementById("table_create_new").style.display = "none";
  1582. var http_request;
  1583. if (window.XMLHttpRequest)
  1584. {
  1585. http_request=new XMLHttpRequest();
  1586. }
  1587. else
  1588. {
  1589. http_request=new ActiveXObject("Microsoft.XMLHTTP");
  1590. }
  1591. http_request.onreadystatechange=function()
  1592. {
  1593. if(http_request.readyState==4 && http_request.status==200)
  1594. {
  1595. //更新表格内容
  1596. fill_table_contents(http_request.responseText, "task");
  1597. }
  1598. else
  1599. {
  1600. fill_table_with_error();
  1601. }
  1602. }
  1603. http_request.open("GET",str_srv_url + "/project/task",false);
  1604. http_request.send(null);
  1605. }
  1606. //获取项目下的任务
  1607. function load_project_tasks(str_project_id)
  1608. {
  1609. document.getElementById("btn_refresh").value = "刷新项目任务信息";
  1610. document.getElementById("table_create_new").style.display = "block";
  1611. document.getElementById("btn_create_new").value = "新建任务";
  1612. var http_request;
  1613. if (window.XMLHttpRequest)
  1614. {
  1615. http_request=new XMLHttpRequest();
  1616. }
  1617. else
  1618. {
  1619. http_request=new ActiveXObject("Microsoft.XMLHTTP");
  1620. }
  1621. http_request.onreadystatechange=function()
  1622. {
  1623. if(http_request.readyState==4 && http_request.status==200)
  1624. {
  1625. //更新表格内容
  1626. fill_table_contents(http_request.responseText, "task");
  1627. }
  1628. else
  1629. {
  1630. fill_table_with_error();
  1631. }
  1632. }
  1633. http_request.open("GET",str_srv_url + "/project/task?pid=" + str_project_id,false);
  1634. http_request.send(null);
  1635. }
  1636. //创建数据集
  1637. function create_dataset(input_data)
  1638. {
  1639. var http_request = new XMLHttpRequest();
  1640. http_request.onreadystatechange=function()
  1641. {
  1642. if (http_request.readyState==4)
  1643. {
  1644. if (http_request.status==200)
  1645. {
  1646. alert("数据集创建成功!\n" + http_request.responseText);
  1647. hide_create_dataset_win_modal();
  1648. load_datasets();
  1649. }
  1650. else
  1651. {
  1652. alert("数据集创建失败,请检查服务器配置" + http_request.responseText);
  1653. }
  1654. }
  1655. }
  1656. var input_dataset_name = document.getElementById('dataset_name_text');
  1657. var input_dataset_type = document.getElementById('dataset_type_text');
  1658. var input_dataset_desc = document.getElementById('dataset_desc_text');
  1659. var str_dataset_name = input_dataset_name.value;
  1660. var str_dataset_type = input_dataset_type.value;
  1661. var str_dataset_desc = input_dataset_desc.value;
  1662. if(str_dataset_name == "")
  1663. {
  1664. alert("请输入数据集名称");
  1665. return;
  1666. }
  1667. var data = {"name":str_dataset_name,"desc":str_dataset_desc,"dataset_type":str_dataset_type};
  1668. http_request.open("POST", str_srv_url + "/dataset", true);
  1669. http_request.setRequestHeader("Content-type","application/json");
  1670. http_request.send(JSON.stringify(data));
  1671. }
  1672. //导入数据集
  1673. function import_dataset(obj)
  1674. {
  1675. var http_request = new XMLHttpRequest();
  1676. http_request.onreadystatechange=function()
  1677. {
  1678. if (http_request.readyState==4)
  1679. {
  1680. if (http_request.status==200)
  1681. {
  1682. alert("数据集导入成功!\n" + http_request.responseText);
  1683. hide_import_dataset_win_modal(obj);
  1684. load_datasets();
  1685. }
  1686. else
  1687. {
  1688. alert("数据集导入失败,请检查服务器配置" + http_request.responseText);
  1689. }
  1690. }
  1691. }
  1692. var obj_import_dataset_id = document.getElementById('import_dataset_id');
  1693. str_import_dataset_id = obj_import_dataset_id.value;
  1694. var input_dataset_path = document.getElementById('import_dataset_path_text');
  1695. var str_dataset_path = input_dataset_path.value;
  1696. if(str_dataset_path == "")
  1697. {
  1698. alert("请输入数据集路径");
  1699. return;
  1700. }
  1701. var data = {"did":str_import_dataset_id,"path":str_dataset_path};
  1702. http_request.open("PUT", str_srv_url + "/dataset", true);
  1703. http_request.setRequestHeader("Content-type","application/json");
  1704. http_request.send(JSON.stringify(data));
  1705. }
  1706. //切分数据集
  1707. function split_dataset(obj)
  1708. {
  1709. var http_request = new XMLHttpRequest();
  1710. http_request.onreadystatechange=function()
  1711. {
  1712. if (http_request.readyState==4)
  1713. {
  1714. if (http_request.status==200)
  1715. {
  1716. alert("数据集切分成功!\n" + http_request.responseText);
  1717. hide_split_dataset_win_modal(obj);
  1718. load_datasets();
  1719. }
  1720. else
  1721. {
  1722. alert("数据集切分失败,请检查服务器配置" + http_request.responseText);
  1723. }
  1724. }
  1725. }
  1726. var obj_split_dataset_id = document.getElementById('split_dataset_id');
  1727. var str_split_dataset_id = obj_split_dataset_id.value;
  1728. var obj_split_dataset_var_percent = document.getElementById('split_dataset_val_percent');
  1729. var val_split = obj_split_dataset_var_percent.value/100;
  1730. var obj_split_dataset_test_percent = document.getElementById('split_dataset_test_percent');
  1731. var test_split = obj_split_dataset_test_percent.value/100;
  1732. var data = {"did":str_split_dataset_id, "val_split":val_split, "test_split":test_split};
  1733. alert(JSON.stringify(data));
  1734. http_request.open("PUT", str_srv_url + "/dataset/split", true);
  1735. http_request.setRequestHeader("Content-type","application/json");
  1736. http_request.send(JSON.stringify(data));
  1737. }
  1738. //获取所有导出模型
  1739. function load_models()
  1740. {
  1741. var http_request;
  1742. if (window.XMLHttpRequest)
  1743. {
  1744. http_request=new XMLHttpRequest();
  1745. }
  1746. else
  1747. {
  1748. http_request=new ActiveXObject("Microsoft.XMLHTTP");
  1749. }
  1750. http_request.onreadystatechange=function()
  1751. {
  1752. if(http_request.readyState==4 && http_request.status==200)
  1753. {
  1754. //更新表格内容
  1755. fill_table_contents(http_request.responseText, "models");
  1756. }
  1757. else
  1758. {
  1759. fill_table_with_error();
  1760. }
  1761. }
  1762. http_request.open("GET",str_srv_url + "/model?type=exported",false);
  1763. http_request.send(null);
  1764. }
  1765. //填充对象信息到表格(项目/数据集/任务/模型)
  1766. function fill_table_contents(list_contents, type = "project")
  1767. {
  1768. if(type == "project")
  1769. {
  1770. document.getElementById("btn_refresh").value = "刷新项目信息";
  1771. document.getElementById("table_create_new").style.display = "block";
  1772. document.getElementById("btn_create_new").value = "新建项目";
  1773. rows = table_contents.rows.length;
  1774. for (i=0;i<rows;i++)
  1775. {
  1776. table_contents.deleteRow(i);
  1777. rows=rows-1;
  1778. i=i-1;
  1779. }
  1780. rows = table_contents.rows.length;
  1781. var newTr=table_contents.insertRow(rows);
  1782. var str_json = eval('(' + list_contents + ')');
  1783. var obj_prjs = str_json["projects"];
  1784. count_prj = Object.keys(obj_prjs).length;
  1785. col_count = 1;
  1786. //项目为空
  1787. if(count_prj <= 0)
  1788. {
  1789. var newTd0=newTr.insertCell();
  1790. var str_html = "<div id=\"draw-border\"><view_item id=\"btn_create\" onclick=\"show_create_project_win_modal(this)\" style=\"width: 240px; height: 90px; align: center\">"
  1791. str_html = str_html + "<br><font color=\"blue\">暂无项目,点击创建新项目</font>";
  1792. str_html = str_html + "</view_item></div>";
  1793. newTd0.innerHTML = str_html;
  1794. return;
  1795. }
  1796. for(var p in obj_prjs)
  1797. {
  1798. str_id = obj_prjs[p].id;
  1799. str_attr = obj_prjs[p].attr;
  1800. str_name = str_attr["name"];
  1801. str_desc = str_attr["desc"];
  1802. str_type = str_attr["type"];
  1803. str_crttime = str_attr["create_time"];
  1804. var newTd0=newTr.insertCell();
  1805. var str_html = "";
  1806. str_html = "<div id=\"draw-border\" style=\"word-wrap: break-word;\"><view_item onclick=\"show_project(this)\" oncontextmenu=\"javascript:show_project_popupmenu(this);\" id=\"" + str_id + "\">";
  1807. str_html = str_html + "项目名称:" + str_name + " (" + str_id + ")" + "<br>";
  1808. if(str_type == "classification")
  1809. str_type_view = "<font color=\"green\">图像分类</font>";
  1810. else if(str_type == "detection")
  1811. str_type_view = "<font color=\"purple\">目标检测</font>";
  1812. else if(str_type == "instance_segmentation")
  1813. str_type_view = "<font color=\"orange\">实例分割</font>";
  1814. else if(str_type == "segmentation")
  1815. str_type_view = "<font color=\"red\">语义分割</font>";
  1816. //如下所示,后续如果要获取对象数据,可以在此处放hidden input,后续再通过id获取
  1817. str_html = str_html + "项目类型:" + str_type_view + "<br>" + "<input type=\"hidden\" id=\"view_project_type_" + str_id + "\" value=\"" + str_type + "\">";
  1818. str_html = str_html + "项目描述:" + str_desc + "<br><br><br>";
  1819. str_html = str_html + "创建时间:" + str_crttime + "<br>";
  1820. str_html = str_html + "</view_item></div>";
  1821. newTd0.innerHTML = str_html;
  1822. if(col_count == 5)
  1823. {
  1824. rows = table_contents.rows.length;
  1825. newTr=table_contents.insertRow(rows);
  1826. col_count = 1;
  1827. }
  1828. else
  1829. {
  1830. col_count = col_count + 1;
  1831. }
  1832. }
  1833. }
  1834. else if(type == "dataset")
  1835. {
  1836. document.getElementById("btn_refresh").value = "刷新数据集信息";
  1837. document.getElementById("table_create_new").style.display = "block";
  1838. document.getElementById("btn_create_new").value = "新建数据集";
  1839. rows = table_contents.rows.length;
  1840. for (i=0;i<rows;i++)
  1841. {
  1842. table_contents.deleteRow(i);
  1843. rows=rows-1;
  1844. i=i-1;
  1845. }
  1846. rows = table_contents.rows.length;
  1847. var newTr=table_contents.insertRow(rows);
  1848. var str_json = eval('(' + list_contents + ')');
  1849. var obj_datasets = str_json["datasets"];
  1850. count_datasets = Object.keys(obj_datasets).length;
  1851. col_count = 1;
  1852. //数据集为空
  1853. if(count_datasets <= 0)
  1854. {
  1855. var newTd0=newTr.insertCell();
  1856. var str_html = "<div id=\"draw-border\"><view_item id=\"btn_create\" onclick=\"show_create_dataset_win_modal(this)\" style=\"width: 260px; height: 90px; align: center\">"
  1857. str_html = str_html + "<br><font color=\"blue\">暂无数据集,点击创建数据集</font>";
  1858. str_html = str_html + "</view_item></div>";
  1859. newTd0.innerHTML = str_html;
  1860. return;
  1861. }
  1862. for(var p in obj_datasets)
  1863. {
  1864. str_id = obj_datasets[p].id;
  1865. str_attr = obj_datasets[p].attr;
  1866. str_name = str_attr["name"];
  1867. str_desc = str_attr["desc"];
  1868. str_type = str_attr["type"];
  1869. str_crttime = str_attr["create_time"];
  1870. str_status = str_attr["dataset_status"];
  1871. str_dataset_path = str_attr["path"];
  1872. //增加状态显示以及对应的操作
  1873. var view_status_str = "未导入";
  1874. var str_function = "void";
  1875. if (str_status == DatasetStatus.XEMPTY)
  1876. {
  1877. view_status_str = "未导入";
  1878. str_function = "show_import_dataset_win_modal";
  1879. }
  1880. else if (str_status == DatasetStatus.XCHECKING)
  1881. {
  1882. view_status_str = "校验中";
  1883. }
  1884. else if (str_status == DatasetStatus.XCHECKFAIL)
  1885. {
  1886. view_status_str = "校验失败";
  1887. str_function = "show_import_dataset_win_modal";
  1888. }
  1889. else if (str_status == DatasetStatus.XCOPYING)
  1890. {
  1891. view_status_str = "导入中";
  1892. }
  1893. else if (str_status == DatasetStatus.XCOPYDONE)
  1894. {
  1895. view_status_str = "已校验&未切分";
  1896. str_function = "show_split_dataset_win_modal";
  1897. }
  1898. else if (str_status == DatasetStatus.XSPLITED)
  1899. {
  1900. view_status_str = "已校验&已切分";
  1901. str_function = "show_browse_dataset_win_modal";
  1902. }
  1903. else if (str_status == DatasetStatus.XCOPYFAIL)
  1904. {
  1905. view_status_str = "导入失败";
  1906. str_function = "show_import_dataset_win_modal";
  1907. }
  1908. var newTd0=newTr.insertCell();
  1909. var str_html = "";
  1910. str_html = "<div id=\"draw-border\" style=\"word-wrap: break-word;\"><view_item id=\"" + str_id + "\" onclick=\"javascript:" + str_function + "(this);\" oncontextmenu=\"javascript:show_dataset_popupmenu(this);\">";
  1911. str_html = str_html + "数据集名称:" + str_name + " (" + str_id + ")" + "<br>" + "<input type=\"hidden\" id=\"view_dataset_name_" + str_id + "\" value=\"" + str_name + "\">";
  1912. if(str_type == "classification")
  1913. {
  1914. str_dataset_type = "图像分类";
  1915. str_type_view = "<font color=\"green\">图像分类</font>";
  1916. }
  1917. else if(str_type == "detection")
  1918. {
  1919. str_dataset_type = "目标检测";
  1920. str_type_view = "<font color=\"purple\">目标检测</font>";
  1921. }
  1922. else if(str_type == "instance_segmentation")
  1923. {
  1924. str_dataset_type = "实例分割";
  1925. str_type_view = "<font color=\"orange\">实例分割</font>";
  1926. }
  1927. else if(str_type == "segmentation")
  1928. {
  1929. str_dataset_type = "语义分割";
  1930. str_type_view = "<font color=\"red\">语义分割</font>";
  1931. }
  1932. //如果需要获取对象信息,可以在此增加hidden的input
  1933. str_html = str_html + "数据集类型:" + str_type_view + "<br>" + "<input type=\"hidden\" id=\"view_dataset_type_" + str_id + "\" value=\"" + str_dataset_type + "\">";
  1934. str_html = str_html + "数据集描述:" + str_desc + "<br><br>" + "<input type=\"hidden\" id=\"view_dataset_desc_" + str_id + "\" value=\"" + str_desc + "\">";
  1935. str_html = str_html + "创建时间:" + str_crttime + "<br>" + "<input type=\"hidden\" id=\"view_dataset_path_" + str_id + "\" value=\"" + str_dataset_path + "\">";
  1936. str_html = str_html + "数据集状态:" + view_status_str + "<br>";
  1937. str_html = str_html + "</view_item></div>";
  1938. newTd0.innerHTML = str_html;
  1939. if(col_count == 5)
  1940. {
  1941. rows = table_contents.rows.length;
  1942. newTr=table_contents.insertRow(rows);
  1943. col_count = 1;
  1944. }
  1945. else
  1946. {
  1947. col_count = col_count + 1;
  1948. }
  1949. }
  1950. }
  1951. else if(type == "task")
  1952. {
  1953. rows = table_contents.rows.length;
  1954. for (i=0;i<rows;i++)
  1955. {
  1956. table_contents.deleteRow(i);
  1957. rows=rows-1;
  1958. i=i-1;
  1959. }
  1960. rows = table_contents.rows.length;
  1961. var newTr=table_contents.insertRow(rows);
  1962. var str_json = eval('(' + list_contents + ')');
  1963. var obj_tasks = str_json["tasks"];
  1964. count_tasks = Object.keys(obj_tasks).length;
  1965. col_count = 1;
  1966. //数据集为空
  1967. if(count_tasks <= 0)
  1968. {
  1969. var newTd0=newTr.insertCell();
  1970. var str_html = "";
  1971. if(document.getElementById("btn_refresh").value == "刷新项目任务信息")
  1972. {
  1973. str_html = "<div id=\"draw-border\"><view_item id=\"btn_create\" onclick=\"javascript:show_create_task_win_modal(this)\" style=\"width: 340px; height: 90px; align: center\">"
  1974. str_html = str_html + "<br><font color=\"blue\">当前项目无训练任务,点击创建训练任务</font>";
  1975. str_html = str_html + "</view_item></div>";
  1976. }
  1977. else
  1978. {
  1979. str_html = "<div id=\"draw-border\"><view_item id=\"btn_create\" onclick=\"javascript:void(this)\" style=\"width: 420px; height: 90px; align: center\">"
  1980. str_html = str_html + "<br><font color=\"blue\">当前无训练任务,请先在对应项目中创建训练任务</font>";
  1981. str_html = str_html + "</view_item></div>";
  1982. }
  1983. newTd0.innerHTML = str_html;
  1984. return;
  1985. }
  1986. for(var p in obj_tasks)
  1987. {
  1988. str_id = obj_tasks[p].id;
  1989. str_pid = obj_tasks[p].pid;
  1990. str_name = obj_tasks[p].name;
  1991. str_desc = obj_tasks[p].desc;
  1992. str_path = obj_tasks[p].path;
  1993. str_crttime = obj_tasks[p].create_time;
  1994. str_status = obj_tasks[p].status;
  1995. //增加状态显示以及对应的操作
  1996. var view_status_str = "初始化";
  1997. var str_function = "void";
  1998. if (str_status == TaskStatus.XUNINIT)
  1999. {
  2000. view_status_str = "初始化";
  2001. str_function = "show_init_task_win_modal";
  2002. }
  2003. else if (str_status == TaskStatus.XINIT)
  2004. {
  2005. view_status_str = "初始化";
  2006. str_function = "show_init_task_win_modal";
  2007. }
  2008. else if (str_status == TaskStatus.XDOWNLOADING)
  2009. {
  2010. view_status_str = "下载预训练模型中";
  2011. str_function = "show_task_detail_info_win_modal";
  2012. }
  2013. else if (str_status == TaskStatus.XTRAINING)
  2014. {
  2015. view_status_str = "训练中";
  2016. str_function = "show_task_detail_info_win_modal";
  2017. }
  2018. else if (str_status == TaskStatus.XTRAINDONE)
  2019. {
  2020. view_status_str = "训练完成";
  2021. str_function = "show_task_detail_info_win_modal";
  2022. }
  2023. else if (str_status == TaskStatus.XEVALUATED)
  2024. {
  2025. view_status_str = "评估完成";
  2026. str_function = "show_evaluate_export_win_modal";
  2027. }
  2028. else if (str_status == TaskStatus.XEXPORTING)
  2029. {
  2030. view_status_str = "模型导出中";
  2031. str_function = "show_task_detail_info_win_modal";
  2032. }
  2033. else if (str_status == TaskStatus.XEXPORTED)
  2034. {
  2035. view_status_str = "模型导出成功";
  2036. str_function = "show_task_detail_info_win_modal";
  2037. }
  2038. else if (str_status == TaskStatus.XTRAINEXIT)
  2039. {
  2040. view_status_str = "任务中止";
  2041. str_function = "show_task_detail_info_win_modal";
  2042. }
  2043. else if (str_status == TaskStatus.XDOWNLOADFAIL)
  2044. {
  2045. view_status_str = "预训练模型下载失败";
  2046. str_function = "show_task_detail_info_win_modal";
  2047. }
  2048. else if (str_status == TaskStatus.XTRAINFAIL)
  2049. {
  2050. view_status_str = "任务运行失败";
  2051. str_function = "show_task_detail_info_win_modal";
  2052. }
  2053. else if (str_status == TaskStatus.XEVALUATING)
  2054. {
  2055. view_status_str = "任务评估中";
  2056. str_function = "show_evaluate_export_win_modal";
  2057. }
  2058. else if (str_status == TaskStatus.XEVALUATEFAIL)
  2059. {
  2060. view_status_str = "评估失败";
  2061. str_function = "show_evaluate_export_win_modal";
  2062. }
  2063. else if (str_status == TaskStatus.XEXPORTFAIL)
  2064. {
  2065. view_status_str = "模型导出失败";
  2066. str_function = "show_evaluate_export_win_modal";
  2067. }
  2068. else if (str_status == TaskStatus.XPRUNEING)
  2069. {
  2070. view_status_str = "裁剪分析中";
  2071. //str_function = "show_task_detail_info_win_modal";
  2072. }
  2073. else if (str_status == TaskStatus.XPRUNETRAIN)
  2074. {
  2075. view_status_str = "裁剪训练中";
  2076. //str_function = "show_task_detail_info_win_modal";
  2077. }
  2078. var newTd0=newTr.insertCell();
  2079. var str_html = "";
  2080. var str_type = "classification";
  2081. str_html = "<div id=\"draw-border\" style=\"word-wrap: break-word;\"><view_item id=\"" + str_id + "\" onclick=\"javascript:" + str_function + "(this);\" oncontextmenu=\"javascript:show_task_popupmenu(this);\">";
  2082. str_html = str_html + "任务ID:" + str_id + "<br>";
  2083. str_type = get_project_type(str_pid);
  2084. if(str_type == "classification")
  2085. str_type_view = "<font color=\"green\">图像分类</font>";
  2086. else if(str_type == "detection")
  2087. str_type_view = "<font color=\"purple\">目标检测</font>";
  2088. else if(str_type == "instance_segmentation")
  2089. str_type_view = "<font color=\"orange\">实例分割</font>";
  2090. else if(str_type == "segmentation")
  2091. str_type_view = "<font color=\"red\">语义分割</font>";
  2092. //如果需要获取对象信息,可以在此增加hidden的input
  2093. str_html = str_html + "任务类型:" + str_type_view + "<br>" + "<input type=\"hidden\" id=\"view_task_prj_type_" + str_id + "\" value=\"" + str_type + "\">"
  2094. str_html = str_html + "所属项目:" + str_pid + "<br><br>" + "<input type=\"hidden\" id=\"view_task_pid_" + str_id + "\" value=\"" + str_pid + "\">";
  2095. str_html = str_html + "创建时间:" + str_crttime + "<br>";
  2096. str_html = str_html + "任务状态:" + view_status_str + "(" + str_status + ")" + "<br>";
  2097. str_html = str_html + "</view_item></div>";
  2098. newTd0.innerHTML = str_html;
  2099. if(col_count == 5)
  2100. {
  2101. rows = table_contents.rows.length;
  2102. newTr=table_contents.insertRow(rows);
  2103. col_count = 1;
  2104. }
  2105. else
  2106. {
  2107. col_count = col_count + 1;
  2108. }
  2109. }
  2110. }
  2111. else if(type == "models")
  2112. {
  2113. document.getElementById("btn_refresh").value = "刷新模型信息";
  2114. document.getElementById("table_create_new").style.display = "none";
  2115. rows = table_contents.rows.length;
  2116. for (i=0;i<rows;i++)
  2117. {
  2118. table_contents.deleteRow(i);
  2119. rows=rows-1;
  2120. i=i-1;
  2121. }
  2122. rows = table_contents.rows.length;
  2123. var newTr=table_contents.insertRow(rows);
  2124. var str_json = eval('(' + list_contents + ')');
  2125. var obj_models = str_json["exported_models"];
  2126. count_models = Object.keys(obj_models).length;
  2127. col_count = 1;
  2128. //数据集为空
  2129. if(count_models <= 0)
  2130. {
  2131. var newTd0=newTr.insertCell();
  2132. var str_html = "<div id=\"draw-border\"><view_item id=\"btn_create\" onclick=\"javascript:void(this)\" style=\"width: 350px; height: 90px; align: center\">"
  2133. str_html = str_html + "<br><font color=\"blue\">暂无模型,请先启动任务训练并导出模型</font>";
  2134. str_html = str_html + "</view_item></div>";
  2135. newTd0.innerHTML = str_html;
  2136. return;
  2137. }
  2138. for(var p in obj_models)
  2139. {
  2140. str_id = obj_models[p].id;
  2141. var str_model_name = obj_models[p].name;
  2142. var str_model_view_type = "图像分类";
  2143. var str_model_path = obj_models[p].path;
  2144. var str_model = obj_models[p].model;
  2145. var str_model_crttime = obj_models[p].create_time;
  2146. var str_model_type = obj_models[p].type;
  2147. var str_model_pid = obj_models[p].pid;
  2148. var str_model_tid = obj_models[p].tid;
  2149. var newTd0=newTr.insertCell();
  2150. var str_html = "";
  2151. if(str_model_type == "classification")
  2152. str_model_view_type = "<font color=\"green\">图像分类</font>";
  2153. else if(str_model_type == "detection")
  2154. str_model_view_type = "<font color=\"purple\">目标检测</font>";
  2155. else if(str_model_type == "instance_segmentation")
  2156. str_model_view_type = "<font color=\"orange\">实例分割</font>";
  2157. else if(str_model_type == "segmentation")
  2158. str_model_view_type = "<font color=\"red\">语义分割</font>";
  2159. var str_function = "view_model_detail_info";
  2160. str_html = "<div id=\"draw-border\" style=\"word-wrap: break-word;\"><view_item id=\"" + str_id + "\" style=\"width: 750px;height: 170px;\" onclick=\"javascript:" + str_function + "(this);\" oncontextmenu=\"javascript:show_models_popupmenu(this);\">";
  2161. str_html = str_html + "模型名称:" + str_model_name + " (" + str_id + ")" + "<br>";
  2162. str_html = str_html + "模型类型:" + str_model_view_type + "<br>";
  2163. str_html = str_html + "网络结构:" + str_model + "<br>";
  2164. str_html = str_html + "所属项目及任务:" + str_model_pid + "-" + str_model_tid + "<br>";
  2165. //如果需要获取对象信息,可以在此增加hidden的input
  2166. str_html = str_html + "模型路径: <font size=\"1\">" + str_model_path + "</font><br>";
  2167. str_html = str_html + "导出时间:" + str_model_crttime + "<br>";
  2168. str_html = str_html + "</view_item></div>";
  2169. newTd0.innerHTML = str_html;
  2170. if(col_count == 2)
  2171. {
  2172. rows = table_contents.rows.length;
  2173. newTr=table_contents.insertRow(rows);
  2174. col_count = 1;
  2175. }
  2176. else
  2177. {
  2178. col_count = col_count + 1;
  2179. }
  2180. }
  2181. }
  2182. }
  2183. //错误信息提示
  2184. function fill_table_with_error()
  2185. {
  2186. rows = table_contents.rows.length;
  2187. for (i=0;i<rows;i++)
  2188. {
  2189. table_contents.deleteRow(i);
  2190. rows=rows-1;
  2191. i=i-1;
  2192. }
  2193. rows = table_contents.rows.length;
  2194. var newTr=table_contents.insertRow(rows);
  2195. var newTd0=newTr.insertCell();
  2196. var str_html = "<div id=\"draw-border\"><view_item id=\"btn_create\" onclick=\"show_server_info(this)\" style=\"width: 330px; height: 90px; align: center\">"
  2197. str_html = str_html + "<br><font color=\"red\">连接服务器失败,点击设置服务器信息</font>";
  2198. str_html = str_html + "</view_item></div>";
  2199. newTd0.innerHTML = str_html;
  2200. }
  2201. //获取项目任务类型
  2202. function get_project_type(str_pid)
  2203. {
  2204. var http_request = new XMLHttpRequest();
  2205. http_request.open("GET", str_srv_url + "/project?id=" + str_pid, false);
  2206. http_request.send(null);
  2207. var obj_json = eval('(' + http_request.responseText + ')');
  2208. return obj_json["attr"]["type"];
  2209. }
  2210. //显示创建任务弹出窗口
  2211. function show_create_task_win_modal(obj)
  2212. {
  2213. var obj_project_id = document.getElementById('popup_menu_project_id');
  2214. var str_project_id = "";
  2215. if(obj_project_id.value != "")
  2216. {
  2217. var input_create_task_prj_id = document.getElementById('create_task_project_id');
  2218. input_create_task_prj_id.value = obj_project_id.value;
  2219. str_project_id = obj_project_id.value;
  2220. }
  2221. else
  2222. {
  2223. var input_create_task_prj_id = document.getElementById('create_task_project_id');
  2224. input_create_task_prj_id.value = g_view_project_task_id;
  2225. str_project_id = g_view_project_task_id;
  2226. }
  2227. //创建任务时项目类型
  2228. var str_task_type = "";
  2229. try
  2230. {
  2231. str_task_type = document.getElementById("view_project_type_" + str_project_id).value;
  2232. }
  2233. catch(err)
  2234. {
  2235. str_task_type = g_view_project_task_type;
  2236. }
  2237. //取出默认参数
  2238. var http_request = new XMLHttpRequest();
  2239. http_request.open("GET", str_srv_url + "/project/task/params?pid=" + str_project_id, false);
  2240. http_request.send(null);
  2241. //填充参数到表格
  2242. add_parms_to_table(http_request.responseText, str_task_type);
  2243. //按纽
  2244. var obj_btn = document.getElementById('btn_create_task');
  2245. obj_btn.value = "创建并启动训练";
  2246. var on_win_create_task = document.getElementById('input_win_create_task');
  2247. var over_win_create_task = document.getElementById('input_win_create_task_over');
  2248. on_win_create_task.style.display = "block";
  2249. over_win_create_task.style.display = "block";
  2250. }
  2251. //隐藏创建任务弹出窗口
  2252. function hide_create_task_win_modal(obj)
  2253. {
  2254. var on_win_create_task = document.getElementById('input_win_create_task');
  2255. var over_win_create_task = document.getElementById('input_win_create_task_over');
  2256. var input_create_task_prj_id = document.getElementById('create_task_project_id');
  2257. on_win_create_task.style.display = "none";
  2258. over_win_create_task.style.display = "none";
  2259. input_create_task_prj_id.value = "";
  2260. }
  2261. //显示任务初始化参数及启动训练弹窗
  2262. function show_init_task_win_modal(obj)
  2263. {
  2264. var str_view_task_id = obj.id;
  2265. var str_obj_task_prj_key = "view_task_pid_" + obj.id;
  2266. var obj_project_id = document.getElementById(str_obj_task_prj_key);
  2267. var str_project_id = obj_project_id.value;
  2268. //任务类型
  2269. var str_task_type = document.getElementById("view_task_prj_type_" + str_view_task_id).value;
  2270. //取出默认参数
  2271. var http_request = new XMLHttpRequest();
  2272. http_request.open("GET", str_srv_url + "/project/task/params?tid=" + str_view_task_id, false);
  2273. http_request.send(null);
  2274. //填充参数到表格
  2275. add_parms_to_table(http_request.responseText, str_task_type);
  2276. //tid赋值成obj.id
  2277. var obj_init_task_input = document.getElementById('create_task_hidden_task_id');
  2278. obj_init_task_input.value = obj.id;
  2279. var obj_btn = document.getElementById('btn_create_task');
  2280. obj_btn.value = "启动训练";
  2281. var on_win_create_task = document.getElementById('input_win_create_task');
  2282. var over_win_create_task = document.getElementById('input_win_create_task_over');
  2283. on_win_create_task.style.display = "block";
  2284. over_win_create_task.style.display = "block";
  2285. }
  2286. //增加所有参数到表格
  2287. function add_parms_to_table(str_parms, str_type = "classification")
  2288. {
  2289. var obj_json = eval('(' + str_parms + ')');
  2290. var obj_parms = obj_json["train"];
  2291. g_train_task_parms = obj_parms;
  2292. var rows = table_create_task.rows.length;
  2293. for (i=0;i<rows;i++)
  2294. {
  2295. table_create_task.deleteRow(i);
  2296. rows=rows-1;
  2297. i=i-1;
  2298. }
  2299. //根据模型类型增加参数
  2300. var tr_bg_color_gen = "#D4FB79";
  2301. var tr_bg_color_adv = "#FFFC79";
  2302. var tr_bg_color_aug = "#76D6FF";
  2303. var rows = table_create_task.rows.length;
  2304. var newTr = table_create_task.insertRow(rows);
  2305. newTr.className = "parent_parm_row";
  2306. newTr.id = "general_parm_row";
  2307. newTr.onclick=function()
  2308. {
  2309. for (i=0; i < table_create_task.rows.length; i++)
  2310. {
  2311. var obj_tr = table_create_task.rows[i];
  2312. if(obj_tr.className == "child_" + this.id)
  2313. {
  2314. if(obj_tr.style.display == "none")
  2315. obj_tr.style.display = "table-row";
  2316. else
  2317. obj_tr.style.display = "none";
  2318. }
  2319. }
  2320. }
  2321. newTr.style.cursor="pointer";
  2322. newTr.style.backgroundColor = tr_bg_color_gen;
  2323. var newTd0=newTr.insertCell();
  2324. newTd0.colSpan="2";
  2325. newTd0.innerText="通用参数";
  2326. //通用参数
  2327. add_one_task_parm_to_table("model", "模型选择", g_train_task_parms["model"], newTr.id, "selection",str_type);
  2328. //骨干网络
  2329. if (g_train_task_parms.hasOwnProperty("backbone"))
  2330. {
  2331. add_one_task_parm_to_table("backbone", "骨干网络", g_train_task_parms["backbone"], newTr.id, "selection",str_type);
  2332. }
  2333. else
  2334. {
  2335. add_one_task_parm_to_table("backbone", "骨干网络", "", newTr.id, "selection",str_type);
  2336. }
  2337. add_one_task_parm_to_table("pretrain_weights", "预训练模型", g_train_task_parms["pretrain_weights"], newTr.id, "selection");
  2338. add_one_task_parm_to_table("image_shape", "图像大小", g_train_task_parms["image_shape"], newTr.id);
  2339. add_one_task_parm_to_table("num_epochs", "迭代轮数", g_train_task_parms["num_epochs"], newTr.id);
  2340. add_one_task_parm_to_table("learning_rate", "学习率", g_train_task_parms["learning_rate"], newTr.id);
  2341. add_one_task_parm_to_table("batch_size", "批大小", g_train_task_parms["batch_size"], newTr.id);
  2342. //获取系统信息用于GPU信息选择
  2343. var str_sys_info = get_server_system_info();
  2344. var obj_json = eval('(' + str_sys_info + ')');
  2345. var int_gpu_count = parseInt(obj_json["info"]["gpu_num"]);
  2346. var int_cpu_count = parseInt(obj_json["info"]["cpu_num"]);
  2347. var str_sys_platform = obj_json["info"]["sysstr"];
  2348. if(int_gpu_count > 0)
  2349. {
  2350. add_one_task_parm_to_table("use_gpu", "是否使用GPU", "yes", newTr.id, "enable");
  2351. if(str_sys_platform.toLowerCase() == "linux");
  2352. {
  2353. var str_gpu_card_num = "0";
  2354. for (i=1; i < int_gpu_count; i++)
  2355. {
  2356. str_gpu_card_num = str_gpu_card_num + "," + i;
  2357. }
  2358. if (g_train_task_parms.hasOwnProperty("cuda_visible_devices") && g_train_task_parms["cuda_visible_devices"].length > 0)
  2359. {
  2360. str_gpu_card_num = g_train_task_parms["cuda_visible_devices"];
  2361. }
  2362. add_one_task_parm_to_table("cuda_visible_devices", "训练使用GPU卡列表", str_gpu_card_num, newTr.id, "text");
  2363. }
  2364. }
  2365. else
  2366. {
  2367. add_one_task_parm_to_table("use_gpu", "是否使用GPU", "否(未检测到GPU)", newTr.id, "label");
  2368. }
  2369. //高级参数
  2370. var rows = table_create_task.rows.length;
  2371. var newTr = table_create_task.insertRow(rows);
  2372. newTr.className = "parent_parm_row";
  2373. newTr.id = "advance_parm_row";
  2374. newTr.onclick=function()
  2375. {
  2376. for (i=0; i < table_create_task.rows.length; i++)
  2377. {
  2378. var obj_tr = table_create_task.rows[i];
  2379. if(obj_tr.className == "child_" + this.id)
  2380. {
  2381. if(obj_tr.style.display == "none")
  2382. obj_tr.style.display = "table-row";
  2383. else
  2384. obj_tr.style.display = "none";
  2385. }
  2386. }
  2387. }
  2388. newTr.style.cursor="pointer";
  2389. newTr.style.backgroundColor = tr_bg_color_adv;
  2390. var newTd0=newTr.insertCell();
  2391. newTd0.colSpan="2";
  2392. newTd0.innerText="高级参数";
  2393. add_one_task_parm_to_table("save_interval_epochs", "模型保存轮数", g_train_task_parms["save_interval_epochs"], newTr.id);
  2394. add_one_task_parm_to_table("lr_policy", "学习率下降方法", g_train_task_parms["lr_policy"], newTr.id, "selection");
  2395. add_one_task_parm_to_table("lr_decay_epochs", "学习率刷哀减轮数", g_train_task_parms["lr_decay_epochs"], newTr.id);
  2396. add_one_task_parm_to_table("image_mean", "图像均值", g_train_task_parms["image_mean"], newTr.id);
  2397. add_one_task_parm_to_table("image_std", "图像方差", g_train_task_parms["image_std"], newTr.id);
  2398. //数据增强策略
  2399. var rows = table_create_task.rows.length;
  2400. var newTr = table_create_task.insertRow(rows);
  2401. newTr.className = "parent_parm_row";
  2402. newTr.id = "augument_parm_row";
  2403. newTr.onclick=function()
  2404. {
  2405. for (i=0; i < table_create_task.rows.length; i++)
  2406. {
  2407. var obj_tr = table_create_task.rows[i];
  2408. if(obj_tr.className == "child_" + this.id)
  2409. {
  2410. if(obj_tr.style.display == "none")
  2411. obj_tr.style.display = "table-row";
  2412. else
  2413. obj_tr.style.display = "none";
  2414. }
  2415. }
  2416. }
  2417. newTr.style.cursor="pointer";
  2418. newTr.style.backgroundColor = tr_bg_color_aug;
  2419. var newTd0=newTr.insertCell();
  2420. newTd0.colSpan="2";
  2421. newTd0.innerText="数据增强策略";
  2422. add_one_task_parm_to_table("brightness", "随机亮度", "off", newTr.id, "switch");
  2423. add_one_task_parm_to_table("contrast", "随机对比度", "off", newTr.id, "switch");
  2424. add_one_task_parm_to_table("horizontal_flip", "随机水平翻转", "off", newTr.id, "switch");
  2425. add_one_task_parm_to_table("vertical_flip", "随机垂直翻转", "off", newTr.id, "switch");
  2426. add_one_task_parm_to_table("rotate", "随机旋转", "off", newTr.id, "switch");
  2427. add_one_task_parm_to_table("saturation", "随机饱和度", "off", newTr.id, "switch");
  2428. add_one_task_parm_to_table("hue", "随机色调", "off", newTr.id, "switch");
  2429. add_one_task_parm_to_table("augument_details", "数据增强详细设置", "点击设置...", newTr.id, "button");
  2430. }
  2431. //增加一个训练参数到表格(text/select/enable/switch)
  2432. function add_one_task_parm_to_table(str_key, str_view, str_value, parent_key = "", parm_type = "text", task_type = "classification")
  2433. {
  2434. var rows = table_create_task.rows.length;
  2435. var bg_color = "background-color:#ffffff;"
  2436. if(rows % 2 == 0)
  2437. {
  2438. bg_color = "background-color:#f2f2f2;"
  2439. }
  2440. var newTr = table_create_task.insertRow(rows);
  2441. if(parent_key != "")
  2442. {
  2443. newTr.className = "child_" + parent_key;
  2444. newTr.id = "task_parms_" + str_key;
  2445. }
  2446. var newTd0=newTr.insertCell();
  2447. var newTd1=newTr.insertCell();
  2448. newTd0.innerHTML = str_view;
  2449. if(parm_type == "text")
  2450. {
  2451. newTd1.innerHTML = "<input id=\"task_detail_parm_" + str_key + "\" value=\"" + str_value + "\"" + "style=\"width:100%;height:20px;Float:left;border:none;outline:none;" + bg_color + "\" type=\"text\"/>";
  2452. }
  2453. else if (parm_type == "label")
  2454. {
  2455. newTd1.innerHTML = "<input id=\"task_detail_parm_" + str_key + "\" value=\"" + str_value + "\"" + "style=\"width:100%;height:20px;Float:left;border:none;outline:none;" + bg_color + "\" type=\"text\" readonly=\"readonly\"/>";
  2456. }
  2457. else if (parm_type == "button")
  2458. {
  2459. newTd1.innerHTML = "<input type=\"button\" onclick=\"set_augument_detail_parms(this)\" id=\"task_detail_parm_" + str_key + "\" value=\"" + str_value + "\"" + "style=\"width:100%;height:20px;Float:left;border:none;outline:none;" + bg_color + "\"/>";
  2460. }
  2461. else if (parm_type == "selection")
  2462. {
  2463. if(str_key == "model")
  2464. {
  2465. //任务类型
  2466. var str_list = Model_List[task_type];
  2467. var str_html = "<select id=\"task_detail_parm_" + str_key + "\" onchange=\"change_model_type(this);\" value=\"" + str_value + "\"" + "style=\"width:100%;height:20px;Float:left;border:none;outline:none;" + bg_color + "\">";
  2468. for(var i=0;i<str_list.length;i++)
  2469. {
  2470. if(str_value == str_list[i])
  2471. str_html = str_html + "<option value=\"" + str_list[i] + "\" selected=\"selected\">" + str_list[i] + "</option>";
  2472. else
  2473. str_html = str_html + "<option value=\"" + str_list[i] + "\">" + str_list[i] + "</option>";
  2474. }
  2475. str_html = str_html + "</select>";
  2476. newTd1.innerHTML = str_html;
  2477. }
  2478. else if (str_key == "backbone")
  2479. {
  2480. //骨干网络
  2481. var lst_backbones = ["NA"];
  2482. if(str_value != "")
  2483. {
  2484. lst_backbones = Backbone_List[document.getElementById('task_detail_parm_model').value];
  2485. }
  2486. var str_html = "<select id=\"task_detail_parm_" + str_key + "\" value=\"" + str_value + "\"" + "style=\"width:100%;height:20px;Float:left;border:none;outline:none;" + bg_color + "\">";
  2487. for(var i=0;i<lst_backbones.length;i++)
  2488. {
  2489. if(str_value == lst_backbones[i])
  2490. str_html = str_html + "<option value=\"" + lst_backbones[i] + "\" selected=\"selected\">" + lst_backbones[i] + "</option>";
  2491. else
  2492. str_html = str_html + "<option value=\"" + lst_backbones[i] + "\">" + lst_backbones[i] + "</option>";
  2493. }
  2494. str_html = str_html + "</select>";
  2495. newTd1.innerHTML = str_html;
  2496. }
  2497. else if (str_key == "pretrain_weights")
  2498. {
  2499. //预训练模型
  2500. var lst_pretrain_weights = get_pretrained_model_list("");
  2501. var str_html = "<select id=\"task_detail_parm_" + str_key + "\" value=\"" + str_value + "\"" + "style=\"width:100%;height:20px;Float:left;border:none;outline:none;" + bg_color + "\">";
  2502. for(var i=0;i<lst_pretrain_weights.length;i++)
  2503. {
  2504. if(str_value == lst_pretrain_weights[i])
  2505. str_html = str_html + "<option value=\"" + lst_pretrain_weights[i] + "\" selected=\"selected\">" + lst_pretrain_weights[i] + "</option>";
  2506. else
  2507. str_html = str_html + "<option value=\"" + lst_pretrain_weights[i] + "\">" + lst_pretrain_weights[i] + "</option>";
  2508. }
  2509. str_html = str_html + "</select>";
  2510. newTd1.innerHTML = str_html;
  2511. }
  2512. else if (str_key == "lr_policy")
  2513. {
  2514. //学习率哀减策略
  2515. var lst_lr_policy = get_lr_decay_list("");
  2516. var str_html = "<select id=\"task_detail_parm_" + str_key + "\" value=\"" + str_value + "\"" + "style=\"width:100%;height:20px;Float:left;border:none;outline:none;" + bg_color + "\">";
  2517. for(var i=0;i<lst_lr_policy.length;i++)
  2518. {
  2519. if(str_value == lst_lr_policy[i])
  2520. str_html = str_html + "<option value=\"" + lst_lr_policy[i] + "\" selected=\"selected\">" + lst_lr_policy[i] + "</option>";
  2521. else
  2522. str_html = str_html + "<option value=\"" + lst_lr_policy[i] + "\">" + lst_lr_policy[i] + "</option>";
  2523. }
  2524. str_html = str_html + "</select>";
  2525. newTd1.innerHTML = str_html;
  2526. }
  2527. }
  2528. else if (parm_type == "enable")
  2529. {
  2530. var str_html = "<select id=\"task_detail_parm_" + str_key + "\" value=\"" + str_value + "\"" + "style=\"width:100%;height:20px;Float:left;border:none;outline:none;" + bg_color + "\">";
  2531. if(str_value == "yes")
  2532. str_html = str_html + "<option value=\"" + "yes" + "\" selected=\"selected\">" + "是" + "</option>";
  2533. else
  2534. str_html = str_html + "<option value=\"" + "yes" + "\">" + "是" + "</option>";
  2535. if(str_value == "no")
  2536. str_html = str_html + "<option value=\"" + "no" + "\" selected=\"selected\">" + "否" + "</option>";
  2537. else
  2538. str_html = str_html + "<option value=\"" + "no" + "\">" + "否" + "</option>";
  2539. str_html = str_html + "</select>";
  2540. newTd1.innerHTML = str_html;
  2541. }
  2542. else if (parm_type == "switch")
  2543. {
  2544. var str_html = "<select id=\"task_detail_parm_" + str_key + "\" value=\"" + str_value + "\"" + "style=\"width:100%;height:20px;Float:left;border:none;outline:none;" + bg_color + "\">";
  2545. if(str_value == "on")
  2546. str_html = str_html + "<option value=\"" + "on" + "\" selected=\"selected\">" + "开" + "</option>";
  2547. else
  2548. str_html = str_html + "<option value=\"" + "on" + "\">" + "开" + "</option>";
  2549. if(str_value == "off")
  2550. str_html = str_html + "<option value=\"" + "off" + "\" selected=\"selected\">" + "关" + "</option>";
  2551. else
  2552. str_html = str_html + "<option value=\"" + "off" + "\">" + "关" + "</option>";
  2553. str_html = str_html + "</select>";
  2554. newTd1.innerHTML = str_html;
  2555. }
  2556. }
  2557. //设置数据增强详细信息
  2558. function set_augument_detail_parms(obj)
  2559. {
  2560. }
  2561. //预训练模型列表
  2562. function get_pretrained_model_list(str_model_name)
  2563. {
  2564. var lst_pretrained_model = ["IMAGENET","不使用预训练模型"];
  2565. return lst_pretrained_model;
  2566. }
  2567. //学习率哀减策略列表
  2568. function get_lr_decay_list(str_model_name)
  2569. {
  2570. var lst_lr_decay = ["Linear","Piecewise","Cosine"];
  2571. return lst_lr_decay;
  2572. }
  2573. //创建并启动任务训练
  2574. function create_task()
  2575. {
  2576. var input_create_task_prj_id = document.getElementById('create_task_project_id');
  2577. var str_project_id = input_create_task_prj_id.value;
  2578. var obj_btn = document.getElementById('btn_create_task');
  2579. if(obj_btn.value == "启动训练")
  2580. {
  2581. var str_start_tid = ""
  2582. var obj_init_task_input = document.getElementById('create_task_hidden_task_id');
  2583. str_start_tid = obj_init_task_input.value;
  2584. start_task(str_start_tid);
  2585. load_tasks();
  2586. hide_create_task_win_modal(null);
  2587. }
  2588. else if(obj_btn.value == "创建并启动训练")
  2589. {
  2590. var http_request = new XMLHttpRequest();
  2591. http_request.onreadystatechange=function()
  2592. {
  2593. if (http_request.readyState==4)
  2594. {
  2595. if (http_request.status==200)
  2596. {
  2597. alert("任务创建成功!\n" + http_request.responseText);
  2598. //调用训练接口启动任务训练
  2599. str_json = http_request.responseText;
  2600. var obj_json = eval('(' + str_json + ')');
  2601. var str_new_tid = obj_json["tid"];
  2602. start_task(str_new_tid);
  2603. load_tasks();
  2604. hide_create_task_win_modal(null);
  2605. }
  2606. else
  2607. {
  2608. alert("任务创建失败,请检查服务器配置" + http_request.responseText);
  2609. }
  2610. }
  2611. }
  2612. //获取训练参数
  2613. get_input_task_parm_value("model","text");
  2614. get_input_task_parm_value("backbone","text");
  2615. get_input_task_parm_value("num_epochs","int");
  2616. get_input_task_parm_value("batch_size","int");
  2617. get_input_task_parm_value("learning_rate","float");
  2618. get_input_task_parm_value("save_interval_epochs","int");
  2619. //图像参数
  2620. get_input_task_parm_value("image_shape","list");
  2621. get_input_task_parm_value("image_mean","list");
  2622. get_input_task_parm_value("image_std","list");
  2623. //是否使用GPU
  2624. get_input_task_parm_value("use_gpu","text");
  2625. //调用创建接口创建任务
  2626. //alert(JSON.stringify(g_train_task_parms));
  2627. var data = {"pid":str_project_id,"train":JSON.stringify(g_train_task_parms)};
  2628. http_request.open("POST", str_srv_url + "/project/task", true);
  2629. http_request.setRequestHeader("Content-type","application/json");
  2630. http_request.send(JSON.stringify(data));
  2631. }
  2632. }
  2633. //获取表格中模型训练参数
  2634. function get_input_task_parm_value(str_key, str_type="int")
  2635. {
  2636. var str_input_obj_key = "task_detail_parm_" + str_key;
  2637. var obj_task_parm_input = document.getElementById(str_input_obj_key);
  2638. var str_value = obj_task_parm_input.value;
  2639. if(str_type == "int")
  2640. {
  2641. g_train_task_parms[str_key] = parseInt(str_value);
  2642. }
  2643. else if (str_type == "float")
  2644. {
  2645. g_train_task_parms[str_key] = parseFloat(str_value);
  2646. }
  2647. else if (str_type == "list")
  2648. {
  2649. g_train_task_parms[str_key] = str_value.split(',').map(Number);
  2650. }
  2651. else
  2652. {
  2653. if(str_key == "backbone" && str_value == "NA")
  2654. {
  2655. g_train_task_parms[str_key] = "";
  2656. return;
  2657. }
  2658. if(str_key == "use_gpu")
  2659. {
  2660. if(str_value == "yes")
  2661. {
  2662. g_train_task_parms["use_gpu"] = true;
  2663. var str_card_list = document.getElementById('task_detail_parm_cuda_visible_devices').value
  2664. g_train_task_parms["cuda_visible_devices"] = str_card_list.split(',').map(Number);
  2665. return;
  2666. }
  2667. else
  2668. {
  2669. return;
  2670. }
  2671. }
  2672. g_train_task_parms[str_key] = str_value;
  2673. }
  2674. }
  2675. //启动训练任务
  2676. function start_task(tid)
  2677. {
  2678. var train_data = {"tid":tid};
  2679. var train_http_request = new XMLHttpRequest();
  2680. train_http_request.open("POST", str_srv_url + "/project/task/train", false);
  2681. train_http_request.setRequestHeader("Content-type","application/json");
  2682. train_http_request.send(JSON.stringify(train_data));
  2683. }
  2684. //查看单个项目下的所有任务
  2685. function view_project_tasks()
  2686. {
  2687. var obj_project_id = document.getElementById('popup_menu_project_id');
  2688. var str_project_id = obj_project_id.value;
  2689. g_view_project_task_id = str_project_id;
  2690. load_project_tasks(str_project_id);
  2691. }
  2692. //删除项目
  2693. function delete_project()
  2694. {
  2695. var obj_project_id = document.getElementById('popup_menu_project_id');
  2696. str_del_project_id = obj_project_id.value;
  2697. var result = confirm("删除项目:" + obj_project_id.value + " ?");
  2698. if(!result)
  2699. {
  2700. return;
  2701. }
  2702. var http_request = new XMLHttpRequest();
  2703. http_request.onreadystatechange=function()
  2704. {
  2705. if (http_request.readyState==4)
  2706. {
  2707. if (http_request.status==200)
  2708. {
  2709. alert("删除项目:" + str_del_project_id + "删除成功!\n" + http_request.responseText);
  2710. load_projects();
  2711. }
  2712. else
  2713. {
  2714. alert("项目" + str_del_project_id + "删除失败,请检查服务器配置" + http_request.responseText);
  2715. }
  2716. }
  2717. }
  2718. var data = {"pid":str_del_project_id};
  2719. http_request.open("DELETE", str_srv_url + "/project", true);
  2720. http_request.setRequestHeader("Content-type","application/json");
  2721. http_request.send(JSON.stringify(data));
  2722. }
  2723. //删除数据集
  2724. function delete_dataset()
  2725. {
  2726. var obj_dataset_id = document.getElementById('popup_menu_dataset_id');
  2727. str_del_dataset_id = obj_dataset_id.value;
  2728. var result = confirm("删除数据集:" + str_del_dataset_id + " ?");
  2729. if(!result)
  2730. {
  2731. return;
  2732. }
  2733. var http_request = new XMLHttpRequest();
  2734. http_request.onreadystatechange=function()
  2735. {
  2736. if (http_request.readyState==4)
  2737. {
  2738. if (http_request.status==200)
  2739. {
  2740. alert("删除数据集:" + str_del_dataset_id + "删除成功!\n" + http_request.responseText);
  2741. load_datasets();
  2742. }
  2743. else
  2744. {
  2745. alert("数据集" + str_del_dataset_id + "删除失败,请检查服务器配置" + http_request.responseText);
  2746. }
  2747. }
  2748. }
  2749. var data = {"did":str_del_dataset_id};
  2750. http_request.open("DELETE", str_srv_url + "/dataset", true);
  2751. http_request.setRequestHeader("Content-type","application/json");
  2752. http_request.send(JSON.stringify(data));
  2753. }
  2754. //中止任务
  2755. function stop_task()
  2756. {
  2757. var input_task_detail_id = document.getElementById('task_detail_id');
  2758. var str_stop_task_id = input_task_detail_id.value;
  2759. var result = confirm("确定终止任务:" + str_stop_task_id + " ?");
  2760. if(!result)
  2761. {
  2762. return;
  2763. }
  2764. var http_request = new XMLHttpRequest();
  2765. http_request.onreadystatechange=function()
  2766. {
  2767. if (http_request.readyState==4)
  2768. {
  2769. if (http_request.status==200)
  2770. {
  2771. alert("任务:" + str_stop_task_id + "中止成功!\n" + http_request.responseText);
  2772. hide_task_detail_info_win_modal();
  2773. load_tasks();
  2774. }
  2775. else
  2776. {
  2777. alert("任务:" + str_stop_task_id + "中止失败,请检查服务器配置" + http_request.responseText);
  2778. }
  2779. }
  2780. }
  2781. var data = {"tid":str_stop_task_id,"act":"stop"};
  2782. http_request.open("PUT", str_srv_url + "/project/task/train", true);
  2783. http_request.setRequestHeader("Content-type","application/json");
  2784. http_request.send(JSON.stringify(data));
  2785. }
  2786. //删除任务
  2787. function delete_task()
  2788. {
  2789. var obj_task_id = document.getElementById('popup_menu_task_id');
  2790. str_del_task_id = obj_task_id.value;
  2791. var result = confirm("删除任务:" + str_del_task_id + " ?");
  2792. if(!result)
  2793. {
  2794. return;
  2795. }
  2796. var http_request = new XMLHttpRequest();
  2797. http_request.onreadystatechange=function()
  2798. {
  2799. if (http_request.readyState==4)
  2800. {
  2801. if (http_request.status==200)
  2802. {
  2803. alert("删除任务:" + str_del_task_id + "删除成功!\n" + http_request.responseText);
  2804. load_tasks();
  2805. }
  2806. else
  2807. {
  2808. alert("任务" + str_del_task_id + "删除失败,请检查服务器配置" + http_request.responseText);
  2809. }
  2810. }
  2811. }
  2812. var data = {"tid":str_del_task_id};
  2813. http_request.open("DELETE", str_srv_url + "/project/task", true);
  2814. http_request.setRequestHeader("Content-type","application/json");
  2815. http_request.send(JSON.stringify(data));
  2816. }
  2817. //删除模型
  2818. function delete_model()
  2819. {
  2820. var obj_model_id = document.getElementById('popup_menu_model_id');
  2821. str_del_model_id = obj_model_id.value;
  2822. var result = confirm("删除模型:" + str_del_model_id + " ?");
  2823. if(!result)
  2824. {
  2825. return;
  2826. }
  2827. var http_request = new XMLHttpRequest();
  2828. http_request.onreadystatechange=function()
  2829. {
  2830. if (http_request.readyState==4)
  2831. {
  2832. if (http_request.status==200)
  2833. {
  2834. alert("删除模型:" + str_del_model_id + "删除成功!\n" + http_request.responseText);
  2835. load_models();
  2836. }
  2837. else
  2838. {
  2839. alert("模型" + str_del_model_id + "删除失败,请检查服务器配置" + http_request.responseText);
  2840. }
  2841. }
  2842. }
  2843. var data = {"emid":str_del_model_id, "type":"exported"};
  2844. http_request.open("DELETE", str_srv_url + "/model", true);
  2845. http_request.setRequestHeader("Content-type","application/json");
  2846. http_request.send(JSON.stringify(data));
  2847. }
  2848. //新建对象
  2849. function create_new(obj)
  2850. {
  2851. var str_btn_lbl = obj.value;
  2852. if(str_btn_lbl == "新建数据集")
  2853. {
  2854. show_create_dataset_win_modal(obj);
  2855. }
  2856. else if(str_btn_lbl == "新建项目")
  2857. {
  2858. show_create_project_win_modal(obj);
  2859. }
  2860. else if(str_btn_lbl == "新建任务")
  2861. {
  2862. show_create_task_win_modal(obj);
  2863. }
  2864. }
  2865. //修改模型下拉列表选项
  2866. function change_model_type(obj)
  2867. {
  2868. var str_model_name = obj.value;
  2869. if (Backbone_List.hasOwnProperty(str_model_name))
  2870. {
  2871. lst_backbones = Backbone_List[str_model_name];
  2872. }
  2873. else
  2874. {
  2875. lst_backbones = ["NA"];
  2876. }
  2877. var obj_sel_backbone = document.getElementById('task_detail_parm_backbone');
  2878. obj_sel_backbone.options.length = 0;
  2879. obj_sel_backbone.value = "NA";
  2880. if(lst_backbones.length > 0)
  2881. {
  2882. for(var p in lst_backbones)
  2883. {
  2884. obj_sel_backbone.options[obj_sel_backbone.options.length] = new Option(lst_backbones[p], lst_backbones[p]);
  2885. }
  2886. }
  2887. obj_sel_backbone[0].selected = true;
  2888. }
  2889. //修改创建项目时下拉列表触发更新下拉数据集列表
  2890. function change_create_project_type(obj)
  2891. {
  2892. str_project_type = obj.value;
  2893. var obj_sel_create_project_dataset_id = document.getElementById('create_project_dataset_id_text');
  2894. obj_sel_create_project_dataset_id.options.length = 0;
  2895. obj_sel_create_project_dataset_id.options[0] = new Option("请选择项目对应数据集", 0);
  2896. for(var p in g_dataset_list)
  2897. {
  2898. str_id = g_dataset_list[p].id;
  2899. str_attr = g_dataset_list[p].attr;
  2900. str_name = str_attr["name"];
  2901. str_desc = str_attr["desc"];
  2902. str_type = str_attr["type"];
  2903. str_status = str_attr["dataset_status"]
  2904. //只有校验通过且切分后的数据集才可以选择
  2905. if(str_status == DatasetStatus.XSPLITED && str_type == str_project_type)
  2906. {
  2907. obj_sel_create_project_dataset_id.options[obj_sel_create_project_dataset_id.options.length] = new Option(str_name, str_id);
  2908. }
  2909. }
  2910. }
  2911. //ESC to close browse img window
  2912. function dispatch_key_press()
  2913. {
  2914. switch(event.keyCode)
  2915. {
  2916. //ESC
  2917. case 27:
  2918. {
  2919. hide_zoom_img(null);
  2920. hide_log_win(null);
  2921. }
  2922. }
  2923. }
  2924. </script>
  2925. </head>
  2926. <body onload="load_projects()" oncontextmenu="self.event.returnValue=false" onkeypress="dispatch_key_press()">
  2927. <!--popupmenu-->
  2928. <div id="popupmenu_project" class="popupmenu_project">
  2929. <input type="hidden" id="popup_menu_project_id">
  2930. <!--<input type="hidden" id="popup_menu_project_type">-->
  2931. <table border="0" width="100%" height="100%" cellspacing="0">
  2932. <tr>
  2933. <td style="cursor:default; border:solid #ccc 1px;" align="center" onclick="show_create_task_win_modal(this)">创建任务</td>
  2934. </tr>
  2935. <tr>
  2936. <td style="cursor:default; border:solid #ccc 1px;" align="center" onclick="view_project_tasks()">查看任务</td>
  2937. </tr>
  2938. <tr>
  2939. <td style="cursor:default; border:solid #ccc 1px;" align="center" onclick="delete_project()">删除项目</td>
  2940. </tr>
  2941. </table>
  2942. </div>
  2943. <div id="popupmenu_dataset" class="popupmenu_dataset">
  2944. <input type="hidden" id="popup_menu_dataset_id">
  2945. <table border="0" width="100%" height="100%" cellspacing="0">
  2946. <tr>
  2947. <td style="cursor:default; border:solid #ccc 1px;" align="center" onclick="delete_dataset(this)">删除数据集</td>
  2948. </tr>
  2949. </table>
  2950. </div>
  2951. <div id="popupmenu_task" class="popupmenu_task">
  2952. <input type="hidden" id="popup_menu_task_id">
  2953. <input type="hidden" id="popup_menu_task_status">
  2954. <table border="0" width="100%" height="100%" cellspacing="0">
  2955. <tr>
  2956. <td style="cursor:default; border:solid #ccc 1px;" align="center" onclick="delete_task(this)">删除任务</td>
  2957. </tr>
  2958. </table>
  2959. </div>
  2960. <div id="popupmenu_model" class="popupmenu_model">
  2961. <input type="hidden" id="popup_menu_model_id">
  2962. <table border="0" width="100%" height="100%" cellspacing="0">
  2963. <tr>
  2964. <td style="cursor:default; border:solid #ccc 1px;" align="center" onclick="delete_model(this)">删除模型</td>
  2965. </tr>
  2966. </table>
  2967. </div>
  2968. <!--main menu-->
  2969. <div class='nav'>
  2970. <ul>
  2971. <!--<li><div class="brand"> <a href="https://www.paddlepaddle.org.cn/paddle/paddleX"><img src="logo.png" alt="PaddleX Logo"></a></div></li>
  2972. <li>
  2973. <div class="navbar-btn" style="padding: 0; padding-top: 10px;">
  2974. <button type="button" class="btn-toggle-fullwidth btn-toggle-mx"><img src="img/left.png" height="40px" alt=""></button>
  2975. </div>
  2976. </li>
  2977. -->
  2978. <li><a href='https://www.paddlepaddle.org.cn/paddle/paddleX'>PaddleX主页</a></li>
  2979. <li><a href='#'>数据集管理</a>
  2980. <ul>
  2981. <li onclick="show_create_dataset_win_modal(this)"><a href='#'>创建数据集</a></li>
  2982. <li onclick="load_datasets()"><a href='#'>查看数据集</a></li>
  2983. </ul>
  2984. </li>
  2985. <li><a href='#'>项目管理</a>
  2986. <ul>
  2987. <li onclick="show_create_project_win_modal(this)"><a href='#'>创建项目</a></li>
  2988. <li onclick="load_projects()"><a href='#'>查看项目</a></li>
  2989. </ul>
  2990. </li>
  2991. <li><a href='#'>任务管理</a>
  2992. <ul>
  2993. <li onclick="load_tasks()"><a href='#'>查看所有任务</a></li>
  2994. </ul>
  2995. </li>
  2996. <li><a href='#'>模型管理</a>
  2997. <ul>
  2998. <!--<li><a href='#'>预训练模型</a></li>-->
  2999. <li onclick="load_models()"><a href='#'>已发布模型</a></li>
  3000. </ul>
  3001. </li>
  3002. <li onclick="show_server_info(this)"><a href='#'>服务器信息</a></li>
  3003. <li><a href='https://paddlex.readthedocs.io'>帮助文档</a></li>
  3004. <li onclick="contact_us()"><a href='#'>联系我们</a></li>
  3005. </ul>
  3006. </div>
  3007. <div style="text-align:center;clear:both;margin-top:10px">
  3008. <br>
  3009. <div id="div_demo_title"><h2><font color="#0000cd"> 欢迎使用 PaddleX RestfulAPI</font></h2></div>
  3010. <table width="100%" height="40px" align="center" cellspacing="1px" id="table_create_new">
  3011. <tr>
  3012. <td style="width: 5px;"></td>
  3013. <td>
  3014. <div class="btn" style="width: 120px; height: 38px; float:left; background: #007FFF;">
  3015. <input type="button" id="btn_create_new" style="width: 120px; height: 38px; background: #007FFF; " value="新建项目" onclick="javascript:create_new(this);"/>
  3016. </div>
  3017. </td>
  3018. </tr>
  3019. </table>
  3020. <!--show projects/tasks/datasets/models information-->
  3021. <table width="100%" height="100%" align="center" cellspacing="20px" id="table_contents" style="font-size:18px; border:0px border-collapse:separate; border-spacing:10px 90px; solid #cad9ea;">
  3022. <tr>
  3023. <td>
  3024. <div id="draw-border">
  3025. <view_item id="btn_set_server" onclick="show_server_info(this)" style="width: 330px; height: 90px; align: center"><br><font color="red">连接服务器失败,点击设置服务器信息</font></view_item>
  3026. </div>
  3027. </td>
  3028. </tr>
  3029. </table>
  3030. <!--All hidden popup windows-->
  3031. <!--服务器配置弹出窗口-->
  3032. <div id="input_win_cfg_server" style="display:none;border:1px solid #cccccc;height:260px;width:50%;position:absolute;top:24%;left:24%;z-index:10;background:white;">
  3033. <!--title-->
  3034. <div style="position:relative;background-color: #529EFF;min_height:30px; max-height: 60px;border-bottom: 1px solid #a4acb9;padding:2px 2px;">
  3035. <br><div style="font-size: 20px;">配置服务器地址</div><br>
  3036. </div>
  3037. <br/>
  3038. <!--input information-->
  3039. <table width="100%" align="center" id="table_server_info">
  3040. <tr>
  3041. <td><br><div style="font-size: 14px;">服务器地址:</div></td>
  3042. <td>
  3043. <br>
  3044. <input type="hidden" id="workspace_id">
  3045. <input id="server_url_text" style="width:85% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" />
  3046. </td>
  3047. </tr>
  3048. </table>
  3049. <br>
  3050. <!--buttons-->
  3051. <div style="margin-top: 15px; padding: 19px 20px 20px; text-align: right; border-top: 1px solid #e5e5e5;">
  3052. <div class="btn"><input type="button" id="btn_cancel_cfg_srv" style="background:#529EFF;" value="取消" onclick="hide_server_info(this);" /></div>
  3053. &nbsp;&nbsp;&nbsp;&nbsp;
  3054. <div class="btn"><input type="button" id="btn_cfg_srv" value="设置" onclick="set_server_addr(this);" /></div>
  3055. </div>
  3056. </div>
  3057. <div id="input_win_cfg_server_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0; z-index:9;background: silver;"></div>
  3058. <!--服务器配置弹出窗口-->
  3059. <!--创建项目弹出窗口-->
  3060. <div id="input_win_create_project" style="display:none;border:1px solid #cccccc;height:420px;width:50%;position:absolute;top:24%;left:24%;z-index:10;background:white;">
  3061. <!--title-->
  3062. <div style="position:relative;background-color: #529EFF;min_height:30px; max-height: 60px;border-bottom: 1px solid #a4acb9;padding:2px 2px;">
  3063. <br><div style="font-size: 20px;">新 建 项 目</div><br>
  3064. </div>
  3065. <br/>
  3066. <!--input informations-->
  3067. <table width="100%" align="center" id="table_create_prj">
  3068. <tr>
  3069. <td><br><div style="font-size: 14px;">项目名称:</div></td>
  3070. <td>
  3071. <br>
  3072. <input type="hidden" id="workspace_id_for_crt_prj">
  3073. <input id="project_name_text" value="新建项目" style="width:85% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" />
  3074. </td>
  3075. </tr>
  3076. <tr>
  3077. <td><br><div style="font-size: 14px;">项目类型:</div></td>
  3078. <td>
  3079. <br>
  3080. <select id="project_type_text" onchange="change_create_project_type(this);" style="width:89% ;height:30px;Float:left;padding: 4px 8px;margin-left: 4px;">
  3081. <option value="classification">图像分类</option>
  3082. <option value="detection">目标检测</option>
  3083. <option value="instance_segmentation">实例分割</option>
  3084. <option value="segmentation">语义分割</option>
  3085. </select>
  3086. </td>
  3087. </tr>
  3088. <tr>
  3089. <td><br><div style="font-size: 14px;">数据集:</div></td>
  3090. <td>
  3091. <br>
  3092. <select id="create_project_dataset_id_text" style="width:89% ;height:30px;Float:left;padding: 4px 8px;margin-left: 4px;">
  3093. <option value="0">请选择项目对应数据集</option>
  3094. </select>
  3095. </td>
  3096. </tr>
  3097. <tr>
  3098. <td><br><div style="font-size: 14px;">项目描述:</div></td>
  3099. <td>
  3100. <br>
  3101. <input id="project_desc_text" style="width:85% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" />
  3102. </td>
  3103. </tr>
  3104. </table>
  3105. <br>
  3106. <!--buttons-->
  3107. <div style="margin-top: 15px; padding: 19px 20px 20px; text-align: right; border-top: 1px solid #e5e5e5;">
  3108. <div class="btn"><input type="button" id="btn_cancel_create_prj" style="background:#529EFF;" value="取消" onclick="hide_create_prj_win_modal(this);" /></div>
  3109. &nbsp;&nbsp;&nbsp;&nbsp;
  3110. <div class="btn"><input type="button" id="btn_create_prj" value="创建" onclick="create_project(this);" /></div>
  3111. </div>
  3112. </div>
  3113. <div id="input_win_create_project_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0; z-index:9;background: silver;"></div>
  3114. <!--创建项目弹出窗口-->
  3115. <!--创建数据集弹出窗口-->
  3116. <div id="input_win_create_dataset" style="display:none;border:1px solid #cccccc;height:370px;width:50%;position:absolute;top:24%;left:24%;z-index:10;background:white;">
  3117. <!--title-->
  3118. <div style="position:relative;background-color: #529EFF;min_height:30px; max-height: 60px;border-bottom: 1px solid #a4acb9;padding:2px 2px;">
  3119. <br><div style="font-size: 20px;">新 建 数 据 集</div><br>
  3120. </div>
  3121. <br/>
  3122. <!--input informations-->
  3123. <table width="100%" align="center" id="table_create_dataset">
  3124. <tr>
  3125. <td ><br><div style="font-size: 14px;">数据集名称:</div></td>
  3126. <td>
  3127. <br>
  3128. <input id="dataset_name_text" value="新建数据集" style="width:85% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" />
  3129. </td>
  3130. </tr>
  3131. <tr>
  3132. <td><br><div style="font-size: 14px;">数据集类型:</div></td>
  3133. <td>
  3134. <br>
  3135. <select id="dataset_type_text" style="width:89% ;height:30px;Float:left;padding: 4px 8px;margin-left: 4px;">
  3136. <option value="classification">图像分类</option>
  3137. <option value="detection">目标检测</option>
  3138. <option value="instance_segmentation">实例分割</option>
  3139. <option value="segmentation">语义分割</option>
  3140. </select>
  3141. </td>
  3142. </tr>
  3143. <tr>
  3144. <td><br><div style="font-size: 14px;">数据集描述:</div></td>
  3145. <td>
  3146. <br>
  3147. <input id="dataset_desc_text" style="width:85% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" />
  3148. </td>
  3149. </tr>
  3150. </table>
  3151. <br>
  3152. <!--buttons-->
  3153. <div style="margin-top: 15px; padding: 19px 20px 20px; text-align: right; border-top: 1px solid #e5e5e5;">
  3154. <div class="btn"><input type="button" id="btn_cancel_create_dataset" style="background:#529EFF;" value="取消" onclick="hide_create_dataset_win_modal(this);" /></div>
  3155. &nbsp;&nbsp;&nbsp;&nbsp;
  3156. <div class="btn"><input type="button" id="btn_create_dataset" value="创建" onclick="create_dataset(this);" /></div>
  3157. </div>
  3158. </div>
  3159. <div id="input_win_create_dataset_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0; z-index:9;background: silver;"></div>
  3160. <!--创建项目弹出窗口-->
  3161. <!--数据集导入弹出窗口-->
  3162. <div id="input_win_import_dataset" style="display:none;border:1px solid #cccccc;height:260px;width:50%;position:absolute;top:24%;left:24%;z-index:10;background:white;">
  3163. <!--title-->
  3164. <div style="position:relative;background-color: #529EFF;min_height:30px; max-height: 60px;border-bottom: 1px solid #a4acb9;padding:2px 2px;">
  3165. <br><div style="font-size: 20px;">导入数据集</div><br>
  3166. </div>
  3167. <br/>
  3168. <!--input informations-->
  3169. <table width="100%" align="center" id="table_import_dataset">
  3170. <tr>
  3171. <td width="30%"><br><div style="font-size: 14px;">数据集路径(服务器端):</div></td>
  3172. <td>
  3173. <br>
  3174. <input type="hidden" id="import_dataset_id" value="">
  3175. <input id="import_dataset_path_text" style="width:85% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" />
  3176. </td>
  3177. </tr>
  3178. </table>
  3179. <br>
  3180. <!--buttons-->
  3181. <div style="margin-top: 15px; padding: 19px 20px 20px; text-align: right; border-top: 1px solid #e5e5e5;">
  3182. <div class="btn"><input type="button" id="btn_cancel_import_dataset" style="background:#529EFF;" value="取消" onclick="hide_import_dataset_win_modal(this);" /></div>
  3183. &nbsp;&nbsp;&nbsp;&nbsp;
  3184. <div class="btn"><input type="button" id="btn_import_dataset" value="导入" onclick="import_dataset(this);" /></div>
  3185. </div>
  3186. </div>
  3187. <div id="input_win_import_dataset_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0; z-index:9;background: silver;"></div>
  3188. <!--数据集导入弹出窗口-->
  3189. <!--数据集切分弹出窗口-->
  3190. <div id="input_win_split_dataset" style="display:none;border:1px solid #cccccc;height:370px;width:50%;position:absolute;top:24%;left:24%;z-index:15;background:white;">
  3191. <!--title-->
  3192. <div style="position:relative;background-color: #529EFF;min_height:30px; max-height: 60px;border-bottom: 1px solid #a4acb9;padding:2px 2px;">
  3193. <br><div style="font-size: 20px;">切分数据集</div><br>
  3194. </div>
  3195. <br/>
  3196. <!--input informations-->
  3197. <table width="100%" align="center" id="table_split_dataset">
  3198. <tr>
  3199. <td><br><div style="font-size: 14px;">训练集(%):</div></td>
  3200. <td>
  3201. <br>
  3202. <input type="hidden" id="split_dataset_id" value="">
  3203. <input id="split_dataset_train_percent" value="70" oninput="value=value.replace(/(^\.|[^\d\.])/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^\d{3,}.*/,'100')" style="width:85% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" />
  3204. </td>
  3205. </tr>
  3206. <tr>
  3207. <td><br><div style="font-size: 14px;">验证集(%):</div></td>
  3208. <td>
  3209. <br>
  3210. <input id="split_dataset_val_percent" value="20" oninput="value=value.replace(/(^\.|[^\d\.])/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^\d{3,}.*/,'100')" style="width:85% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" />
  3211. </td>
  3212. </tr>
  3213. <tr>
  3214. <td><br><div style="font-size: 14px;">测试集(%):</div></td>
  3215. <td>
  3216. <br>
  3217. <input id="split_dataset_test_percent" value="10" oninput="value=value.replace(/(^\.|[^\d\.])/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^\d{3,}.*/,'100')" style="width:85% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" />
  3218. </td>
  3219. </tr>
  3220. </table>
  3221. <br>
  3222. <!--buttons-->
  3223. <div style="margin-top: 15px; padding: 19px 20px 20px; text-align: right; border-top: 1px solid #e5e5e5;">
  3224. <div class="btn"><input type="button" id="btn_cancel_split_dataset" style="background:#529EFF;" value="取消" onclick="hide_split_dataset_win_modal(this);" /></div>
  3225. &nbsp;&nbsp;&nbsp;&nbsp;
  3226. <div class="btn"><input type="button" id="btn_split_dataset" value="切分" onclick="split_dataset(this);" /></div>
  3227. </div>
  3228. </div>
  3229. <div id="input_win_split_dataset_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0; z-index:9;background: silver;"></div>
  3230. <!--数据集导入弹出窗口-->
  3231. <!--创建任务弹出窗口-->
  3232. <div id="input_win_create_task" style="display:none;border:1px solid #cccccc;height:400px;width:50%;position:absolute;top:24%;left:24%;z-index:15;background:white;">
  3233. <!--title-->
  3234. <div style="position:relative;background-color: #529EFF;min_height:30px; max-height: 60px;border-bottom: 1px solid #a4acb9;padding:2px 2px;">
  3235. <br><div style="font-size: 20px;">任务详细信息</div><br>
  3236. <input type="hidden" id="create_task_project_id" value="">
  3237. <input type="hidden" id="create_task_project_type" value="">
  3238. <input type="hidden" id="create_task_hidden_task_id" value="">
  3239. </div>
  3240. <!--input informations-->
  3241. <div class="scroll-content">
  3242. <div class="table-parms-head">
  3243. <table width="100%" align="center" id="table_create_task_head">
  3244. <colgroup><col style="font-size: 14px;"/><col/></colgroup>
  3245. <thead><tr><th>参数名</th><th>参数值</th></tr></thead>
  3246. </table>
  3247. </div>
  3248. <div class="table-parms-body">
  3249. <table width="100%" align="center" id="table_create_task">
  3250. <colgroup><col style="font-size: 14px;" /><col /></colgroup>
  3251. <tbody>
  3252. <tr><td>key</td><td>value</td></tr>
  3253. </tbody>
  3254. </table>
  3255. </div>
  3256. </div>
  3257. <br>
  3258. <!--buttons-->
  3259. <div style="margin-top: 15px; padding: 19px 20px 20px; text-align: right; border-top: 1px solid #e5e5e5;">
  3260. <div class="btn"><input type="button" id="btn_cancel_create_task" style="background:#529EFF;" value="取消" onclick="hide_create_task_win_modal(this);" /></div>
  3261. &nbsp;&nbsp;&nbsp;&nbsp;
  3262. <div class="btn"><input type="button" id="btn_create_task" value="创建并启动训练" onclick="create_task();" /></div>
  3263. </div>
  3264. </div>
  3265. <div id="input_win_create_task_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0; z-index:14;background: silver;"></div>
  3266. <!--创建任务弹出窗口-->
  3267. <!--任务状态窗口-->
  3268. <div id="task_detail_info" style="display:none;border:1px solid #cccccc;height:420px;width:50%;position:absolute;top:24%;left:24%;z-index:10;background:white;">
  3269. <!--title-->
  3270. <div style="position:relative;background-color: #529EFF;min_height:30px; max-height: 60px;border-bottom: 1px solid #a4acb9;padding:2px 2px;">
  3271. <br><div style="font-size: 20px;">查看任务状态</div><br>
  3272. </div>
  3273. <br/>
  3274. <!--input informations-->
  3275. <table width="100%" align="center" id="table_task_detail_info">
  3276. <tr>
  3277. <td width="25%"><div style="font-size: 14px;">任务状态:</div></td>
  3278. <td>
  3279. <input type="hidden" id="task_detail_id">
  3280. <input id="task_detail_status_text" style="width:95% ;height:20px;Float:left;padding: 4px 8px; margin-left: 4px; border: none; outline: none;" type="text" readonly="readonly"/>
  3281. </td>
  3282. <td>&nbsp&nbsp</td>
  3283. </tr>
  3284. <tr>
  3285. <td width="25%"><div style="font-size: 14px;">训练进度:</div></td>
  3286. <td>
  3287. <div class="progress"> <span id="task_detail_status_progress_bar_value" class="green" style="width: 0%;"><span id="task_detail_status_progress_bar">0%</span></span></div>
  3288. </td>
  3289. <td>&nbsp&nbsp</td>
  3290. </tr>
  3291. <tr>
  3292. <td width="25%"><div style="font-size: 14px;">运行时间:</div></td>
  3293. <td>
  3294. <input id="task_detail_running_duration_text" style="width:95% ;height:20px;Float:left;padding: 4px 8px; margin-left: 4px; border: none; outline: none;" type="text" readonly="readonly"/>
  3295. </td>
  3296. <td>&nbsp&nbsp</td>
  3297. </tr>
  3298. <tr>
  3299. <td width="25%"><div style="font-size: 14px;">VDL可视化数据:</div></td>
  3300. <td>
  3301. <input id="task_detail_vdl_text" value="点击查看" onclick="open_task_vdl_window(this);" style="color: #0000cd; width:95% ;height:20px;Float:left;padding: 4px 8px; margin-left: 4px; border: none; outline: none;" type="text" readonly="readonly"/>
  3302. </td>
  3303. <td>&nbsp&nbsp</td>
  3304. </tr>
  3305. <tr>
  3306. <td width="25%"><div style="font-size: 14px;">任务信息:</div></td>
  3307. <td>
  3308. <textarea id="task_detail_log_text" style="width:95% ;height:100px; resize:none" readonly="readonly"></textarea>
  3309. </td>
  3310. <td>&nbsp&nbsp</td>
  3311. </tr>
  3312. </table>
  3313. <!--buttons-->
  3314. <div style="margin-top: 15px; padding: 19px 20px 20px; text-align: right; border-top: 1px solid #e5e5e5;">
  3315. <!--停止任务,当任务运行中可点击-->
  3316. <div class="btn" id="div_btn_stop_task" style="visibility:hidden;"><input type="button" id="btn_stop_task_info" style="background:#FF2600;" value="中止训练" onclick="stop_task();" /></div>
  3317. &nbsp;&nbsp;&nbsp;&nbsp;
  3318. <div class="btn"><input type="button" id="btn_cancel_task_info" style="background:#529EFF;" value="取消" onclick="hide_task_detail_info_win_modal();" /></div>
  3319. &nbsp;&nbsp;&nbsp;&nbsp;
  3320. <div class="btn"><input type="button" id="btn_next_task_info" value="关闭" onclick="task_next_step_process(this);" /></div>
  3321. </div>
  3322. </div>
  3323. <div id="task_detail_info_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0;z-index:9;background: silver;"></div>
  3324. <!--任务状态窗口-->
  3325. <!--评估&导出模型窗口-->
  3326. <div id="input_win_evaluate_export_model" style="display:none;border:1px solid #cccccc;height:260px;width:50%;position:absolute;top:24%;left:24%;z-index:10;background:white;">
  3327. <!--title-->
  3328. <div style="position:relative;background-color: #529EFF;min_height:30px; max-height: 60px;border-bottom: 1px solid #a4acb9;padding:2px 2px;">
  3329. <br><div style="font-size: 20px;">模型评估&导出</div><br>
  3330. </div>
  3331. <br/>
  3332. <!--input informations-->
  3333. <table width="100%" align="center" id="table_evaluate_export_model">
  3334. <tr>
  3335. <td width="20%"><br><div style="font-size: 14px;">导出路径:</div></td>
  3336. <td>
  3337. <br>
  3338. <input type="hidden" id="evaluate_export_task_id" value="">
  3339. <input type="hidden" id="evaluate_export_task_project_id" value="">
  3340. <input id="export_model_path_text" style="width:85% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" />
  3341. </td>
  3342. </tr>
  3343. </table>
  3344. <br>
  3345. <!--buttons-->
  3346. <div style="margin-top: 15px; padding: 19px 20px 20px; text-align: right; border-top: 1px solid #e5e5e5;">
  3347. <!--评估任务-->
  3348. <div class="btn"><input type="button" id="btn_cancel_evaluate_export" style="background:#529EFF;" value="取消" onclick="hide_evaluate_export_win_modal(this);" /></div>
  3349. &nbsp;&nbsp;&nbsp;&nbsp;
  3350. <div class="btn" id="div_btn_evaluate_task"><input type="button" id="btn_evaluate_task_info" style="background:#008F00;" value="启动评估" onclick="evaluate_task(this);" /></div>
  3351. &nbsp;&nbsp;&nbsp;&nbsp;
  3352. <div class="btn"><input type="button" id="btn_close_evaluate_export" value="导出" onclick="export_model(this);" /></div>
  3353. </div>
  3354. </div>
  3355. <div id="input_win_evaluate_export_model_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0; z-index:9;background: silver;"></div>
  3356. <!--评估&导出模型窗口-->
  3357. <!--浏览数据集弹出窗口-->
  3358. <div id="win_browse_dataset" style="display:none;border:1px solid #cccccc;height:520px;width:60%;position:absolute;top:16%;left:20%;z-index:10;background:white;">
  3359. <!--title-->
  3360. <div style="position:relative;background-color: #529EFF;min_height:30px; max-height: 60px;border-bottom: 1px solid #a4acb9;padding:2px 2px;">
  3361. <br><div style="font-size: 20px;">浏 览 数 据 集</div><br>
  3362. </div>
  3363. <br/>
  3364. <!--show dataset informations-->
  3365. <table width="100%" align="center" id="table_create_dataset">
  3366. <tr>
  3367. <td><div style="font-size: 14px;">数据集名称:</div></td>
  3368. <td>
  3369. <input type="hidden" id="browse_dataset_id" value="">
  3370. <input id="browse_dataset_name_text" value="" style="width:90% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" readonly="readonly"/>
  3371. </td>
  3372. <td><div style="font-size: 14px;">数据集类型:</div></td>
  3373. <td>
  3374. <input id="browse_dataset_type_text" value="" style="width:90% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" readonly="readonly"/>
  3375. </td>
  3376. </tr>
  3377. <tr>
  3378. <td><div style="font-size: 14px;">数据集描述:</div></td>
  3379. <td colspan = "3">
  3380. <input id="browse_dataset_desc_text" style="width:96% ;height:20px;Float:left;padding: 4px 8px;margin-left: 4px;" type="text" readonly="readonly"/>
  3381. </td>
  3382. </tr>
  3383. </table>
  3384. <br>
  3385. <!--数据预览-->
  3386. <div class="scroll-content">
  3387. <div>
  3388. <table width="100%" align="center" id="table_browse_dataset_head">
  3389. <tr>
  3390. <th width="50%">全部标签</th>
  3391. <th width="50%">
  3392. <select id="sel_dataset_view_type" onchange="change_dataset_view_type(this);" style="width:180px;height:30px;Float:left;">
  3393. <option value="all">查看全量数据</option>
  3394. <option value="train">查看训练集</option>
  3395. <option value="evaluate">查看验证集</option>
  3396. <option value="test">查看测试集</option>
  3397. </select>
  3398. 全部数据预览 &nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp
  3399. <label id="dataset_chk_show_label_txt"><input type="checkbox" id="dataset_chk_show_label" value="显示标注" onclick="show_dataset_labels()" style="height: 12px;width: 12px;">&nbsp;显示标注</label>
  3400. </th>
  3401. </tr>
  3402. </table>
  3403. </div>
  3404. <div>
  3405. <table width="100%" align="center" id="table_browse_dataset">
  3406. <tr>
  3407. <td>
  3408. <!--标签-->
  3409. <div class="table-dataset-labels">
  3410. <table width="100%" align="center" id="table_dataset_labels">
  3411. <colgroup><col style="font-size: 14px;" /><col /></colgroup>
  3412. <tbody>
  3413. <tr><td>标签名称</td><td>总数据量</td><td>训练数据集</td><td>验证数据集</td><td>测试数据集</td></tr>
  3414. </tbody>
  3415. </table>
  3416. </div>
  3417. <!--标签-->
  3418. </td>
  3419. <td>
  3420. <!--图像预览-->
  3421. <div class="table-dataset-labels">
  3422. <table width="100%" align="center" id="table_dataset_imgs">
  3423. <tr>
  3424. <td><img id="dataset_img_1" ondblclick="zoom_image(this)" align="center" style="border:1px #D6D6D6 solid;" height="150" width="150" hspace="0" vspace="0"/></td>
  3425. <td><img id="dataset_img_2" ondblclick="zoom_image(this)" align="center" style="border:1px #D6D6D6 solid;" height="150" width="150" hspace="0" vspace="0"/></td>
  3426. <td><img id="dataset_img_3" ondblclick="zoom_image(this)" align="center" style="border:1px #D6D6D6 solid;" height="150" width="150" hspace="0" vspace="0"/></td>
  3427. </tr>
  3428. <tr>
  3429. <td id="dataset_img_1_file_name">img_file</td>
  3430. <td id="dataset_img_2_file_name">img_file</td>
  3431. <td id="dataset_img_3_file_name">img_file</td>
  3432. </tr>
  3433. </table>
  3434. <table width="100%" align="center" id="table_dataset_pages">
  3435. <tr>
  3436. <td style="cursor:pointer;" onclick="dataset_pre_page()">上一页</td>
  3437. <td id="dataset_page_info">第 页/共 页<td>
  3438. <td style="cursor:pointer;" onclick="dataset_next_page()">下一页</td>
  3439. </tr>
  3440. </table>
  3441. </div>
  3442. </td>
  3443. </tr>
  3444. </table>
  3445. </div>
  3446. </div>
  3447. <br>
  3448. <!--buttons-->
  3449. <div style="margin-top: 15px; padding: 19px 20px 20px; text-align: right; border-top: 1px solid #e5e5e5;">
  3450. <div class="btn"><input type="button" id="btn_cancel_browse_dataset" style="background:#529EFF;" value="取消" onclick="hide_browse_dataset_win_modal(this);" /></div>
  3451. &nbsp;&nbsp;&nbsp;&nbsp;
  3452. <div class="btn"><input type="button" id="btn_split_dataset" style="background:#008F00;" value="重新切分" onclick="re_split_dataset(this);" /></div>
  3453. &nbsp;&nbsp;&nbsp;&nbsp;
  3454. <div class="btn"><input type="button" id="btn_close_browse_dataset" value="关闭" onclick="hide_browse_dataset_win_modal(this);" /></div>
  3455. </div>
  3456. </div>
  3457. <div id="win_browse_dataset_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0; z-index:9;background: silver;"></div>
  3458. <!--浏览原图弹出窗口-->
  3459. <div id="win_browse_img" onclick="hide_zoom_img(this)" style="display:none;border:1px solid #cccccc;height:610px;width:60%;position:absolute;top:15%;left:20%;z-index:15;background:white;">
  3460. <table width="100%" align="center" id="table_img">
  3461. <tr>
  3462. <td>
  3463. <img id="dataset_browse_img" onclick="hide_zoom_img(this)" src="" align="center" style="border:1px #D6D6D6 solid;" height="600" width="600" hspace="0" vspace="0"/>
  3464. </td>
  3465. </tr>
  3466. </table>
  3467. </div>
  3468. <div id="win_browse_img_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0; z-index:9;background: silver;"></div>
  3469. <!--浏览原图弹出窗口-->
  3470. <!--浏览日志窗口-->
  3471. <div id="win_view_log" onclick="" style="display:none;border:1px solid #cccccc;height:610px;width:60%;position:absolute;top:15%;left:20%;z-index:15;background:white;">
  3472. <table width="100%" align="center" id="table_log">
  3473. <tr>
  3474. <td>
  3475. <textarea id="view_log_text" style="width:99% ;height:550px; resize:none" readonly="readonly"></textarea>
  3476. </td>
  3477. </tr>
  3478. <tr>
  3479. <td>
  3480. <div style="text-align: right;">
  3481. <div class="btn"><input type="button" id="btn_close_view_log_win" value="关闭" onclick="hide_log_win(this);" /></div>
  3482. </td>
  3483. </tr>
  3484. </table>
  3485. </div>
  3486. <div id="win_view_log_over" style="display: none;width: 100%;height: 100%;opacity:0.8;filter:alpha(opacity=80);position:absolute;top:0;left:0; z-index:9;background: silver;"></div>
  3487. <!--浏览日志窗口-->
  3488. <div class="btn">
  3489. <input type="button" id="btn_refresh" style="width: 150px; height: 50px; " value="刷新项目信息" onclick="javascript:refresh_contents(this);"/>
  3490. </div>
  3491. <br>
  3492. </body>
  3493. </html>