Flux9665 commited on
Commit
d3d5ad6
β€’
1 Parent(s): 7ab2a7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -11,7 +11,7 @@ def plot_scalar_on_scale(scalar_value, distance_type):
11
  scalar_value = np.clip(scalar_value, 0.0, 1.0)
12
 
13
  # Create a figure and axis
14
- fig, ax = plt.subplots(figsize=(12, 4))
15
 
16
  # Create a horizontal gradient (from close to distant)
17
  gradient = np.linspace(0, 1, 256).reshape(1, -1)
@@ -21,13 +21,13 @@ def plot_scalar_on_scale(scalar_value, distance_type):
21
  ax.axvline(x=scalar_value, color='white', lw=5)
22
 
23
  # Add a dot at the scalar position
24
- ax.plot(scalar_value, 0.5, 'o', color='white', markersize=32)
25
 
26
- ax.text(scalar_value, 0.5, f'{scalar_value:.2f}', color='black', ha='center', va='center', fontsize=10, fontweight='bold')
27
 
28
  # Add labels rotated 90 degrees on the sides
29
- ax.text(-0.05, 0.5, 'Close', ha='center', va='center', fontsize=12, rotation=90)
30
- ax.text(1.05, 0.5, 'Distant', ha='center', va='center', fontsize=12, rotation=270)
31
 
32
  # Customize the axis
33
  ax.set_xticks([]) # Remove x-axis ticks
@@ -159,5 +159,6 @@ iface = gr.Interface(fn=m.measure,
159
  gr.Plot(label="")],
160
  description="<br><br> This demo allows you to view the distance between two languages from the ISO 639-3 list according to several distance measurement functions. "
161
  "For more information, check out our paper: https://arxiv.org/abs/2406.06403 and our text-to-speech tool, in which we make use of "
162
- "this technique: https://github.com/DigitalPhonetics/IMS-Toucan <br><br>")
 
163
  iface.launch()
 
11
  scalar_value = np.clip(scalar_value, 0.0, 1.0)
12
 
13
  # Create a figure and axis
14
+ fig, ax = plt.subplots(figsize=(10, 3))
15
 
16
  # Create a horizontal gradient (from close to distant)
17
  gradient = np.linspace(0, 1, 256).reshape(1, -1)
 
21
  ax.axvline(x=scalar_value, color='white', lw=5)
22
 
23
  # Add a dot at the scalar position
24
+ ax.plot(scalar_value, 0.5, 'o', color='white', markersize=42)
25
 
26
+ ax.text(scalar_value, 0.5, f'{scalar_value:.2f}', color='black', ha='center', va='center', fontsize=16, fontweight='bold')
27
 
28
  # Add labels rotated 90 degrees on the sides
29
+ ax.text(-0.03, 0.5, 'Close', ha='center', va='center', fontsize=18, rotation=90)
30
+ ax.text(1.03, 0.5, 'Distant', ha='center', va='center', fontsize=18, rotation=270)
31
 
32
  # Customize the axis
33
  ax.set_xticks([]) # Remove x-axis ticks
 
159
  gr.Plot(label="")],
160
  description="<br><br> This demo allows you to view the distance between two languages from the ISO 639-3 list according to several distance measurement functions. "
161
  "For more information, check out our paper: https://arxiv.org/abs/2406.06403 and our text-to-speech tool, in which we make use of "
162
+ "this technique: https://github.com/DigitalPhonetics/IMS-Toucan <br><br>",
163
+ fill_width=True)
164
  iface.launch()