Spaces:
Running
Running
admin
commited on
Commit
·
5c0eb36
1
Parent(s):
66fca40
refine ui
Browse files
app.py
CHANGED
|
@@ -52,10 +52,10 @@ def infer_by_features(
|
|
| 52 |
audio = midi = pdf = xml = mxl = tunes = jpg = None
|
| 53 |
try:
|
| 54 |
emotion = "Q1"
|
| 55 |
-
if mode == _L("
|
| 56 |
emotion = "Q2"
|
| 57 |
|
| 58 |
-
elif mode == _L("
|
| 59 |
emotion = "Q3"
|
| 60 |
|
| 61 |
elif mode == _L("Major") and pitch_std == _L("Low"):
|
|
@@ -158,7 +158,7 @@ if __name__ == "__main__":
|
|
| 158 |
with gr.Blocks() as demo:
|
| 159 |
with gr.Row():
|
| 160 |
with gr.Column():
|
| 161 |
-
with gr.Accordion(label=_L("Additional info &
|
| 162 |
gr.Video(
|
| 163 |
"./demo.mp4" if EN_US else "./src/tutorial.mp4",
|
| 164 |
label=_L("Video demo"),
|
|
@@ -237,10 +237,14 @@ if __name__ == "__main__":
|
|
| 237 |
|
| 238 |
with gr.Tab(_L("By feature control")):
|
| 239 |
std_opt = gr.Radio(
|
| 240 |
-
[_L("Low"), _L("High")],
|
|
|
|
|
|
|
| 241 |
)
|
| 242 |
mode_opt = gr.Radio(
|
| 243 |
-
[_L("
|
|
|
|
|
|
|
| 244 |
)
|
| 245 |
tempo_opt = gr.Slider(
|
| 246 |
minimum=40,
|
|
|
|
| 52 |
audio = midi = pdf = xml = mxl = tunes = jpg = None
|
| 53 |
try:
|
| 54 |
emotion = "Q1"
|
| 55 |
+
if mode == _L("minor") and pitch_std == _L("High"):
|
| 56 |
emotion = "Q2"
|
| 57 |
|
| 58 |
+
elif mode == _L("minor") and pitch_std == _L("Low"):
|
| 59 |
emotion = "Q3"
|
| 60 |
|
| 61 |
elif mode == _L("Major") and pitch_std == _L("Low"):
|
|
|
|
| 158 |
with gr.Blocks() as demo:
|
| 159 |
with gr.Row():
|
| 160 |
with gr.Column():
|
| 161 |
+
with gr.Accordion(label=_L("Additional info & options"), open=False):
|
| 162 |
gr.Video(
|
| 163 |
"./demo.mp4" if EN_US else "./src/tutorial.mp4",
|
| 164 |
label=_L("Video demo"),
|
|
|
|
| 237 |
|
| 238 |
with gr.Tab(_L("By feature control")):
|
| 239 |
std_opt = gr.Radio(
|
| 240 |
+
[_L("Low"), _L("High")],
|
| 241 |
+
label=_L("Pitch SD"),
|
| 242 |
+
value=_L("High"),
|
| 243 |
)
|
| 244 |
mode_opt = gr.Radio(
|
| 245 |
+
[_L("minor"), _L("Major")],
|
| 246 |
+
label=_L("Mode"),
|
| 247 |
+
value=_L("Major"),
|
| 248 |
)
|
| 249 |
tempo_opt = gr.Slider(
|
| 250 |
minimum=40,
|
utils.py
CHANGED
|
@@ -55,7 +55,7 @@ EN2ZH = {
|
|
| 55 |
"Download MusicXML": "下载 MusicXML",
|
| 56 |
"Download PDF score": "下载 PDF 乐谱",
|
| 57 |
"By feature control": "通过特征控制生成",
|
| 58 |
-
"Additional info &
|
| 59 |
"Generate chords coming soon": "生成和声控制暂不可用",
|
| 60 |
"The emotion to which the current template belongs": "当前模板所属情感",
|
| 61 |
"Valence: reflects negative-positive levels of emotion": "愉悦度 反映情绪的 消极-积极 程度",
|
|
|
|
| 55 |
"Download MusicXML": "下载 MusicXML",
|
| 56 |
"Download PDF score": "下载 PDF 乐谱",
|
| 57 |
"By feature control": "通过特征控制生成",
|
| 58 |
+
"Additional info & options": "附加信息及选项",
|
| 59 |
"Generate chords coming soon": "生成和声控制暂不可用",
|
| 60 |
"The emotion to which the current template belongs": "当前模板所属情感",
|
| 61 |
"Valence: reflects negative-positive levels of emotion": "愉悦度 反映情绪的 消极-积极 程度",
|