Closed urbansound8K closed 2 years ago
@urbansound8K it appears you may have environment problems. Please ensure you meet all dependency requirements if you are attempting to run YOLOv5 locally. If in doubt, create a new virtual Python 3.9 environment, clone the latest repo (code changes daily), and pip install
requirements.txt again from scratch.
💡 ProTip! Try one of our verified environments below if you are having trouble with your local environment.
Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
Models and datasets download automatically from the latest YOLOv5 release when first requested.
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.
thanks a lot
I am wondering now if I can print out the output of the objects detection in terminal? what I mean is that how to print the height width distance and etc in the terminal? where is that in the code?
@urbansound8K 👋 Hello! Thanks for asking about handling inference results. YOLOv5 🚀 PyTorch Hub models allow for simple model loading and inference in a pure python environment without using detect.py
.
This example loads a pretrained YOLOv5s model from PyTorch Hub as model
and passes an image for inference. 'yolov5s'
is the YOLOv5 'small' model. For details on all available models please see the README. Custom models can also be loaded, including custom trained PyTorch models and their exported variants, i.e. ONNX, TensorRT, TensorFlow, OpenVINO YOLOv5 models.
import torch
# Model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # or yolov5m, yolov5l, yolov5x, etc.
# model = torch.hub.load('ultralytics/yolov5', 'custom', 'path/to/best.pt') # custom trained model
# Images
im = 'https://ultralytics.com/images/zidane.jpg' # or file, Path, URL, PIL, OpenCV, numpy, list
# Inference
results = model(im)
# Results
results.print() # or .show(), .save(), .crop(), .pandas(), etc.
results.xyxy[0] # im predictions (tensor)
results.pandas().xyxy[0] # im predictions (pandas)
# xmin ymin xmax ymax confidence class name
# 0 749.50 43.50 1148.0 704.5 0.874023 0 person
# 2 114.75 195.75 1095.0 708.0 0.624512 0 person
# 3 986.00 304.00 1028.0 420.0 0.286865 27 tie
See YOLOv5 PyTorch Hub Tutorial for details.
Good luck 🍀 and let us know if you have any other questions!
thank you again you are really doing well!
honestly, what I am asking is about the detector of zed 2i cam? here
I cloud not find where in the code the sting of output is?
could you please have a look and give me a hint?
let me before that show you what I have done
here I cound find the number of objects
I added these lines here for that
now I am looking how to make the same for distance and classID, please?
I could get all the information I want printed out in the terminal, expect the distance? where in code here is the distance ?
could you please how ur detector works with zed 2i? where did u measure the distance ? to sum up? I just want to print the distacne out on the terminal ?
what I am planing to do is that; i want to send the final output string format via UDP
please help
👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.
Access additional YOLOv5 🚀 resources:
Access additional Ultralytics ⚡ resources:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!
Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!
@urbansound8K Thanks for sharing your progress and what you're aiming to achieve. The distance calculation is typically performed using the stereo vision capabilities of the ZED 2i camera, which allows for depth estimation. In the provided detector.py file, the distance calculation based on the output of the YOLOv5 model will likely be located in the sections responsible for post-processing the model's predictions.
However, as the file you've referenced is not part of the YOLOv5 repository, it's difficult for me to pinpoint the exact location for the distance calculation. I recommend reviewing the ZED 2i documentation or leveraging the ZED SDK to integrate depth estimation with object detection. Once you have the distance information, you can incorporate it into the output string and proceed with sending the formatted output via UDP as planned.
Feel free to reach out if you have any more questions or need further assistance!
Search before asking
Question
could you help please?
Additional
I believe it is torch problem!