howiema / deepsort_yolov5_pytorch Goto Github PK
View Code? Open in Web Editor NEWDeepSORT + YOLOv5
DeepSORT + YOLOv5
Hi there. I have tried running the programme on 2 seperate instances and have encountered these errors. I have made sure to have connected the webcam (the only webcam too), so that it takes --cam 0 correctly.
Here are the terminal outputs
python3 main.py --cam 0 --display
Namespace(agnostic_nms=False, augment=False, cam=0, classes=[0], conf_thres=0.5, config_deepsort='./configs/deep_sort.yaml', device='', display=True, display_height=600, display_width=800, fourcc='mp4v', frame_interval=2, img_size=640, input_path='input_480.mp4', iou_thres=0.5, save_path='output/', save_txt='output/predict/', weights='yolov5/weights/yolov5s.pt')
Initialize DeepSORT & YOLO-V5
Using CPU
Using webcam 0
Done..
Camera ...
Done. Create output file output/results.mp4
Illegal instruction (core dumped)
And in another instance, I have a different error citing camera error
python3 main.py --cam 0 --display
Namespace(agnostic_nms=False, augment=False, cam=0, classes=[0], conf_thres=0.5, config_deepsort='./configs/deep_sort.yaml', device='', display=True, display_height=600, display_width=800, fourcc='mp4v', frame_interval=2, img_size=640, input_path='input_480.mp4', iou_thres=0.5, save_path='output/', save_txt='output/predict/', weights='yolov5/weights/yolov5s.pt')
Initialize DeepSORT & YOLO-V5
Using CPU
Using webcam 0
Done..
Camera ...
[ WARN:0] global /tmp/pip-req-build-tpkxoqhj/opencv/modules/videoio/src/cap_v4l.cpp (1001) tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
Traceback (most recent call last):
File "main.py", line 259, in <module>
with VideoTracker(args) as vdo_trk:
File "main.py", line 75, in __enter__
assert ret, "Error: Camera error"
AssertionError: Error: Camera error
The camera error occured right after the illegal instruction (core dumped) episode. When the programme was first run, the windows for the display could be open, but there is no video feed, and it just stops responding in Ubuntu (window goes greyscale)
Error title is :
python3.8 crashed with SIGILL in exec_blas()
If required, my device's techncial specs
DJI Manifold 2G (Nvidia Jetson TX2)
ARMv8 Processor rev 3 (v8l) × 4 ARMv8 Processor rev 0 (v8l) × 2
NVIDIA Tegra X2 (nvgpu)/integrated
8GB ram, Ubuntu 18.04 LTS
As for the new model of yolov5, I have checked that the version of yolov5 you used is 2.0, so I trained a helmet detection model with the corresponding version, and it has been tested by yolov5 alone and is effective. However, after I imported this model into your project, nothing can be detected. Is there anything that needs to be modified.
Looking forward to your reply very much!
1.找到选择device的区域
发现没有进入if语句,查看if语句之前的device.type确定是cpu,但是if判断语句中’cpu’是字符串,而device.type是cpu <class 'torch.device'>所以没有进入if语句。
2.device.type的类别是字符串,修改为device.type。还是报错
分析:追溯是执行vdo_trk.run()是出现问题。查看self.image_track(img0)使用的设备,发现是cpu,没问题。接着查看time_synchronized,发现错误
/home/ahei/DeepSORT_YOLOv5_Pytorch-master/yolov5/utils/torch_utils.py line 53 time_synchronized
原来,首先检查了torch.cuda.is_available()有的话调用了torch.cuda.synchronize(),然而我们的gpu在跑代码显存满了,所以报错。修改如下,问题解决。
Hello, we run the code successfully, but we find a question of the time costing.
In the sort part, the average time is about 40ms, but there are few frames taking more than 500ms. After investigation, it is determined that the time-consuming part of network (feature extraction part) reasoning has increased sharply, and the Layer4 takes the most time.
Have you encountered any similar problems? How to solve them, thanks!
Environment:
Xavier AGX 16GB - Jetpack 4.4
python 3.6.9
pytorch 1.6.0
opencv 4.1.1
Hi,I successfully run this project,but I have tried a lot of weights(yolov5s.pt) of different version from yolov5 official website,It kept telling me with"Can't get attribute 'C3' on <module 'models.common' >"So which version of yolov5 should I choose?Thank you so much.
Hello. I am trying to run your programme after installing pip install -r requirements.txt
However, i have ran into an error "TypeError: load() missing 1 required positional argument: 'Loader'"
This is the full output:
$ python main.py --cam 0 --display
Namespace(agnostic_nms=False, augment=False, cam=0, classes=[0], conf_thres=0.5, config_deepsort='./configs/deep_sort.yaml', device='', display=True, display_height=600, display_width=800, fourcc='mp4v', frame_interval=2, img_size=640, input_path='input_480.mp4', iou_thres=0.5, save_path='output/', save_txt='output/predict/', weights='yolov5/weights/yolov5s.pt')
Initialize DeepSORT & YOLO-V5
Using CPU
Using webcam 0
Traceback (most recent call last):
File "main.py", line 259, in <module>
with VideoTracker(args) as vdo_trk:
File "main.py", line 53, in __init__
cfg.merge_from_file(args.config_deepsort)
File "/home/dji/Desktop/targetTrackers/howieMa/DeepSORT_YOLOv5_Pytorch/utils_ds/parser.py", line 23, in merge_from_file
self.update(yaml.load(fo.read()))
TypeError: load() missing 1 required positional argument: 'Loader'
I have found some suggestions on github, such as in here https://stackoverflow.com/questions/69564817/typeerror-load-missing-1-required-positional-argument-loader-in-google-col,
which suggests to change yaml.load to yaml.safe_load
However, doing so leads me to this error instead
$ python main.py --cam 0 --display
Namespace(agnostic_nms=False, augment=False, cam=0, classes=[0], conf_thres=0.5, config_deepsort='./configs/deep_sort.yaml', device='', display=True, display_height=600, display_width=800, fourcc='mp4v', frame_interval=2, img_size=640, input_path='input_480.mp4', iou_thres=0.5, save_path='output/', save_txt='output/predict/', weights='yolov5/weights/yolov5s.pt')
Initialize DeepSORT & YOLO-V5
Using CPU
Using webcam 0
Done..
Camera ...
Done. Create output file output/results.mp4
Illegal instruction (core dumped)
Has anyone encountered anything similar ? Thank you !
I would like to connect with you ...
Also, have a look at
https://github.com/mahimairaja/vehicle-counting-yolov5
Hi, I click the link of yolov5 weights, it seems in a google drive trash.
But then I realized it must be an official weight offered by glenn-jocher.
So, maybe you can change the link to a workable one or link to the yolov5?
Hello, I want to detect only some specific label in video. Where is the label for tracking?
Hey,wonderful job! But when I used the latest weights , error shows like "AttributeError: Can't get attribute 'C3' on <module 'models.common' ".And I found out that latest yolov5 project is necessary. Do you have any plan to update this project?
I want to draw trajectory line for moving object through the video
how to do that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.