yuuu-1017 commited on
Commit
438d30e
·
verified ·
1 Parent(s): ac427cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -43
app.py CHANGED
@@ -1,46 +1,19 @@
1
- def get_outfit(season, gender, occasion):
2
- result = f"\n你的選擇是:{season} / {gender} / {occasion}\n"
3
- result += "🎯 以下是你的穿搭建議:\n"
4
 
5
- if season == "夏季":
6
- if gender == "女生":
7
- if occasion == "約會":
8
- result += "- 上身:無袖雪紡上衣\n"
9
- result += "- 下身:高腰短裙\n"
10
- result += "- 鞋子:小白鞋 / 涼鞋\n"
11
- result += "- 配件:編織包、簡約飾品"
12
- elif occasion == "上班":
13
- result += "- 上身:短袖襯衫\n"
14
- result += "- 下身:西裝褲 / 寬褲\n"
15
- result += "- 鞋子:樂福鞋 / 穩勤鞋\n"
16
- result += "- 配件:手錶、公事包"
17
- elif occasion == "出遊":
18
- result += "- 上身:棉麻上衣\n"
19
- result += "- 下身:牛仔褲 / 休閒褲\n"
20
- result += "- 鞋子:運動鞋 / 涼鞋\n"
21
- result += "- 配件:太陽眼鏡、後背包"
22
 
23
- elif gender == "男生":
24
- if occasion == "約會":
25
- result += "- 上身:休閒短袖襯衫\n"
26
- result += "- 下身:卡其短褲\n"
27
- result += "- 鞋子:帆布鞋\n"
28
- result += "- 配件:運動錶"
29
- elif occasion == "上班":
30
- result += "- 上身:POLO 衫\n"
31
- result += "- 下身:西裝褲\n"
32
- result += "- 鞋子:皮鞋\n"
33
- result += "- 配件:公事包"
34
- elif occasion == "出遊":
35
- result += "- 上身:圖案T恤\n"
36
- result += "- 下身:棉短褲\n"
37
- result += "- 鞋子:運動鞋\n"
38
- result += "- 配件:棒球帽"
39
 
40
- elif season == "冬季":
41
- result += "🧣 冬季搭配還沒實作完成,敬請期待!"
42
-
43
- else:
44
- result += "⚠️ 無法識別的選項,請重新選擇。"
45
-
46
- return result
 
1
+ import gradio as gr
2
+ from python import get_outfit
 
3
 
4
+ def recommend_outfit(season, gender, occasion):
5
+ return get_outfit(season, gender, occasion)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
+ iface = gr.Interface(
8
+ fn=recommend_outfit,
9
+ inputs=[
10
+ gr.Dropdown(["夏季", "冬季"], label="季節"),
11
+ gr.Dropdown(["女生", "男生"], label="性別"),
12
+ gr.Dropdown(["約會", "上班", "出遊"], label="場合")
13
+ ],
14
+ outputs="text",
15
+ title="👗 穿搭小幫手 進階版",
16
+ description="根據你的季節、性別、場合,推薦適合的穿搭!"
17
+ )
 
 
 
 
 
18
 
19
+ iface.launch()