How to add Voice capability during inference in SSD Model


Hope you all are fine.

I have trained the SSD model using my own dataset for object detection.

I want to ask how to add voice capability like when it detects the object speaker should say the label of that object during inference.

Currently the command for inference in bash shell I am using for the Inference is their any argument to add also:

detectnet --model=models/dir/ssd-mobilenet.onnx --labels=models/dir/labels.txt --input-blob=input_0 --output-cvg=scores --output-bbox=boxes /dev/video0


You can find several tutorial from our users.
For example:


I am using docker and this tutorial is outdated.

Should I edit this file (
in the docker to c++ text to speech library or can I use some kind of python library of Pyttsx3 add into the correct file of the detect net as I am unable to find the required file.

I have tried to edit the jetson-inference-python-examples by adding pysttx3, but the model is not found:

I have to submit my project till 15 June nay help would be appreciable as it’s my FYP

thank you

Hi @saifurrehman4114, if you are using pyttsx3, you would want to edit since pyttsx3 is also a Python library. If you are using the jetson-inference container, what you can do is make a copy of with your modifications, and then mount it into the container. This way you can more easily edit it:

# run this outside of container
$ mkdir ~/my_project
$ cp /path/to/jetson-inference/python/examples/ ~/my_project/

# make edits to ~/my_project/

# run the container and mount in my_project
$ cd /path/to/jetson-inference
$ docker/ -v ~/my_project:/my_project

Then from inside the container, you should be able to find your source file under /my_project

# run from inside the container
$ ls /my_project
$ python3 /my_project/

Did you install the pyttsx3 in the container first?

$ pip3 install pyttsx3

Hi @dusty_nv have installed pyttsx3 then in the my_project folder I made a python name in which I wrote a code related to that it works properly.


import pyttsx3
engine = pyttsx3.init()
engine.say(“I will speak this text”)

But this error show up.

And also in the detect net file

I will return the objects detected as a list in the

After resolving pyttsx3

I can add in line 70 engine.say(detection) it will speak the name of the objects detected from the class or labels.txt names we have added.

Thanks alot

Sorry I interpreted your comment to mean that you had already fixed the problem - here is the solution:

apt-get update && apt-get install espeak
pip3 install pyttsx3
1 Like

Thanks, it’s running. My suggestion is to add this in jetson inference or in utils. Maybe use C++ lib for text to speech.

Thank you! for resolving the issue.