|
|
@@ -233,7 +233,7 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="ui dropdown selection search eight wide field" id="choice_version"> |
|
|
|
<input type="hidden" id="ModelVersion" name="ModelVersion" required> |
|
|
|
<input type="hidden" id="modelVersion" name="modelVersion" required> |
|
|
|
<div class="default text">{{$.i18n.Tr "repo.modelconvert.selectversion"}}</div> |
|
|
|
<i class="dropdown icon"></i> |
|
|
|
<div class="menu" id="model-version"> |
|
|
@@ -246,7 +246,7 @@ |
|
|
|
<label for="choice_file">{{$.i18n.Tr "repo.model.manage.modelfile"}}</label> |
|
|
|
</div> |
|
|
|
<div class="ui dropdown selection search eight wide field" id="choice_file"> |
|
|
|
<input type="hidden" id="ModelFile" name="ModelFile" required> |
|
|
|
<input type="hidden" id="modelFile" name="modelFile" required> |
|
|
|
<div class="default text">{{$.i18n.Tr "repo.modelconvert.selectmodelfile"}}</div> |
|
|
|
<i class="dropdown icon"></i> |
|
|
|
<div class="menu" id="model-file"> |
|
|
@@ -260,10 +260,10 @@ |
|
|
|
</div> |
|
|
|
<div class="unite min_title inline fields required"> |
|
|
|
<div class="three wide field right aligned"> |
|
|
|
<label for="SrcEngine">{{$.i18n.Tr "repo.modelconvert.srcengine"}}</label> |
|
|
|
<label for="srcEngine">{{$.i18n.Tr "repo.modelconvert.srcengine"}}</label> |
|
|
|
</div> |
|
|
|
|
|
|
|
<select id="SrcEngine" class="ui search dropdown eight wide field" placeholder="" style='color:#000000;' name="SrcEngine" onchange="javascript:srcEngineChanged()"> |
|
|
|
<select id="srcEngine" class="ui search dropdown eight wide field" placeholder="" style='color:#000000;' name="srcEngine" onchange="javascript:srcEngineChanged()"> |
|
|
|
|
|
|
|
</select> |
|
|
|
</div> |
|
|
@@ -289,30 +289,30 @@ |
|
|
|
|
|
|
|
<div class="unite min_title inline fields required"> |
|
|
|
<div class="three wide field right aligned"> |
|
|
|
<label for="DestFormat">{{$.i18n.Tr "repo.modelconvert.outputformat"}}</label> |
|
|
|
<label for="destFormat">{{$.i18n.Tr "repo.modelconvert.outputformat"}}</label> |
|
|
|
</div> |
|
|
|
|
|
|
|
<select id="DestFormat" class="ui search dropdown eight wide field" placeholder="" style='width:50%' name="DestFormat"> |
|
|
|
<select id="destFormat" class="ui search dropdown eight wide field" placeholder="" style='width:50%' name="destFormat"> |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="unite min_title inline fields"> |
|
|
|
<div class="three wide field right aligned"> |
|
|
|
<label for="NetOutputFormat">{{$.i18n.Tr "repo.modelconvert.netoutputdata"}} </label> |
|
|
|
<label for="netOutputFormat">{{$.i18n.Tr "repo.modelconvert.netoutputdata"}} </label> |
|
|
|
</div> |
|
|
|
|
|
|
|
<select id="NetOutputFormat" class="ui search dropdown eight wide field" placeholder="" style='width:50%' name="NetOutputFormat"> |
|
|
|
<select id="netOutputFormat" class="ui search dropdown eight wide field" placeholder="" style='width:50%' name="netOutputFormat"> |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="unite min_title inline fields"> |
|
|
|
<div class="three wide field right aligned"> |
|
|
|
<label for="Description">{{$.i18n.Tr "repo.modelconvert.taskdesc"}} </label> |
|
|
|
<label for="description">{{$.i18n.Tr "repo.modelconvert.taskdesc"}} </label> |
|
|
|
</div> |
|
|
|
<div class="twelve wide field"> |
|
|
|
<textarea id="Description" name="Description" rows="1" maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}' onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 256)"></textarea> |
|
|
|
<textarea id="description" name="description" rows="1" maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}' onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 256)"></textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="unite min_title inline field"> |
|
|
@@ -364,9 +364,9 @@ |
|
|
|
$("#task_name").removeClass("error") |
|
|
|
} |
|
|
|
|
|
|
|
data['desc']= $('#Description').val() |
|
|
|
data['modelId'] = $('#ModelVersion').val() |
|
|
|
data['srcEngine'] = $('#SrcEngine').val(); |
|
|
|
data['desc']= $('#description').val() |
|
|
|
data['modelId'] = $('#modelVersion').val() |
|
|
|
data['srcEngine'] = $('#srcEngine').val(); |
|
|
|
data['inputshape']= $('#inputshape').val(); |
|
|
|
|
|
|
|
if(inputshapeNotValid(data['inputshape'])){ |
|
|
@@ -379,9 +379,9 @@ |
|
|
|
} |
|
|
|
|
|
|
|
data['inputdataformat']= $('#inputdataformat').val(); |
|
|
|
data['destFormat'] = $('#DestFormat').val(); |
|
|
|
data['netOutputFormat']= $('#NetOutputFormat').val(); |
|
|
|
data['modelFile'] = $('#ModelFile').val(); |
|
|
|
data['destFormat'] = $('#destFormat').val(); |
|
|
|
data['netOutputFormat']= $('#netOutputFormat').val(); |
|
|
|
data['modelFile'] = $('#modelFile').val(); |
|
|
|
if(data['modelFile']==""){ |
|
|
|
$('.ui.error.message').text("{{.i18n.Tr "repo.modelconvert.modelfileempty"}}") |
|
|
|
$('.ui.error.message').css('display','block') |
|
|
@@ -456,7 +456,7 @@ |
|
|
|
$('#choice_version').dropdown({ |
|
|
|
onChange:function(value){ |
|
|
|
console.log("model version:" + value); |
|
|
|
$('#choice_version input[name="ModelVersion"]').val(value) |
|
|
|
$('#choice_version input[name="modelVersion"]').val(value) |
|
|
|
loadModelFile(value); |
|
|
|
} |
|
|
|
}) |
|
|
@@ -464,26 +464,26 @@ |
|
|
|
$('#choice_file').dropdown({ |
|
|
|
onChange:function(value){ |
|
|
|
console.log("model file:" + value); |
|
|
|
$('#choice_file input[name="ModelFile"]').val(value) |
|
|
|
$('#choice_file input[name="modelFile"]').val(value) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
function srcEngineChanged(){ |
|
|
|
var ele = window.document.getElementById("SrcEngine"); |
|
|
|
var ele = window.document.getElementById("srcEngine"); |
|
|
|
var index=ele.selectedIndex; |
|
|
|
var options=ele.options; |
|
|
|
var option = options[index]; |
|
|
|
console.log("SrcEngine value=" + option); |
|
|
|
console.log("srcEngine value=" + option); |
|
|
|
let destFormatHtml = "<option name=\"ONNX\" value=\"0\">ONNX</option>"; |
|
|
|
let netOutputFormatHtml = "<option name=\"FP32\" value=\"0\">FP32</option>"; |
|
|
|
if(option==null || option =="undefined" || option.value == 0){ |
|
|
|
destFormatHtml += "<option name=\"TensorRT\" value=\"1\">TensorRT</option>" |
|
|
|
netOutputFormatHtml += "<option name=\"FP16\" value=\"1\">FP16</option>"; |
|
|
|
} |
|
|
|
$('#DestFormat').html(destFormatHtml); |
|
|
|
$('#NetOutputFormat').html(netOutputFormatHtml); |
|
|
|
$('#destFormat').html(destFormatHtml); |
|
|
|
$('#netOutputFormat').html(netOutputFormatHtml); |
|
|
|
} |
|
|
|
|
|
|
|
function loadModelList(){ |
|
|
@@ -550,25 +550,25 @@ |
|
|
|
n_length = versionList.length |
|
|
|
let train_html='' |
|
|
|
for (let i=0;i<n_length;i++){ |
|
|
|
train_html += `<div class="item" data-value="${versionList[i].ID}">${versionList[i].Version}</div>` |
|
|
|
train_html += `<div class="item" data-value="${versionList[i].id}">${versionList[i].version}</div>` |
|
|
|
train_html += '</div>' |
|
|
|
} |
|
|
|
$("#model-version").append(train_html) |
|
|
|
|
|
|
|
$('#choice_version .default.text').text(versionList[0].Version) |
|
|
|
$('#choice_version input[name="ModelVersion"]').val(versionList[0].ID) |
|
|
|
loadModelFile(versionList[0].ID); |
|
|
|
$('#choice_version .default.text').text(versionList[0].version) |
|
|
|
$('#choice_version input[name="modelVersion"]').val(versionList[0].id) |
|
|
|
loadModelFile(versionList[0].id); |
|
|
|
} |
|
|
|
setEngineValue(value); |
|
|
|
} |
|
|
|
function setEngineValue(value){ |
|
|
|
$('#SrcEngine').dropdown('clear'); |
|
|
|
$('#srcEngine').dropdown('clear'); |
|
|
|
console.log("setEngineValue value=" + value); |
|
|
|
let html = "" |
|
|
|
html +="<option name=\"PyTorch\" " + getSelected(0,value) + " value=\"0\">PyTorch</option>"; |
|
|
|
html +="<option name=\"TensorFlow\" " + getSelected(1,value) + " value=\"1\">TensorFlow</option>"; |
|
|
|
html +="<option name=\"MindSpore\" " + getSelected(2,value) + " value=\"2\">MindSpore</option>"; |
|
|
|
$('#SrcEngine').html(html); |
|
|
|
$('#srcEngine').html(html); |
|
|
|
srcEngineChanged(); |
|
|
|
} |
|
|
|
function getSelected(engineOption, modelName){ |
|
|
|