Skip to content

Instantly share code, notes, and snippets.

from tensorflow.keras.applications import ResNet50
img_height, img_width = 250, 250 # size of images
base_model = ResNet50(weights='imagenet',
include_top = False,
# without dense part of the network
input_shape = (img_height, img_width, 3))
import speech_recognition as sr
audio_file = sr.AudioFile('russian_audio.wav')
r = sr.Recognizer()
with audio_file as af:
audio = r.record(af)
text = r.recognize_sphinx(audio, language='ru-RU')
print(f"Sphinx thinks you said:\n {text}")
import speech_recognition as sr
italian_audio = sr.AudioFile('italian_audio.wav')
r = sr.Recognizer()
with italian_audio as af:
audio = r.record(af)
text = r.recognize_google(audio, language='it-IT')
print(f"Google thinks you said:\n {text}")