PINTO0309 / OpenVINO-YoloV3

YoloV3/tiny-YoloV3+RaspberryPi3/Ubuntu LaptopPC+NCS/NCS2+USB Camera+Python+OpenVINO
https://qiita.com/PINTO
Apache License 2.0
538 stars 167 forks source link

Need help in converting the results into audio output #62

Open Manoj-Bhat97 opened 4 years ago

Manoj-Bhat97 commented 4 years ago

Hello @PINTO0309, this is not really an issue, your code works fine for me. I am running SingleStickSSDwithRealSense_OpenVINO_NCS2.py. And I want to convert the detected results and distance into audio output using gTTS for every class_id that has been detected. However, I have tried inserting the below code at line 104:

description = '{} is ahead in {} meteres away, proceed with caution'.format(class_id, round(meters,2))`
tts = gTTS(description, lang='en')
tts.save('tts.mp3')
tts = AudioSegment.from_mp3("tts.mp3")
subprocess.call(["ffplay", "-nodisp", "-autoexit", "tts.mp3"])

i.e., after label_text = LABELS[int(class_id)] + " (" + str(percentage) + "%)"+ " {:.2f}".format(meters) + " meters away" only to be encountered with TabError: inconsistent use of tabs and spaces in indentation Kindly help me with it. I am very new to coding. Thanks in advance.

PINTO0309 commented 4 years ago

Just replace all indents with spaces. Do not use "TAB". inconsistent use of tabs and spaces in indentation

Manoj-Bhat97 commented 4 years ago

Yes thank you @PINTO0309