Coder Social home page Coder Social logo

qidian213 / deep_sort_yolov3 Goto Github PK

View Code? Open in Web Editor NEW
1.6K 1.6K 594.0 10.74 MB

Real-time Multi-person tracker using YOLO v3 and deep_sort with tensorflow

License: GNU General Public License v3.0

Python 100.00%
deep-sort pedestrian real-time tracker yolov3

deep_sort_yolov3's People

Contributors

adityavashista30 avatar bensloane avatar chaplinhao avatar dasmehdix avatar hyunmoahn avatar leonlok avatar qidian213 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  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

deep_sort_yolov3's Issues

Regarding the model_file---"mars-small128.pb".

Hi,"mars-small128.pb" model file is trained with the person re-identification dataset right? If yes is it okay to use this model for some other objects on which we want to run the tracking?

using darknet yolov3 - problems with bounding boxes

I want to use the original darknet yolov3 instead of the keras yolov3.

I'm having trouble adapting bounding boxes.

I want to replace the bounding box outputs of this file: https://github.com/Qidian213/deep_sort_yolov3/blob/master/demo.py#L58

With the bounding box outputs of this function (in darknet yolov3 python bindings): https://github.com/AlexeyAB/darknet/blob/master/darknet.py#L281

I'm following the chain of function calls and transformations, but I'm still not quite getting it.

What do the four coordinates inside each of the boxs represent?

轨迹ID不稳定

你好,我跑了你的项目之后,用本地的视频,发现视频中行人轨迹的ID经常变化,这个问题再deep sort项目中也报过issue ,我尝试把你demo中可视化的那个循环修改后问题同样存在。
环境Ubuntu16.04,python2.7
issue 参照
nwojke/deep_sort#13
里面貌似@Bendidi用的可视化的代码和你类似 是用一个循环写的

update:
在循环内跟踪框之前 加一条判断语句就可以了,
if track.is_confirmed() and track.time_since_update <=0:

AttributeError: can't set attribute

hello ~
I run demo.py on my server but something goes wrong...
(AttributeError: can't set attribute)

python version: 2.7.6
tensorflow version: 1.4.0
keras version: 2.0.6

I don't know why it happened, would you help me?
Thank you very much!

(It seems to use CPU rather than GPU, but anyway, my cuda version is 9.2.148 and no cudnn.)
=============== the error information is shown below=================
Using TensorFlow backend.
Loading weights.
('Weights Header: ', 0, 2, 0, array([32013312]))
Parsing Darknet config.
Creating Keras model.
Parsing section net_0
Parsing section convolutional_0
('conv2d', 'bn', u'leaky', (3, 3, 3, 32))
Traceback (most recent call last):
File "convert.py", line 241, in
_main(parser.parse_args())
File "convert.py", line 170, in _main
padding=padding))(prev_layer)
File "build/bdist.linux-x86_64/egg/keras/engine/topology.py", line 560, in call
File "build/bdist.linux-x86_64/egg/keras/layers/convolutional.py", line 134, in build
File "build/bdist.linux-x86_64/egg/keras/legacy/interfaces.py", line 87, in wrapper
File "build/bdist.linux-x86_64/egg/keras/engine/topology.py", line 384, in add_weight
File "build/bdist.linux-x86_64/egg/keras/backend/tensorflow_backend.py", line 323, in variable
AttributeError: can't set attribute

Error while converting

Got the following during training;
Traceback (most recent call last):
File "convert.py", line 241, in
_main(parser.parse_args())
File "convert.py", line 78, in _main
unique_config_file= unique_config_sections(config_path)
File "convert.py", line 48, in unique_config_sections
output_stream.write(line)
TypeError: a bytes-like object is required, not 'str'

image

How to use Custom Trained Yolo v3 model

Hello, first of all, thank you for your hard work.

I've trained Yolo v3 model for the custom object(person, logo on the shirt) detection. After I convert it to h5 file. and run demo.py it throws error.

File "/home/deep_sort_yolov3/yolo.py", line 33, in init
self.boxes, self.scores, self.classes = self.generate()
File "/home/deep_sort_yolov3/yolo.py", line 72, in generate
score_threshold=self.score, iou_threshold=self.iou)
File "/home/deep_sort_yolov3/yolo3/model.py", line 170, in yolo_eval
anchors[anchor_mask[l]], num_classes, input_shape, image_shape)
IndexError: index 6 is out of bounds for axis 0 with size 6
Exception ignored in: <bound method BaseSession.del of <tensorflow.python.client.session.Session object at 0x7f36234d45f8>>
Traceback (most recent call last):
File "/home/.virtualenvs//lib/python3.5/site-packages/tensorflow/python/client/session.py", line 707, in del
TypeError: 'NoneType' object is not callable

