File size: 416 Bytes
0d65b5f
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def clasifica_imagen(inp):
  inp = inp.reshape((-1,224,224,3))
  inp = tf.keras.applications.mobilenet_v2.preprocess_input(inp)
  prediction = inception_net.predict(inp).flatten()
  confidences ={etiquetas[i]: float(prediction[i]) for i in range(1000)}
  return confidences

def audio_a_text(audio):
  text = trans(audio)['text']
  return text

def texto_a_sentimiento(text):
  return clasificador(text)[0]['label']