I'm trying to add audio output for Tensorflow object detection on the raspberry pi. For example, if it detects a person from the picamera, I'm trying to get the program to say "person". When I use the code below, I get the error message "TypeError: expected str(string), bytes or os". This is likely because I'm assigning the wrong value to speech. What is the right variable/value for the object label?

from subprocess import call 


speech = classes  
call(["espeak", speech)]
  • 1
    Not Pi specific. It seems to be a general Python question. – joan Dec 23 '19 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.