After going through issues I see yolo.py is using coc_classes.txt and yolo_anchors.txt files. I manually edited the coco_classes.txt and added the name of custom object(person, logo) I'm looking to detect.

I am stuck at yolo_anchors.txt and voc_classes.txt file how can I edit them to get the detection +tracking.

Poor Result

I gathered people's images and learned with YOLOv3 as one class problem.
(./darknet detector train data/obj.data yolov3.cfg darknet53.conv.74)
The weights of the learning result were better than yolov3.weights in YOLOv3.

Then I converted the weights in convert.py of deep_sort_yolov3 and corrected yolo_anchors.txt and coco_classes.txt appropriately.
However, the tracking success rate of deep_sort_yolov 3 got worse than when using default yolov3.weights(yolo.h5).

Can you think of anything as a cause?

run error

screenshot from 2018-06-03 23-21-18
hello,when I test my video ,it doesn't work. I have replaced VideoCapture(0) with VideoCapture(to/my/path) ,Need i prepare any other files? thanks

How to make full use of GPU?

Thanks for your work, the tracking is amazing, but I need your help to improve the speed.

I use a gtx1080ti to run this demo.
The gpu usage rate only 15%-20%, and the memory occupancy rate is only 7%.

How to make full use of GPU?

about the accuracy compared with the original deep_sort code

Hi , i run the original deep_sort code(using the detections provided) and this code(deep_sort_yolov3) on the test video (MOT16-06.mp4), the former's accuracy is higher, is it the problem of detection phase? Or the original deep_sort use the MOT16 training dataset to train? They both use the mars-small128 pretrained model after all. thanks in advance……

关于deep-sort yolov3报错

你好 看到您的关于deep-sort yolov3的文章,下载下来不能正常运行显示报错,Windows 下
Input to reshape is a tensor with 3549 values, but the requested shape requires a multiple of 43095
[[Node:Reshape_75=Reshape[T=DT_FLOAT,Tshape=DT_INT32,_device="/job:localhost/replica:0/task:0/device:CPU:0"](conv2d_59_4/BiasAdd, Reshape_75/shape)]]
一直没有找到问题的根源 特别写了这封邮件 寻求您的帮助,希望您给一些详细的使用教程 期待您的回复。 谢谢

Silencing "Optimizing fused batch norm node" stdout during model loading

I can't figure out how to totally silence the loading stdout when I load the Tensorflow-based feature extractor.

Here is what I can't get rid of:

Optimizing fused batch norm node name: "net/conv4_3/1/conv4_3/1/bn/FusedBatchNorm"
op: "FusedBatchNorm"
input: "net/conv4_3/1/Conv2D"
input: "net/conv4_3/1/conv4_3/1/bn/Const"
input: "net/conv4_3/1/conv4_3/1/bn/beta"
input: "net/conv4_3/1/conv4_3/1/bn/moving_mean"
input: "net/conv4_3/1/conv4_3/1/bn/moving_variance"
device: "/job:localhost/replica:0/task:0/device:GPU:0"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "data_format"
  value {
    s: "NHWC"
  }
}
attr {
  key: "epsilon"
  value {
    f: 0.001
  }
}
attr {
  key: "is_training"
  value {
    b: false
  }
}

I've added the following verbosity variables to the top of the generate_detections.py file. I've tried many combination of settings but nothing has worked.

import os
os.environ['TF_CPP_MIN_VLOG_LEVEL'] = '0'
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from tensorflow import logging
logging.set_verbosity(logging.FATAL)

What else can I try?

Tracks in text

Hi again

Is there are way to get the tracks in a text file.

Error while running

I am getting this while running the demo.py

2018-05-22 21:18:25.932086: W tensorflow/core/common_runtime/bfc_allocator.cc:279] ****************************************************************************************************
2018-05-22 21:18:25.932128: W tensorflow/core/framework/op_kernel.cc:1318] OP_REQUIRES failed at assign_op.h:112 : Resource exhausted: OOM when allocating tensor with shape[512] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc

Tracking instability

