diff --git a/Image to Speech/4.jpg b/Image to Speech/4.jpg new file mode 100644 index 0000000000..5f6e50016e Binary files /dev/null and b/Image to Speech/4.jpg differ diff --git a/Image to Speech/image_to_text.py b/Image to Speech/image_to_text.py new file mode 100644 index 0000000000..daa575dfc4 --- /dev/null +++ b/Image to Speech/image_to_text.py @@ -0,0 +1,20 @@ +import pytesseract +from PIL import Image +from gtts import gTTS +import os + +pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe' + +img = Image.open('4.jpg') + +value = pytesseract.image_to_string(img) + +print(value) + +mytext = value +language = 'en' + +output = gTTS(text=mytext, lang=language, slow=True) +output.save('output.mp3') + +os.system("start output.mp3") \ No newline at end of file diff --git a/Image to Speech/main.py b/Image to Speech/main.py new file mode 100644 index 0000000000..51f2facf78 --- /dev/null +++ b/Image to Speech/main.py @@ -0,0 +1,10 @@ +import pytesseract +from PIL import Image + +pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe' + +img = Image.open('4.jpg') + +text= pytesseract.image_to_string(img) + +print(text) diff --git a/Image to Speech/output.mp3 b/Image to Speech/output.mp3 new file mode 100644 index 0000000000..6a278b7b4f Binary files /dev/null and b/Image to Speech/output.mp3 differ