GithubHelp home page GithubHelp logo

unbox_yolov5_deepsort_counting's Introduction

yolov5 deepsort 行人 车辆 跟踪 检测 计数

  • 实现了 出/入 分别计数。
  • 显示检测类别。
  • 默认是 南/北 方向检测,若要检测不同位置和方向,可在 main.py 文件第13行和21行,修改2个polygon的点。
  • 默认检测类别:行人、自行车、小汽车、摩托车、公交车、卡车。
  • 检测类别可在 detector.py 文件第60行修改。

视频

bilibili

bilibili

运行环境

  • python 3.6+,pip 20+
  • pytorch
  • pip install -r requirements.txt

如何运行

  1. 下载代码

    $ git clone https://github.com/dyh/unbox_yolov5_deepsort_counting.git
    

    因此repo包含weights及mp4等文件,若 git clone 速度慢,可直接下载zip文件:https://github.com/dyh/unbox_yolov5_deepsort_counting/archive/main.zip

  2. 进入目录

    $ cd unbox_yolov5_deepsort_counting
    
  3. 创建 python 虚拟环境

    $ python3 -m venv venv
    
  4. 激活虚拟环境

    $ source venv/bin/activate
    
  5. 升级pip

    $ python -m pip install --upgrade pip
    
  6. 安装pytorch

    根据你的操作系统、安装工具以及CUDA版本,在 https://pytorch.org/get-started/locally/ 找到对应的安装命令。我的环境是 ubuntu 18.04.5、pip、CUDA 11.0。

    $ pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
    
  7. 安装软件包

    $ pip install -r requirements.txt
    
  8. 在 main.py 文件中第66行,设置要检测的视频文件路径,默认为 './video/test.mp4'

    140MB的测试视频可以在这里下载:https://pan.baidu.com/s/1qHNGGpX1QD6zHyNTqWvg1w 提取码: 8ufq

    capture = cv2.VideoCapture('./video/test.mp4')
    
  9. 运行程序

    python main.py
    

使用框架

unbox_yolov5_deepsort_counting's People

Contributors

dyh 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  avatar  avatar  avatar

unbox_yolov5_deepsort_counting's Issues

数据集

这个项目的数据集长什么样子呢 有没有开源的呀

about eval

能麻烦说一下eval具体该怎么做吗,非常感谢

mac电脑无法运行,有谁运行成功的吗?

我在colab上可以,mac pro电脑无法运行,有谁运行成功的吗?

(unbox_yolov5_deepsort_counting-main) ➜ unbox_yolov5_deepsort_counting-main python main.py
Fatal Python error: Segmentation fault

Thread 0x000000010825e600 (most recent call first):
File "<[1] 19053 segmentation fault python main.py

IP camera stream

Hi!
Thank you for this repo. Its helping me a lot with my project.

there is an issue: ip camera stream is very short. how can I fix this bug? And how can I count objects with multiple ip cameras in flask or django? Help me to implement this please

撞线

撞线位置怎么设置啊

题主这个问题有遇到不?

RuntimeError: Couldn't load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.version and your torchvision version with torchvision.version and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

easydict

ModuleNotFoundError: No module named 'easydict'

只有CPU是不是没法运行该项目

运行报错 RuntimeError: "slow_conv2d_cpu" not implemented for 'Half'
查了下是Half这个变量没法在cpu上跑,所以想问下win10+cpu是不是无法泡桐该项目

安装requests时

ERROR: Could not find a version that satisfies the requirement pkg-resources
ERROR: No matching distribution found for pkg-resources

opencv

cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-s8zh4qlk/opencv/modules/highgui/src/window.cpp:651: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'

激活虚拟环境

第4步,激活虚拟环境一直过不去,还有第6步安装版本不知道怎么查询。
01

pkg-resources

No matching distribution found for pkg-resources
why?

视频每一帧的时间

您好!我想问一下咱们一帧检测的时间是多少,用的GPU是什么配置,加入检测时间不能没有视频快的话怎么应用到实时检测呢

我感觉我不能随心所欲的设置那两条线

那两条线的设置的值是按照resize之后的图片设置的吗,因为比如我的图片大小是512*512,那么如果我想刚好把线设置在中间就应该是256左右这样子,但是运行之后我发现不是这样。另外为啥要设置两条线呀而不是一条线

real time tracking

Can you directly use the video from the camera as direct input?Or use your phone as a camera

你好

能加vx聊一下吗?

车辆横向时无法识别

请问车辆是否只能识别面向头部和面向尾部?车辆横向时,为什么识别不出来?

两条横线

请问作者,为什么检测的时候在视频中加入了两条线

保存结果

您好,目前是没有保存结果的功能的,我试了cv2.VideoWriter( ),不管用,您有保存的代码吗?谢谢

怎麽使用自己的訓練好的模型?

我有訓練自己的模型,4個模型都有做訓練,但當我放入自己的模型且在models中添加了關於這個模型的yaml檔案后,在更改了detector.py中self.weights的路徑后出現錯誤
AttributeError: Can't get attribute 'C3' on <module 'models.common' from 'C:\Users\User\Desktop\yolov5\unbox_yolov5_deepsort_counting\models\common.py'>
請問這個要如何解決?

loade()少一个参数

self.update(yaml.load(fo.read()))

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

修改为:
self.update(yaml.load(fo.read(),Loader=yaml.SafeLoader))

自建数据集

能不能对自己的数据集中类别进行训练,进而进行检测识别

qt5

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

RuntimeError: "unfolded2d_copy" not implemented for 'Half'

报这个错呀 RuntimeError: "unfolded2d_copy" not implemented for 'Half' 请问修改哪个文件

/root/deep_sort/utils/parser.py:23: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
self.update(yaml.load(fo.read()))
/root/venv/lib/python3.6/site-packages/torch/cuda/init.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
return torch._C._cuda_getDeviceCount() > 0
Fusing layers...
Traceback (most recent call last):
File "main.py", line 79, in
bboxes = detector.detect(im)
File "/root/detector.py", line 47, in detect
pred = self.m(img, augment=False)[0]
File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/models/yolo.py", line 123, in forward
return self.forward_once(x, profile) # single-scale inference, train
File "/root/models/yolo.py", line 139, in forward_once
x = m(x) # run
File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/models/common.py", line 171, in forward
return self.conv(torch.cat([x[..., ::2, ::2], x[..., 1::2, ::2], x[..., ::2, 1::2], x[..., 1::2, 1::2]], 1))
File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/models/common.py", line 45, in fuseforward
return self.act(self.conv(x))
File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 423, in forward
return self._conv_forward(input, self.weight)
File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 420, in _conv_forward
self.padding, self.dilation, self.groups)
RuntimeError: "unfolded2d_copy" not implemented for 'Half'

can't download project file

only can get unbox_yolov5_deepsort_counting-main .zip instead of the project file, can you please check why?

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.