Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from moviepy.editor import *
|
|
5 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
6 |
|
7 |
token = os.environ.get('HF_TOKEN')
|
8 |
-
caption = gr.Blocks.load(name="spaces/
|
9 |
audio_gen = gr.Blocks.load(name="spaces/fffiloni/audioldm-text-to-audio-generation-clone", api_key=token)
|
10 |
|
11 |
ph_message="If you're not happy with sound result, you can manually describe the scene depicted in your image :)"
|
@@ -16,8 +16,8 @@ def input_changes(input_img):
|
|
16 |
return manual_cap.update(value="",placeholder=ph_message), caption_output.update(value=None), sound_output.update(value=None)
|
17 |
else:
|
18 |
cap = caption(input_img, fn_index=0)
|
19 |
-
print("
|
20 |
-
ph_update = "
|
21 |
|
22 |
return manual_cap.update(value="",placeholder=f"{ph_update}{ph_message}"), caption_output.update(value=cap), sound_output.update(value=None)
|
23 |
|
@@ -27,8 +27,8 @@ def infer(image_input, manual_caption, duration_in, seed, caption_output):
|
|
27 |
if manual_caption == "":
|
28 |
cap = caption_output
|
29 |
#cap = caption(image_input, fn_index=0)
|
30 |
-
#print("
|
31 |
-
#ph_update = "
|
32 |
else:
|
33 |
cap = manual_caption
|
34 |
print("manual caption: " + cap)
|
@@ -54,7 +54,7 @@ title = """
|
|
54 |
</h1>
|
55 |
</div>
|
56 |
<p style="margin-bottom: 10px; font-size: 94%">
|
57 |
-
Convert an image to a corresponding sound effect generated through
|
58 |
</p>
|
59 |
</div>
|
60 |
"""
|
|
|
5 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
6 |
|
7 |
token = os.environ.get('HF_TOKEN')
|
8 |
+
caption = gr.Blocks.load(name="spaces/laion/CoCa")
|
9 |
audio_gen = gr.Blocks.load(name="spaces/fffiloni/audioldm-text-to-audio-generation-clone", api_key=token)
|
10 |
|
11 |
ph_message="If you're not happy with sound result, you can manually describe the scene depicted in your image :)"
|
|
|
16 |
return manual_cap.update(value="",placeholder=ph_message), caption_output.update(value=None), sound_output.update(value=None)
|
17 |
else:
|
18 |
cap = caption(input_img, fn_index=0)
|
19 |
+
print("CoCa caption: '" + cap + "' β’ ")
|
20 |
+
ph_update = "CoCa caption: '" + cap + "' β’ "
|
21 |
|
22 |
return manual_cap.update(value="",placeholder=f"{ph_update}{ph_message}"), caption_output.update(value=cap), sound_output.update(value=None)
|
23 |
|
|
|
27 |
if manual_caption == "":
|
28 |
cap = caption_output
|
29 |
#cap = caption(image_input, fn_index=0)
|
30 |
+
#print("CoCa caption: '" + cap + "' β’ ")
|
31 |
+
#ph_update = "CoCa caption: '" + cap + "' β’ "
|
32 |
else:
|
33 |
cap = manual_caption
|
34 |
print("manual caption: " + cap)
|
|
|
54 |
</h1>
|
55 |
</div>
|
56 |
<p style="margin-bottom: 10px; font-size: 94%">
|
57 |
+
Convert an image to a corresponding sound effect generated through CoCa Image Captioning & AudioLDM
|
58 |
</p>
|
59 |
</div>
|
60 |
"""
|