litagin commited on
Commit
6837d3c
ยท
1 Parent(s): 1d91aef
Files changed (2) hide show
  1. README.md +2 -2
  2. app.py +21 -11
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
- title: Galgame Dataset Stats
3
- emoji: ๐Ÿ˜ป
4
  colorFrom: red
5
  colorTo: yellow
6
  sdk: gradio
 
1
  ---
2
+ title: Galgame_Dataset Stats Viewer
3
+ emoji: ๐Ÿฅฐ๐Ÿ“Š
4
  colorFrom: red
5
  colorTo: yellow
6
  sdk: gradio
app.py CHANGED
@@ -12,20 +12,22 @@ df = df.round(2)
12
  df.columns = [
13
  "game_name",
14
  "speakers",
15
- "mono",
16
  "stereo",
17
  "error",
18
- "duration",
19
  "sr",
20
  "precision",
21
  "bitrate",
22
  "codec",
23
  "total_size_MB",
24
  ]
 
 
25
 
26
 
27
  def gallery_images(game_name):
28
- """ไธŽใˆใ‚‰ใ‚ŒใŸใ‚ฒใƒผใƒ ๅใซๅŸบใฅใ„ใฆ็”ปๅƒใฎใƒชใ‚นใƒˆใ‚’็”Ÿๆˆใ™ใ‚‹"""
29
  images = [
30
  f"https://huggingface.co/datasets/litagin/Galgame_Dataset_stats/resolve/main/specs/{game_name}/spec{i}.png"
31
  for i in range(1, 6)
@@ -40,17 +42,23 @@ def update_gallery(event: gr.SelectData):
40
 
41
 
42
  # ๅฟ…่ฆใชๅˆ—ใ ใ‘ใ‚’้ธๆŠž
43
- df_display = df[
44
- ["game_name", "speakers", "mono", "stereo", "duration", "bitrate", "sr"]
45
- ]
46
 
47
  md = """
48
  # Galgame_Dataset Stats Viewer
49
 
50
- - Viewer for stats of each game in [OOPPEENN/Galgame_Dataset](https://huggingface.co/datasets/OOPPEENN/Galgame_Dataset)
51
- - `bitrate`: bitrate in kbps
52
- - `sr`: sample rate in kHz
53
- - `duration`: total duration in hours
 
 
 
 
 
 
 
 
54
  """
55
 
56
  HEIGHT = 500
@@ -64,11 +72,13 @@ CSS = f"""
64
 
65
  with gr.Blocks(css=CSS) as app:
66
  gr.Markdown(md)
 
 
67
  with gr.Row():
68
  with gr.Column():
69
  table = gr.DataFrame(
70
  df_display,
71
- column_widths=[200, 100, 100, 100, 100, 100, 100],
72
  wrap=True,
73
  elem_classes="qa-pairs",
74
  )
 
12
  df.columns = [
13
  "game_name",
14
  "speakers",
15
+ "files",
16
  "stereo",
17
  "error",
18
+ "dur",
19
  "sr",
20
  "precision",
21
  "bitrate",
22
  "codec",
23
  "total_size_MB",
24
  ]
25
+ # Replace _ with space in game_name
26
+ df["game_name"] = df["game_name"].str.replace("_", " ", regex=False)
27
 
28
 
29
  def gallery_images(game_name):
30
+ game_name = game_name.replace(" ", "_")
31
  images = [
32
  f"https://huggingface.co/datasets/litagin/Galgame_Dataset_stats/resolve/main/specs/{game_name}/spec{i}.png"
33
  for i in range(1, 6)
 
42
 
43
 
44
  # ๅฟ…่ฆใชๅˆ—ใ ใ‘ใ‚’้ธๆŠž
45
+ df_display = df[["game_name", "speakers", "files", "dur", "bitrate", "sr"]]
 
 
46
 
47
  md = """
48
  # Galgame_Dataset Stats Viewer
49
 
50
+ # Galgame_Dataset Stats Viewer
51
+
52
+ A viewer displaying statistics and spectrogram images (from 5 randomly selected audio files) for each game in the [OOPPEENN/Galgame_Dataset](https://huggingface.co/datasets/OOPPEENN/Galgame_Dataset). For raw data, visit [litagin/Galgame_Dataset_stats](https://huggingface.co/datasets/litagin/Galgame_Dataset_stats).
53
+
54
+ """
55
+
56
+ details = """
57
+ - `speakers`: Number of unique speakers.
58
+ - `files`: Number of *mono* audio files.
59
+ - `dur`: Total duration in hours.
60
+ - `bitrate`: Average bitrate in kbps.
61
+ - `sr`: Average sample rate in kHz.
62
  """
63
 
64
  HEIGHT = 500
 
72
 
73
  with gr.Blocks(css=CSS) as app:
74
  gr.Markdown(md)
75
+ with gr.Accordion(open=False, label="Details"):
76
+ gr.Markdown(details)
77
  with gr.Row():
78
  with gr.Column():
79
  table = gr.DataFrame(
80
  df_display,
81
+ column_widths=[200, 100, 100, 100, 100, 100],
82
  wrap=True,
83
  elem_classes="qa-pairs",
84
  )