ryo2 commited on
Commit
80d364a
·
verified ·
1 Parent(s): 3d727da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -22,11 +22,11 @@ def all_likelihood_plot(csv_file_name, tmpdir):
22
 
23
  #平均値を求める
24
  point_average = a.mean()
25
- parts = ["指節1", "指節2", "指節3", "指節4", "指節5", "指節6", "指節7", "指節8", "指節9",
26
- "指節10", "指節11", "指節12", "指節13", "指節14", "触角(左)", "触角(右)", "頭部", "腹尾節"]
 
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(fn=main, inputs="file",
68
- outputs="image", title="尤度のグラフを作成します。")
69
- iface.launch()
 
 
 
 
 
 
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()