Ahsen Khaliq commited on
Commit
7c46089
1 Parent(s): e920c88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -5,6 +5,7 @@ from moviepy.editor import *
5
  import cv2
6
  import librosa
7
 
 
8
  def get_optimal_font_scale(text, width):
9
  for scale in reversed(range(0, 60, 1)):
10
  textSize = cv2.getTextSize(text, fontFace=cv2.FONT_HERSHEY_DUPLEX, fontScale=scale/10, thickness=1)
@@ -16,9 +17,7 @@ def get_optimal_font_scale(text, width):
16
 
17
  processor = Wav2Vec2Processor.from_pretrained("facebook/hubert-xlarge-ls960-ft")
18
  model = HubertForCTC.from_pretrained("facebook/hubert-xlarge-ls960-ft")
19
- #def map_to_array(file):
20
- #speech, _ = sf.read(file)
21
- #return speech
22
  def inference(audio, image):
23
  y, sr = librosa.load(audio.name,sr=16000)
24
  input_values = processor(y, return_tensors="pt").input_values # Batch size 1
 
5
  import cv2
6
  import librosa
7
 
8
+
9
  def get_optimal_font_scale(text, width):
10
  for scale in reversed(range(0, 60, 1)):
11
  textSize = cv2.getTextSize(text, fontFace=cv2.FONT_HERSHEY_DUPLEX, fontScale=scale/10, thickness=1)
 
17
 
18
  processor = Wav2Vec2Processor.from_pretrained("facebook/hubert-xlarge-ls960-ft")
19
  model = HubertForCTC.from_pretrained("facebook/hubert-xlarge-ls960-ft")
20
+
 
 
21
  def inference(audio, image):
22
  y, sr = librosa.load(audio.name,sr=16000)
23
  input_values = processor(y, return_tensors="pt").input_values # Batch size 1