Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,11 +22,11 @@ def all_likelihood_plot(csv_file_name, tmpdir):
|
|
| 22 |
|
| 23 |
#平均値を求める
|
| 24 |
point_average = a.mean()
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 27 |
|
| 28 |
# カラーマップの設定
|
| 29 |
-
a.columns = parts
|
| 30 |
cmap = plt.get_cmap('rainbow')
|
| 31 |
# バイオリン図のプロット
|
| 32 |
sns.set(style="whitegrid",font="IPAexGothic")
|
|
@@ -49,8 +49,6 @@ def all_likelihood_plot(csv_file_name, tmpdir):
|
|
| 49 |
# 最大値を1に
|
| 50 |
plt.ylim(0, 1)
|
| 51 |
|
| 52 |
-
# fig.set_figwidth(10)
|
| 53 |
-
|
| 54 |
#ラベルがはみ出ないように
|
| 55 |
plt.tight_layout()
|
| 56 |
|
|
@@ -64,6 +62,11 @@ def main(csv_file):
|
|
| 64 |
return f"likelihood.png"
|
| 65 |
|
| 66 |
|
| 67 |
-
iface = gr.Interface(
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
#平均値を求める
|
| 24 |
point_average = a.mean()
|
| 25 |
+
|
| 26 |
+
# CSVから自動的に取得した付属肢名を使用
|
| 27 |
+
parts = columns.tolist()
|
| 28 |
|
| 29 |
# カラーマップの設定
|
|
|
|
| 30 |
cmap = plt.get_cmap('rainbow')
|
| 31 |
# バイオリン図のプロット
|
| 32 |
sns.set(style="whitegrid",font="IPAexGothic")
|
|
|
|
| 49 |
# 最大値を1に
|
| 50 |
plt.ylim(0, 1)
|
| 51 |
|
|
|
|
|
|
|
| 52 |
#ラベルがはみ出ないように
|
| 53 |
plt.tight_layout()
|
| 54 |
|
|
|
|
| 62 |
return f"likelihood.png"
|
| 63 |
|
| 64 |
|
| 65 |
+
iface = gr.Interface(
|
| 66 |
+
fn=main,
|
| 67 |
+
inputs="file",
|
| 68 |
+
outputs="image",
|
| 69 |
+
title="尤度のグラフを作成します。",
|
| 70 |
+
description="CSVファイルから自動的に付属肢を抽出してバイオリンプロットを作成します。"
|
| 71 |
+
)
|
| 72 |
+
iface.launch()
|