paul-pias / Object-Detection-and-Distance-Measurement

Using yolov3 & yolov4 weights objects are being detected from live video frame along with the measurement of the object from the camera without the support of any extra hardware device.
348 stars 118 forks source link

Compatibility issues with Ubuntu while using tts engine for windows #2

Closed sabinasalim closed 4 years ago

sabinasalim commented 4 years ago

How can I run the project in Ubuntu since the object_detection.py file uses windows "win32com.client" for windows. Is there any alternative tts engine for ubuntu or is it only compatible with windows os.

The error is as follows: import win32com.client as wincl Traceback (most recent call last): File "object_detection.py", line 18, in <module> import win32com.client as wincl ImportError: No module named 'win32com'

paul-pias commented 4 years ago

Thank you for reaching out! You can use espeak instead of win32com.

First, try to install using the following command from your terminal.

Then import in the object_detection.py script

and replace the #244 line with

I hope it will resolve the issue. Kindly let me know if it works or not.

sabinasalim commented 4 years ago

Thank you for your response. I have followed the instructions but after installing espeak via pip I encountered another error. In import espeak command returns an error. Adding code for reference. In pip-list also the espeak package is not found.

File "object_detection.py",line 18, in <module> from espeak import speak ImportError : No module named 'espeak'

paul-pias commented 4 years ago

The previous installation format is for python version <=2.7. For python3 try the following command

Hope it will resolve the issue.

sabinasalim commented 4 years ago

Thank you for your response.i have followed the instructions but same error is encountered. Traceback (most recent call last): File "object_detection.py", line 18, in from espeak import espeak ImportError: No module named 'espeak'

paul-pias commented 4 years ago

Can you run pip3 list and python3 object_detection.py from your terminal and share the picture of both the terminals?

sabinasalim commented 4 years ago

The above error was recified. But , something new came up. Any idea what this is?

File "object_detection.py", line 254, in <module> object_detection() File "object_detection.py", line 147, in object_detection model.load_weights(weightsfile) File "/home/acer-10/Desktop/object/darknet.py", line 436, in load_weights bn_biases = bn_biases.view_as(bn.bias.data) RuntimeError: shape '[32]' is invalid for input of size 28

sabinasalim commented 4 years ago

Package Version


camera 1.3.0
certifi 2018.8.24 chardet 3.0.4
Click 7.0
cycler 0.10.0
Flask 1.1.1
gevent 1.4.0
greenlet 0.4.15
idna 2.8
itsdangerous 1.1.0
Jinja2 2.11.0
kiwisolver 1.1.0
MarkupSafe 1.1.1
matplotlib 3.0.3
numpy 1.14.2
opencv-python 4.1.2.30 pandas 0.25.3
Pillow 7.0.0
pip 20.0.2
pyad 0.6.0
pyparsing 2.4.6
python-dateutil 2.8.1
pytz 2019.3
requests 2.22.0
setuptools 40.2.0
six 1.14.0
torch 1.4.0
urllib3 1.25.8
Werkzeug 0.16.1
wheel 0.31.1

sabinasalim commented 4 years ago

Traceback (most recent call last): File "object_detection.py", line 18, in from espeak import espeak ImportError: No module named 'espeak'

paul-pias commented 4 years ago

Try changing the numpy version to "numpy==1.17.0"

shashi-dhuppe commented 3 years ago

HI, I am not able to locate similar thing for Mac. Can you help out? I am currently getting the same error @sabinasalim got when he tired to run in Ubuntu.

HassanBinHaroon commented 2 years ago

Check out the following relevant and easiest implementation. No compatibility issues hopefully.

https://github.com/HassanBinHaroon/object_detection-PLUS-distance_estimation-v1