Skip to content

Commit

Permalink
切分改为切换式,调整ui,添加盲盒功能
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyuxiaoxiao committed Nov 9, 2023
1 parent 70eb7c8 commit 29aac39
Show file tree
Hide file tree
Showing 2 changed files with 201 additions and 140 deletions.
214 changes: 114 additions & 100 deletions src/components/infer/model_card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,120 +42,134 @@ export default {
</script>

<template>
<a-card :title="this.name + '@' + model.device">
<a-card :title="model.visible?this.name + '@' + model.device: ''">
<template #extra>
<a-switch v-model:checked="model.selected"></a-switch>
</template>
<a-row justify="start" align="bottom" :gutter="[8,8]" :wrap="true">
<h4>说话人</h4>
<a-col style="margin-left: 1em" :span="6">
<a-select
show-search
ref="select"
v-model:value="model.speaker_name"
style="width: 100%"
@focus="focus"
>
<a-select-option v-for="speaker in speakers" :value="speaker"></a-select-option>
</a-select>
</a-col>
<a-col :span="2"></a-col>
<h4>语言</h4>
<a-col style="margin-left: 1em" :span="4">
<a-select
ref="select"
v-model:value="model.language"
style="width: 100%"
@focus="focus"
>
<a-select-option value="ZH"></a-select-option>
<a-select-option value="JP"></a-select-option>
<a-select-option value="EN"></a-select-option>
</a-select>
</a-col>
<a-col :offset="3">
<a-button @click="delete_model">卸载</a-button>
</a-col>
<a-row :gutter="[8,12]">
<a-col>
<a-row justify="start" align="bottom" :gutter="[8,8]" :wrap="true" :style="{opacity:model.visible?1:0}">
<h4>说话人</h4>
<a-col style="margin-left: 1em" :span="6">
<a-select
show-search
ref="select"
v-model:value="model.speaker_name"
style="width: 100%"
@focus="focus"
>
<a-select-option v-for="speaker in speakers" :value="speaker"></a-select-option>
</a-select>
</a-col>
<a-col :span="2"></a-col>
<h4>语言</h4>
<a-col style="margin-left: 1em" :span="4">
<a-select
ref="select"
v-model:value="model.language"
style="width: 100%"
@focus="focus"
>
<a-select-option value="ZH"></a-select-option>
<a-select-option value="JP"></a-select-option>
<a-select-option value="EN"></a-select-option>
</a-select>
</a-col>
<a-col :offset="3">
<a-button @click="delete_model">卸载</a-button>
</a-col>


<a-col :span="24"></a-col>
<h4 style="width: 4em">sdp_ratio</h4>
<a-col :span="16">
<a-slider v-model:value="model.sdp_ratio" :min="0" :max="1" :step="0.1" style="color: #a0c4ff"/>
</a-col>
<a-col :span="2">
<a-input-number
v-model:value="model.sdp_ratio"
:min="0"
:max="1"
:step="0.1"
style="margin-left: 16px"
/>
</a-col>
<a-col :span="24"></a-col>
<h4 style="width: 4em">sdp_ratio</h4>
<a-col :span="16">
<a-slider v-model:value="model.sdp_ratio" :min="0" :max="1" :step="0.1" style="color: #a0c4ff"/>
</a-col>
<a-col :span="2">
<a-input-number
v-model:value="model.sdp_ratio"
:min="0"
:max="1"
:step="0.1"
style="margin-left: 16px"
/>
</a-col>

<a-col :span="24"></a-col>
<h4 style="width: 4em">noise</h4>
<a-col :span="16">
<a-slider v-model:value="model.noise" :min="0.1" :max="2" :step="0.1"/>
</a-col>
<a-col :span="2">
<a-input-number
v-model:value="model.noise"
:min="0.1"
:max="2"
:step="0.1"
style="margin-left: 16px"
/>
</a-col>
<a-col :span="24"></a-col>
<h4 style="width: 4em">noise</h4>
<a-col :span="16">
<a-slider v-model:value="model.noise" :min="0.1" :max="2" :step="0.1"/>
</a-col>
<a-col :span="2">
<a-input-number
v-model:value="model.noise"
:min="0.1"
:max="2"
:step="0.1"
style="margin-left: 16px"
/>
</a-col>

<a-col :span="24"></a-col>
<h4 style="width: 4em">noisew</h4>
<a-col :span="16">
<a-slider v-model:value="model.noisew" :min="0.1" :max="2" :step="0.1"/>
</a-col>
<a-col :span="2">
<a-input-number
v-model:value="model.noisew"
:min="0.1"
:max="2"
:step="0.1"
style="margin-left: 16px"
/>
</a-col>
<a-col :span="24"></a-col>
<h4 style="width: 4em">noisew</h4>
<a-col :span="16">
<a-slider v-model:value="model.noisew" :min="0.1" :max="2" :step="0.1"/>
</a-col>
<a-col :span="2">
<a-input-number
v-model:value="model.noisew"
:min="0.1"
:max="2"
:step="0.1"
style="margin-left: 16px"
/>
</a-col>

<a-col :span="24"></a-col>
<h4 style="width: 4em">length</h4>
<a-col :span="16">
<a-slider v-model:value="model.length" :min="0.1" :max="2" :step="0.1"/>
</a-col>
<a-col :span="2">
<a-input-number
v-model:value="model.length"
:min="0.1"
:max="2"
:step="0.1"
style="margin-left: 16px"
/>
<a-col :span="24"></a-col>
<h4 style="width: 4em">length</h4>
<a-col :span="16">
<a-slider v-model:value="model.length" :min="0.1" :max="2" :step="0.1"/>
</a-col>
<a-col :span="2">
<a-input-number
v-model:value="model.length"
:min="0.1"
:max="2"
:step="0.1"
style="margin-left: 16px"
/>
</a-col>
</a-row>
</a-col>
<a-col>
<!-- 音频相关 -->
<a-row justify="start" align="bottom" :gutter="[8,8]" :wrap="true">
<a-col :span="24">
<a-spin :spinning=model.audio.loading>
<a-space :style="{opacity: model.audio.valid? 1: 0}" size="large">
<audio :src="model.audio.data.src" controls></audio>
<a-button :href="model.audio.data.src"
:download="getName(model.audio.data.texts, model.name)">
<template #icon>
<DownloadOutlined/>
</template>

<!-- 音频相关 -->
<a-col :span="24" >
<a-spin :spinning=model.audio.loading>
<a-space :style="{opacity: model.audio.valid? 1: 0}" size="large">
<audio :src="model.audio.data.src" controls></audio>
<a-button :href="model.audio.data.src"
:download="getName(model.audio.data.texts, model.name)">
<template #icon>
<DownloadOutlined/>
</template>
下载音频
</a-button>
</a-space>
</a-spin>
</a-button>
<a-button v-show=!model.visible
type="primary"
@click="model.visible = true"
>
显示模型
</a-button>
</a-space>
</a-spin>
</a-col>
</a-row>
</a-col>
</a-row>



</a-card>
</template>

Expand Down
Loading

0 comments on commit 29aac39

Please sign in to comment.