hello!
在程序demo.py第76行
if track.is_confirmed() and tarck.time_since_updata>1
不应该是 if not track.is_confirmed() and tarck.time_since_updata>1 吗?
但是我改了之后效果变得很差
请问您有什么解决方法吗

detections

how can we add the object name to the bounding box instead of the track id??

Multi camera/multi video input

Hi!

I was wondering if it is possible to enter multiple cameras and/or multiple video input at once.
If not, what should be a smart idea of implementing it.
With those two cameras I want to determine the exact position of an object/multiple objects.

Cheers,

About detection speed

Hello!
your FPS is about 11~13,what's your environment?
have you tested on jetson TX2?

Update on the Result

Hi

I tested the video. The results are very bad.

Its only 6 seconds after start of video.

There are only 6 people but the track number is 17.

Even the boxes are not on people.

Second image is from yolov3 on keras

convert.py error: could not convert yolov3.weights to yolo.h5

while run the following python program, it is said as the following, could you try to fix it?

python convert.py yolov3.cfg yolov3.weights model_data/yolo.h5

D:\dev\IDE\Anaconda3\lib\site-packages\h5py_init_.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
Loading weights.
Weights Header: 0 2 0 [32013312]
Parsing Darknet config.
Traceback (most recent call last):
File "convert.py", line 241, in
_main(parser.parse_args())
File "convert.py", line 78, in _main
unique_config_file = unique_config_sections(config_path)
File "convert.py", line 48, in unique_config_sections
output_stream.write(line)
TypeError: a bytes-like object is required, not 'str'

command line input

can we give the link of input video through command line instead of hardcoding

Realtime detection and tracking

@Qidian213
Can u please let me know how did u manage to detect and track in real time....
because even the darknet implementation of yolov3 is not realtime on CPU it gives 0.4 fps on CPU that too for detection only... While your implementation gives me speed of 2.4 fps with detection as well as tracking on CPU

features = encoder(frame,boxs) line very slow

hi, @Qidian213 .

I am using your code to do the tracking with tin-yolo model. Current I could get around 3-4 fps on cpu. I want to improve that. However, I found that the line 60 in demo.py which is "features = encoder(frame,boxs)" take 100 ms for 1 image, which waste a lot of time. I want to ask whether there has a way to improve this? Thank you!

eeee... Is this code can only detect and tracking one video?

I have finished tracking my first video, it goes wrong when i want change my tracking video. Is anyone's issue is same as me? then i turned to tracking the former video, it's okay to detect and tracking, but it's going wrong when i turned to try the second video,then i try another video, it's failed again.

Deep Sort weights for vehicle class?

Hi everyone,
Thanks for this code. I would like to know whether anybody have deep sort vehicle class weights for vehicle class like cars, trucks etc.?
Please share weights for relevant procedure to train our own set of weights?
Thanks!!

Tracking on PTZ camera

First of all, thanks for sharing this project! :)

I tried to run the tracker on a PTZ Optics camera by changing the following line of demo.py:

video_capture = cv2.VideoCapture(0)

to

video_capture = cv2.VideoCapture('rtsp://[IP]/1')

where [IP] is the IP address of the camera. When I run demo.py the capture window opens, but freezes on the first frame. What could be the problem?

Thanks and best regards!

Tracking on 1fps Camera

Hi,

Thanks a lot for your work, very helpful. It's work great on some videos. I am working on 1fps camera and its doesn't work well, as expected. Persons create a new id at each footstep. I think it's due to the very low fps, person look like teleporting. Maybe the velocity model of the kalman filter sould be changed.
Do you know how can i manage this by modifying some value ?
What the mean of nms_max_overlap and nn_budget ?

Thanks

`convert.py` TypeError: a bytes-like object is required, not 'str'

Hi,
I'm unable to convert the Darknet model to a Keras model. I'm getting the following error:

Using TensorFlow backend.
Loading weights.
Weights Header: 0 2 0 [32013312]
Parsing Darknet config.
Traceback (most recent call last):
File "convert.py", line 241, in <module>
_main(parser.parse_args())
File "convert.py", line 78, in _main
unique_config_file = unique_config_sections(config_path)
File "convert.py", line 48, in unique_config_sections
output_stream.write(line)
TypeError: a bytes-like object is required, not 'str'

Any idea on how to solve this? Thanks.

How to use GPU with this?

Hi, I'm running this code on my CPU machine. How do I make it run on the GPU ? Maybe I'm missing something but couldn't find a documentation on how to do it. I have CUDA and CUDNN installed. Thanks

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.