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

Distance measurment #7

Open mostafarahim opened 4 years ago

mostafarahim commented 4 years ago

Hello, actually i've tried using the distance measurement but it dosen't work all the time , it sometimes count the objects in the video and speaks the kind of the objects but it dosen't tell the distance always. Thank you :)

paul-pias commented 4 years ago

Thank you for reaching out. Kindly check the new updates in the repo. Hope it will resolve your issues.

mostafarahim commented 4 years ago

Okay thank you very much sir, excuse me another thing , iam running the code on raspberry pi and there is an issue while using win32 so any suggestions please?

paul-pias commented 4 years ago

As Raspberry PI has linux based os win32 won't work there. You can use espeak.

Kindly follow this Issue#2 for better understanding. Kindly let me know if you face any further issues.

mostafarahim commented 4 years ago

thank you very much sir your'e so helpful , i followed the instructions and there is no error for the espeak but i dont know what will happen after running all the project and it will work correctly or not. another problem that icant install pytorch on raspberry pi and i think thats the last problem and then the project will run correctly. Thank you :)

mostafarahim commented 4 years ago

Python 3.7.3 (/usr/bin/python3)

%Run object_detection.py Traceback (most recent call last): File "/home/pi/Downloads/Object-Detection-and-Distance-Measurement-master/object_detection.py", line 1, in import torch,cv2,random,os,time File "/usr/lib/python3/dist-packages/thonny/backend.py", line 305, in _custom_import module = self._original_import(*args, kw) File "/home/pi/.local/lib/python3.7/site-packages/torch/init.py", line 81, in from torch._C import File "/usr/lib/python3/dist-packages/thonny/backend.py", line 305, in _custom_import module = self._original_import(args, kw) ImportError: numpy.core.multiarray failed to import

paul-pias commented 4 years ago

You are welcome! Anyway, Raspberry PI has a very weak processor compare to the conventional PC's. Unless a model is highly compressed or pruned it won't be a wise idea to run on edge devices. However, you can follow the tutorial to install PyTorch in raspberry pi. You can also follow the following tutorial to run object detection on raspberry pi. TensorFlow-Object-Detection-on-the-Raspberry-Pi.

paul-pias commented 4 years ago

Another approach can be you can use Neural Compute Stick with Raspberry PI 4 to run heavy models in edge devices but you may need to do the trade-off with FPS on that case.

mostafarahim commented 4 years ago

Thank you very much again mr. paul , iam following your instructions the code now has no errors but actually it doesn’t make an output due to low performance of the raspberry pi , so i will get the compute stick and tell you the updates. Best regards.

1248280302 commented 3 years ago

I ran this code, but the distance measurement doesn't work, usually shows between 8.5-9 inches, I don't know how to fix it.Can you tell me how you solved it?

luunguyencdt commented 3 years ago

I ran this code, but the distance measurement doesn't work, usually shows between 8.5-9 inches, I don't know how to fix it.Can you tell me how you solved it?

I faced with this issue as well. Im looking for to hearing that

MukarramAhmad commented 3 years ago

I ran this code, but the distance measurement doesn't work, usually shows between 8.5-9 inches, I don't know how to fix it.Can you tell me how you solved it?

facing the same issue. have u found any solution?

HassanBinHaroon commented 2 years ago

Check out the following relevant and easiest implementation.

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