how to concat soundscapes
Browse files- README.md +1 -3
- api.py +7 -5
- landscape2soundscape.py +17 -17
- uc_spk_Landscape2Soundscape_Masterpieces_pics/01_Schick_AII840_001.txt +1 -1
README.md
CHANGED
@@ -27,7 +27,7 @@ tags:
|
|
27 |
|
28 |
## Available Voices
|
29 |
|
30 |
-
<a href="https://audeering.github.io/shift/">Listen
|
31 |
|
32 |
## Flask API
|
33 |
|
@@ -46,8 +46,6 @@ Flask
|
|
46 |
CUDA_DEVICE_ORDER=PCI_BUS_ID HF_HOME=./hf_home CUDA_VISIBLE_DEVICES=2 python api.py
|
47 |
```
|
48 |
|
49 |
-
## Inference
|
50 |
-
|
51 |
The following need `api.py` to be running on a `tmux session`.
|
52 |
|
53 |
## Text 2 Speech
|
|
|
27 |
|
28 |
## Available Voices
|
29 |
|
30 |
+
<a href="https://audeering.github.io/shift/">Listen to available voices!</a>
|
31 |
|
32 |
## Flask API
|
33 |
|
|
|
46 |
CUDA_DEVICE_ORDER=PCI_BUS_ID HF_HOME=./hf_home CUDA_VISIBLE_DEVICES=2 python api.py
|
47 |
```
|
48 |
|
|
|
|
|
49 |
The following need `api.py` to be running on a `tmux session`.
|
50 |
|
51 |
## Text 2 Speech
|
api.py
CHANGED
@@ -29,14 +29,15 @@ Path(CACHE_DIR).mkdir(parents=True, exist_ok=True)
|
|
29 |
# ssh-add ~/.ssh/id_ed25519_github2024
|
30 |
#
|
31 |
# git remote set-url origin git@github.com:audeering/shift
|
32 |
-
# ==
|
33 |
|
34 |
def _shift(x):
|
35 |
n = x.shape[0]
|
36 |
i = np.random.randint(.24 * n, max(1, .74 * n)) # high should be above >= 0
|
37 |
x = np.roll(x, i)
|
38 |
-
# fade_in = .5
|
39 |
-
|
|
|
40 |
return x
|
41 |
|
42 |
def overlay(x, sound_background=None):
|
@@ -47,11 +48,12 @@ def overlay(x, sound_background=None):
|
|
47 |
n_repeat = len_speech // len(sound_background) + 1
|
48 |
replica = [sound_background] * n_repeat
|
49 |
replica = [_shift(_) for _ in replica]
|
|
|
50 |
sound_background = np.concatenate(replica)
|
51 |
|
52 |
|
53 |
-
print(f'\
|
54 |
-
x = .
|
55 |
return x
|
56 |
|
57 |
def tts_multi_sentence(precomputed_style_vector=None,
|
|
|
29 |
# ssh-add ~/.ssh/id_ed25519_github2024
|
30 |
#
|
31 |
# git remote set-url origin git@github.com:audeering/shift
|
32 |
+
# ==
|
33 |
|
34 |
def _shift(x):
|
35 |
n = x.shape[0]
|
36 |
i = np.random.randint(.24 * n, max(1, .74 * n)) # high should be above >= 0
|
37 |
x = np.roll(x, i)
|
38 |
+
# fade_in = .5 * np.tanh(-4*(np.linspace(-10, 10, n) - 9.4))
|
39 |
+
x[0] = .5 * x[1]
|
40 |
+
x[-1] = .5 * x[-2] # smooth woof
|
41 |
return x
|
42 |
|
43 |
def overlay(x, sound_background=None):
|
|
|
48 |
n_repeat = len_speech // len(sound_background) + 1
|
49 |
replica = [sound_background] * n_repeat
|
50 |
replica = [_shift(_) for _ in replica]
|
51 |
+
# The patch makes a woof assure smooth start to multiply the patch by a
|
52 |
sound_background = np.concatenate(replica)
|
53 |
|
54 |
|
55 |
+
print(f'\n====SOUND BACKGROUND SHAPE\n{sound_background.shape=}{np.abs(sound_background.max())=}\n{x.shape=}\n- - - -')
|
56 |
+
x = .9 * x + .1 * sound_background[:len_speech]
|
57 |
return x
|
58 |
|
59 |
def tts_multi_sentence(precomputed_style_vector=None,
|
landscape2soundscape.py
CHANGED
@@ -46,7 +46,7 @@ DESCRIPTIONS = [
|
|
46 |
'01_Schick_AII840_001.jpg', # image
|
47 |
'01_Schick_AII840_001.txt', # text
|
48 |
'Statue in shire hill on autumn beach.', # audiocraft
|
49 |
-
'
|
50 |
'en_US/m-ailabs_low#mary_ann',
|
51 |
],
|
52 |
# 2
|
@@ -54,23 +54,23 @@ DESCRIPTIONS = [
|
|
54 |
'02_Constable_AI555_001.jpg',
|
55 |
'02_Constable_AI555_001.txt',
|
56 |
'Meadows country farm village in sight',
|
57 |
-
'
|
58 |
-
'en_US/m-ailabs_low#
|
59 |
],
|
60 |
# 3
|
61 |
[
|
62 |
'03_Schinkel_WS200-002.jpg',
|
63 |
'03_Schinkel_WS200-002.txt',
|
64 |
'Arriving at the shore on horses',
|
65 |
-
'
|
66 |
-
'en_US/
|
67 |
],
|
68 |
#
|
69 |
[
|
70 |
'04_Friedrich_FV317_001.jpg',
|
71 |
'04_Friedrich_FV317_001.txt',
|
72 |
'Land steppes',
|
73 |
-
'
|
74 |
'en_US/m-ailabs_low#mary_ann',
|
75 |
],
|
76 |
#
|
@@ -78,15 +78,15 @@ DESCRIPTIONS = [
|
|
78 |
'05_Blechen_FV40_001.jpg',
|
79 |
'05_Blechen_FV40_001.txt',
|
80 |
'fjords',
|
81 |
-
'
|
82 |
'en_US/m-ailabs_low#mary_ann',
|
83 |
],
|
84 |
# 6
|
85 |
[
|
86 |
'06_Menzel_AI900_001.jpg',
|
87 |
'06_Menzel_AI900_001.txt',
|
88 |
-
'Olive
|
89 |
-
'
|
90 |
'en_US/m-ailabs_low#mary_ann',
|
91 |
],
|
92 |
# 7
|
@@ -94,7 +94,7 @@ DESCRIPTIONS = [
|
|
94 |
'07_Courbet_AI967_001.jpg',
|
95 |
'07_Courbet_AI967_001.txt',
|
96 |
'Storm at the strand of waves Tsunami',
|
97 |
-
'
|
98 |
'en_US/m-ailabs_low#mary_ann',
|
99 |
],
|
100 |
# 8
|
@@ -102,7 +102,7 @@ DESCRIPTIONS = [
|
|
102 |
'08_Monet_AI1013_001.jpg',
|
103 |
'08_Monet_AI1013_001.txt',
|
104 |
'Mai flowers blossom picnic',
|
105 |
-
'
|
106 |
'en_US/m-ailabs_low#mary_ann',
|
107 |
],
|
108 |
# 9
|
@@ -110,7 +110,7 @@ DESCRIPTIONS = [
|
|
110 |
'09_Blechen_AII823_001.jpg',
|
111 |
'09_Blechen_AII823_001.txt',
|
112 |
'Cascade in Africa',
|
113 |
-
'
|
114 |
'en_US/m-ailabs_low#mary_ann',
|
115 |
],
|
116 |
# 10
|
@@ -118,7 +118,7 @@ DESCRIPTIONS = [
|
|
118 |
'10_Boecklin_967648_NG2-80_001_rsz.jpg',
|
119 |
'10_Boecklin_967648_NG2-80_001.txt',
|
120 |
'Hades ades at it sisland',
|
121 |
-
'
|
122 |
'en_US/m-ailabs_low#mary_ann',
|
123 |
],
|
124 |
# 11
|
@@ -126,7 +126,7 @@ DESCRIPTIONS = [
|
|
126 |
'11_Liebermann_NG4-94_001.jpg',
|
127 |
'11_Liebermann_NG4-94_001.txt',
|
128 |
'Tavern at the waterfront',
|
129 |
-
'
|
130 |
'en_US/m-ailabs_low#mary_ann',
|
131 |
],
|
132 |
# 12
|
@@ -134,7 +134,7 @@ DESCRIPTIONS = [
|
|
134 |
'12_Slevogt_AII1022_001.jpg',
|
135 |
'12_Slevogt_AII1022_001.txt',
|
136 |
'toy sailing yachts pool',
|
137 |
-
'
|
138 |
'en_US/m-ailabs_low#mary_ann',
|
139 |
],
|
140 |
]
|
@@ -159,7 +159,7 @@ for img, text, scene, title, voice in DESCRIPTIONS[:20]:
|
|
159 |
fram = np.zeros((94, im.shape[1], 3), dtype=np.uint8)
|
160 |
h, w, _ = fram.shape
|
161 |
font = cv2.FONT_HERSHEY_SIMPLEX
|
162 |
-
bottomLeftCornerOfText = (240, 74) # w,h
|
163 |
fontScale = 2
|
164 |
fontColor = (255, 255, 255)
|
165 |
thickness = 4
|
@@ -171,7 +171,7 @@ for img, text, scene, title, voice in DESCRIPTIONS[:20]:
|
|
171 |
fontColor,
|
172 |
thickness,
|
173 |
lineType)
|
174 |
-
offset_h =
|
175 |
im[offset_h:h+offset_h, :w, :] = (.4 * im[offset_h:h+offset_h, :w, :] + .6 * fram).astype(np.uint8)
|
176 |
|
177 |
cv2.imwrite('_tmp_banner.png', im)
|
|
|
46 |
'01_Schick_AII840_001.jpg', # image
|
47 |
'01_Schick_AII840_001.txt', # text
|
48 |
'Statue in shire hill on autumn beach.', # audiocraft
|
49 |
+
'G. Schick, Bildnis der Heinrike Dannecker, 1802', # cv2 puttext title
|
50 |
'en_US/m-ailabs_low#mary_ann',
|
51 |
],
|
52 |
# 2
|
|
|
54 |
'02_Constable_AI555_001.jpg',
|
55 |
'02_Constable_AI555_001.txt',
|
56 |
'Meadows country farm village in sight',
|
57 |
+
'J. Constable, Dorf An Dem Flusse Stour, 1804',
|
58 |
+
'en_US/m-ailabs_low#elliot_miller',
|
59 |
],
|
60 |
# 3
|
61 |
[
|
62 |
'03_Schinkel_WS200-002.jpg',
|
63 |
'03_Schinkel_WS200-002.txt',
|
64 |
'Arriving at the shore on horses',
|
65 |
+
'K. F. Schinkel, Gotische Kirche Auf Einem Felsen Am Meer, 1815',
|
66 |
+
'en_US/hifi-tts_low#6097',
|
67 |
],
|
68 |
#
|
69 |
[
|
70 |
'04_Friedrich_FV317_001.jpg',
|
71 |
'04_Friedrich_FV317_001.txt',
|
72 |
'Land steppes',
|
73 |
+
'C. D. Friedrich, Der Watzmann, 1824',
|
74 |
'en_US/m-ailabs_low#mary_ann',
|
75 |
],
|
76 |
#
|
|
|
78 |
'05_Blechen_FV40_001.jpg',
|
79 |
'05_Blechen_FV40_001.txt',
|
80 |
'fjords',
|
81 |
+
'C. Blechen, Unwetter In Der Romischen Campagna, 1829',
|
82 |
'en_US/m-ailabs_low#mary_ann',
|
83 |
],
|
84 |
# 6
|
85 |
[
|
86 |
'06_Menzel_AI900_001.jpg',
|
87 |
'06_Menzel_AI900_001.txt',
|
88 |
+
'Olive Seville',
|
89 |
+
'A. Menzel, Bauplatz mit Weiden, 1846',
|
90 |
'en_US/m-ailabs_low#mary_ann',
|
91 |
],
|
92 |
# 7
|
|
|
94 |
'07_Courbet_AI967_001.jpg',
|
95 |
'07_Courbet_AI967_001.txt',
|
96 |
'Storm at the strand of waves Tsunami',
|
97 |
+
'G. Courbet, Die Welle, 1870',
|
98 |
'en_US/m-ailabs_low#mary_ann',
|
99 |
],
|
100 |
# 8
|
|
|
102 |
'08_Monet_AI1013_001.jpg',
|
103 |
'08_Monet_AI1013_001.txt',
|
104 |
'Mai flowers blossom picnic',
|
105 |
+
'C. Monet, Sommertag, 1874',
|
106 |
'en_US/m-ailabs_low#mary_ann',
|
107 |
],
|
108 |
# 9
|
|
|
110 |
'09_Blechen_AII823_001.jpg',
|
111 |
'09_Blechen_AII823_001.txt',
|
112 |
'Cascade in Africa',
|
113 |
+
'C. Blechen, Wasserfälle Bei Tivoli, 1832',
|
114 |
'en_US/m-ailabs_low#mary_ann',
|
115 |
],
|
116 |
# 10
|
|
|
118 |
'10_Boecklin_967648_NG2-80_001_rsz.jpg',
|
119 |
'10_Boecklin_967648_NG2-80_001.txt',
|
120 |
'Hades ades at it sisland',
|
121 |
+
'A. Böcklin, Toteninsel, 1883',
|
122 |
'en_US/m-ailabs_low#mary_ann',
|
123 |
],
|
124 |
# 11
|
|
|
126 |
'11_Liebermann_NG4-94_001.jpg',
|
127 |
'11_Liebermann_NG4-94_001.txt',
|
128 |
'Tavern at the waterfront',
|
129 |
+
'M. Tiebermann, Gartenlokal An Der Havel. Nikolskoe, 1916',
|
130 |
'en_US/m-ailabs_low#mary_ann',
|
131 |
],
|
132 |
# 12
|
|
|
134 |
'12_Slevogt_AII1022_001.jpg',
|
135 |
'12_Slevogt_AII1022_001.txt',
|
136 |
'toy sailing yachts pool',
|
137 |
+
'M. Slevogt, Segelboote Auf Der Alster Am Abend, 1905',
|
138 |
'en_US/m-ailabs_low#mary_ann',
|
139 |
],
|
140 |
]
|
|
|
159 |
fram = np.zeros((94, im.shape[1], 3), dtype=np.uint8)
|
160 |
h, w, _ = fram.shape
|
161 |
font = cv2.FONT_HERSHEY_SIMPLEX
|
162 |
+
bottomLeftCornerOfText = (4, 74) # OFFSET IN BANNER (240, 74) # w,h
|
163 |
fontScale = 2
|
164 |
fontColor = (255, 255, 255)
|
165 |
thickness = 4
|
|
|
171 |
fontColor,
|
172 |
thickness,
|
173 |
lineType)
|
174 |
+
offset_h = 24
|
175 |
im[offset_h:h+offset_h, :w, :] = (.4 * im[offset_h:h+offset_h, :w, :] + .6 * fram).astype(np.uint8)
|
176 |
|
177 |
cv2.imwrite('_tmp_banner.png', im)
|
uc_spk_Landscape2Soundscape_Masterpieces_pics/01_Schick_AII840_001.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
After studying for four years with the legendary Parisian painter Jacques-Louis David, Christian Gottlieb
|
|
|
1 |
+
After studying for four years with the legendary Parisian painter Jacques-Louis David, Christian Gottlieb Shic returned to Stuttgart in 1802. That year he began painting the portrait of Heinrike Dannecker the wife of his close friend and mentor Johannheinrich Dannecker. The home of the Danneckers known as the Danneckeray become a living hub for art lovers filled with ancient sculpture replicas. Schic portrait of Heinrike wasn’t any portrait as her relaxed pose, appalled to a clear confidenence of gaze reflects a new sense of freedom for the woman, one that arose in the wake of the French Revolution. It’s no accident that Heinrike’s outfit subtly nods to the colors of the French flag red, white, and blue. And the bouquet she holds, with bellflowers, roses, buttercups, and clover, stands out vividly against her deep blue dress, hinting at an effortless beauty. Lady Heinrike sits on a stone reminiscent of ancient pillars, her figure extending elegantly beyond the horizon. Behind her, the landscape ravels horizons and mountain ranges down to a tranquil river valley Interestingly, an unfinished version of this portrait—abandoned and trimmed by Schick himself—can still be found in the Staatsgalerie Stuttgart.
|