Giter Club home page Giter Club logo

yolox-deepsort's Introduction

项目简介:

使用YOLOX+Deepsort实现车辆行人追踪和计数,代码封装成一个Detector类,更容易嵌入到自己的项目中。

代码地址(欢迎star):

https://github.com/Sharpiless/yolox-deepsort/

最终效果:

在这里插入图片描述

运行demo:

python demo.py

下载预训练模型:

Model size mAPtest
0.5:0.95
Speed V100
(ms)
Params
(M)
FLOPs
(G)
weights
YOLOX-s 640 39.6 9.8 9.0 26.8 onedrive/github
YOLOX-m 640 46.4 12.3 25.3 73.8 onedrive/github
YOLOX-l 640 50.0 14.5 54.2 155.6 onedrive/github
YOLOX-x 640 51.2 17.3 99.1 281.9 onedrive/github
YOLOX-Darknet53 640 47.4 11.1 63.7 185.3 onedrive/github

下载 yolox_s.pth 放到 weights 文件夹下

下载 https://github.com/Sharpiless/Yolov5-Deepsort/blob/main/deep_sort/deep_sort/deep/checkpoint/ckpt.t7 放到 deep_sort/deep_sort/deep/checkpoint 文件夹下

训练自己的模型:

训练好后放到 weights 文件夹下

调用接口:

创建检测器:

from AIDetector_pytorch import Detector

det = Detector()

调用检测接口:

result = det.feedCap(im)

其中 im 为 BGR 图像

返回的 result 是字典,result['frame'] 返回可视化后的图像

联系作者:

B站:https://space.bilibili.com/470550823

CSDN:https://blog.csdn.net/weixin_44936889

AI Studio:https://aistudio.baidu.com/aistudio/personalcenter/thirdview/67156

Github:https://github.com/Sharpiless

yolox-deepsort's People

Contributors

sharpiless avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

yolox-deepsort's Issues

onnxruntime for video

Hello,

You used image in onnxruntime codes. But I want to use video instead of image. İs it possible? If possible, could you help me?

No such file or directory: 'deep_sort/deep_sort/deep/checkpoint/ckpt.t7'

Traceback (most recent call last):
File "D:/pythonProject3/yolox-deepsort-main/demo.py", line 1, in
from AIDetector_pytorch import Detector
File "D:\pythonProject3\yolox-deepsort-main\AIDetector_pytorch.py", line 6, in
from BaseDetector import baseDet
File "D:\pythonProject3\yolox-deepsort-main\BaseDetector.py", line 1, in
from tracker import update_tracker
File "D:\pythonProject3\yolox-deepsort-main\tracker.py", line 9, in
deepsort = DeepSort(cfg.DEEPSORT.REID_CKPT,
File "D:\pythonProject3\yolox-deepsort-main\deep_sort\deep_sort\deep_sort.py", line 19, in init
self.extractor = Extractor(model_path, use_cuda=use_cuda)
File "D:\pythonProject3\yolox-deepsort-main\deep_sort\deep_sort\deep\feature_extractor.py", line 13, in init
state_dict = torch.load(model_path, map_location=lambda storage, loc: storage)['net_dict']
File "D:\Develop\python\Anaconda3\envs\Pychramproject2\lib\site-packages\torch\serialization.py", line 581, in load
with _open_file_like(f, 'rb') as opened_file:
File "D:\Develop\python\Anaconda3\envs\Pychramproject2\lib\site-packages\torch\serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "D:\Develop\python\Anaconda3\envs\Pychramproject2\lib\site-packages\torch\serialization.py", line 211, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'deep_sort/deep_sort/deep/checkpoint/ckpt.t7'

进程已结束,退出代码为 1

TypeError: load() missing 1 required positional argument: 'Loader'

(pytorch1.8) D:\yolox-deepsort-main\yolox-deepsort-main>python demo.py
Traceback (most recent call last):
File "demo.py", line 1, in
from AIDetector_pytorch import Detector
File "D:\yolox-deepsort-main\yolox-deepsort-main\AIDetector_pytorch.py", line 6, in
from BaseDetector import baseDet
File "D:\yolox-deepsort-main\yolox-deepsort-main\BaseDetector.py", line 1, in
from tracker import update_tracker
File "D:\yolox-deepsort-main\yolox-deepsort-main\tracker.py", line 8, in
cfg.merge_from_file("deep_sort/configs/deep_sort.yaml")
File "D:\yolox-deepsort-main\yolox-deepsort-main\deep_sort\utils\parser.py", line 23, in merge_from_file
self.update(yaml.load(fo.read()))
TypeError: load() missing 1 required positional argument: 'Loader'

"/opt/module/yolox-deepsort/AIDetector_pytorch.py", line 107, in detect

Traceback (most recent call last):
File "demo.py", line 45, in
main()
File "demo.py", line 19, in main
result = det.feedCap(im)
File "/opt/module/yolox-deepsort/BaseDetector.py", line 33, in feedCap
im, faces, face_bboxes = update_tracker(self, im)
File "/opt/module/yolox-deepsort/tracker.py", line 40, in update_tracker
_, bboxes = target_detector.detect(image)
File "/opt/module/yolox-deepsort/AIDetector_pytorch.py", line 107, in detect
boxes = outputs[:, 0:4]
TypeError: 'NoneType' object is not subscriptable

TypeError: 'NoneType' object is not subscriptable

Traceback (most recent call last):
File "demo.py", line 50, in
main()
File "demo.py", line 24, in main
result = det.feedCap(im)
File "/home/shf/yolox2/BaseDetector.py", line 33, in feedCap
im, faces, face_bboxes = update_tracker(self, im)
File "/home/shf/yolox2/tracker.py", line 40, in update_tracker
_, bboxes = target_detector.detect(image)
File "/home/shf/yolox2/AIDetector_pytorch.py", line 107, in detect
boxes = outputs[:, 0:4]
TypeError: 'NoneType' object is not subscriptable

TypeError: 'NoneType' object is not subscriptable

File "demo.py", line 52, in
main()
File "demo.py", line 26, in main
result = det.feedCap(im)
File "D:\vehicleCount\yolox_deepsort_reply\yolox-deepsort-main\BaseDetector.py", line 33, in feedCap
im, faces, face_bboxes = update_tracker(self, im)
File "D:\vehicleCount\yolox_deepsort_reply\yolox-deepsort-main\tracker.py", line 40, in update_tracker
_, bboxes = target_detector.detect(image)
File "D:\vehicleCount\yolox_deepsort_reply\yolox-deepsort-main\AIDetector_pytorch.py", line 109, in detect
boxes1 = outputs[:, 0:4]
TypeError: 'NoneType' object is not subscriptable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.