def audio_a_text(audio): | |
text = trans(audio)["text"] | |
return text | |
def texto_a_sentimiento(text): | |
return clasificador(text)[0]["label"] | |
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 | |