|
| 1 | +import os |
1 | 2 | import json |
2 | 3 |
|
3 | 4 | import numpy as np |
@@ -40,9 +41,9 @@ def fn( |
40 | 41 | }, # Label |
41 | 42 | (audio1[0], np.flipud(audio1[1])) |
42 | 43 | if audio1 is not None |
43 | | - else "files/cantina.wav", # Audio |
44 | | - np.flipud(im1) if im1 is not None else "files/cheetah1.jpg", # Image |
45 | | - video if video is not None else "files/world.mp4", # Video |
| 44 | + else os.path.join(os.path.dirname(__file__),"files/cantina.wav"), # Audio |
| 45 | + np.flipud(im1) if im1 is not None else os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg"), # Image |
| 46 | + video if video is not None else os.path.join(os.path.dirname(__file__),"files/world.mp4"), # Video |
46 | 47 | [ |
47 | 48 | ("The", "art"), |
48 | 49 | ("quick brown", "adj"), |
@@ -72,11 +73,11 @@ def fn( |
72 | 73 | "<button style='background-color: red'>Click Me: " |
73 | 74 | + radio |
74 | 75 | + "</button>", # HTML |
75 | | - "files/titanic.csv", |
| 76 | + os.path.join(os.path.dirname(__file__),"files/titanic.csv"), |
76 | 77 | df1, # Dataframe |
77 | 78 | np.random.randint(0, 10, (4, 4)), # Dataframe |
78 | 79 | [ |
79 | | - im for im in [im1, im2, im3, im4, "files/cheetah1.jpg"] if im is not None |
| 80 | + im for im in [im1, im2, im3, im4, os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg")] if im is not None |
80 | 81 | ], # Carousel |
81 | 82 | df2, # Timeseries |
82 | 83 | ) |
@@ -136,16 +137,16 @@ def fn( |
136 | 137 | ["foo", "baz"], |
137 | 138 | "baz", |
138 | 139 | "bar", |
139 | | - "files/cheetah1.jpg", |
140 | | - "files/cheetah1.jpg", |
141 | | - "files/cheetah1.jpg", |
142 | | - "files/cheetah1.jpg", |
143 | | - "files/world.mp4", |
144 | | - "files/cantina.wav", |
145 | | - "files/cantina.wav", |
146 | | - "files/titanic.csv", |
| 140 | + os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg"), |
| 141 | + os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg"), |
| 142 | + os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg"), |
| 143 | + os.path.join(os.path.dirname(__file__),"files/cheetah1.jpg"), |
| 144 | + os.path.join(os.path.dirname(__file__),"files/world.mp4"), |
| 145 | + os.path.join(os.path.dirname(__file__),"files/cantina.wav"), |
| 146 | + os.path.join(os.path.dirname(__file__),"files/cantina.wav"), |
| 147 | + os.path.join(os.path.dirname(__file__),"files/titanic.csv"), |
147 | 148 | [[1, 2, 3], [3, 4, 5]], |
148 | | - "files/time.csv", |
| 149 | + os.path.join(os.path.dirname(__file__),"files/time.csv"), |
149 | 150 | ] |
150 | 151 | ] |
151 | 152 | * 3, |
|
0 commit comments