fffiloni commited on
Commit
0f097d0
β€’
1 Parent(s): dc8bd12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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/SRDdev/Image-Caption")
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("gpt2 caption: '" + cap + "' β€’ ")
20
- ph_update = "gpt2 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,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("gpt2 caption: '" + cap + "' β€’ ")
31
- #ph_update = "gpt2 caption: '" + cap + "' β€’ "
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 GPT2 Image Captioning & AudioLDM
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
  """