Giter Club home page Giter Club logo

vehicle-detection-and-tracking's People

Contributors

kcg2015 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

vehicle-detection-and-tracking's Issues

using infrared camera

Hello,
Thanks for your project, it's amazing.
I'm planning to use infrared (thermal) camera instead of RGB camera. What changes needs to be considered ?

not tracking

the tacker is not tracking the sequence of images in "test_mages" folder.
the position of the bounding boxes do not change. it well track the "frame003" image

Getting an error when executing main.py with videos

Hello,
Thank you for this amazing tutorial! I really appreciate it! I was trying to execute your code with videos and I'm getting this particular error
In line 43 of main.py
in assign_detections_to_trackers
IOU_mat[t,d] = box_iou2(trk,det)
NameError: name 'box_iou2' is not defined

how do you initialize the tracker? I have problems when I run main.py as shown below.

Traceback (most recent call last):
File "E:/PycharmProject/Vehicle-Detection-and-Tracking/main.py", line 201, in
image_box = pipeline(image)
File "E:/PycharmProject/Vehicle-Detection-and-Tracking/main.py", line 115, in pipeline
= assign_detections_to_trackers(x_box, z_box, iou_thrd=0.3)
File "E:/PycharmProject/Vehicle-Detection-and-Tracking/main.py", line 71, in assign_detections_to_trackers
if IOU_mat[m[0], m[1]] < iou_thrd:
IndexError: index 0 is out of bounds for axis 0 with size 0
matched_idx:(array([], dtype=int32), array([], dtype=int64)),shape:(2, 0)
matched_idx:(array([], dtype=int32), array([], dtype=int64)),shape:(2, 0)

#########################
Can you tell me how to solve it? Thank you?

About state, process, measurement covariance

Hi Sir,

Thank you for your great work.
I'm curious about how you set the initial value of each covariance ?
Any design consideration or if it's only random values?
Thank you in advance.

Best Regards,
Lai

Tracking and counting

Hi Kyle,

First of all I would like to thank you as I am grateful for your amazing work, I am a student conducting a research for my thesis on people counter using object detection and tracking and this was very helpful.

I used the SSD mobilenet pre-trained model and trained with a custom dataset I made from overhead images of people taken from an IP camera. I was able to detect the heads of people using tensorflow's object detection API after training while in real-time. With the help of your code and some arrangements to it I was also able to track the people's movement and assign an ID.

My next step, and this is where I am struggling, is to count the person entering a room i.e after crossing the ROI(region of interest) so it is important I know the direction of the movement (up or down) and when it crosses this ROI. I have spent a lot of time searching for something similar that could be useful to me but no luck. I was wondering if you had any feedback that could be of help to me as it would be greatly appreciated. TIA.

Below is a sample image of my work.

image

name 'CarDetector' is not defined

hi, I don't know why I got this wrong message?
$ python main.py
Traceback (most recent call last):
File "main.py", line 193, in
det = CarDetector()
NameError: name 'CarDetector' is not defined

A bug

I think you should add "self.car_boxes = []" after "print('no detection!')" in file"detector.py" 124 line.
Otherwise it will keep showing the last position of previous object until the detector detects a new object.

Assign Id to the tracked object

I am trying to assign id to the tracked object but nothing is giving me an output , can any please give some idea about this, and can you please tell me about the tracker's id defined in tracker.py

Question on Deal with matched detections in main.py?

Hi @kcg2015,
Thanks for your great work.
I have a question on function Deal with matched detections in main.py.
Assume in the 1st frame, there is no matched detections, then we will jump to if len(unmatched_dets) > 0:. It does the tmp_trk.predict_only() by using current detection (x = np.array([[z[0], 0, z[1], 0, z[2], 0, z[3], 0]]).T; tmp_trk.x_state = x).
In the 2nd frame, I assume that all objects in 1st frame are matched to detections in 2nd frame, then we jump to if matched.size > 0, and do predict. However, in tmp_trk.kalman_filter(z), I saw that the code does predict then update with current detection info. I am confused because we already did predict when processing detection in the 1st frame?
Can you clarify my confusion?
I suppose that we should do update and then predict.
Thank you so much.

moviepy.editor.VideoClip not working

Traceback (most recent call last):
File "/usr/lib/python3.6/code.py", line 91, in runcode
exec(code, self.locals)
File "", line 1, in
File "/snap/pycharm-professional/132/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/home/tejanmehndiratta15/.local/lib/python3.6/site-packages/moviepy/editor.py", line 33, in
from .video.io.VideoFileClip import VideoFileClip
File "/snap/pycharm-professional/132/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/home/tejanmehndiratta15/.local/lib/python3.6/site-packages/moviepy/video/io/VideoFileClip.py", line 3, in
from moviepy.video.VideoClip import VideoClip
File "/snap/pycharm-professional/132/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)

Tracker Error

File "main.py", line 140, in pipeline
tmp_trk = Tracker() # Create a new tracker
NameError: name 'Tracker' is not defined

I just ran your code as it is, but there is an error in the main.

module 'helpers' has no attribute 'draw_box_label'

[420 4 457 68] , confidence: 0.44781974 ratio: 0.5780346820809248
[424 225 451 263] , confidence: 0.32874542 ratio: 0.7103393843725336
Frame: 1

AttributeError Traceback (most recent call last)
in
198 for i in range(len(images))[0:7]:
199 image = images[i]
--> 200 image_box = pipeline(image)
201 plt.imshow(image_box)
202 plt.show()

in pipeline(img)
100 if debug:
101 for i in range(len(z_box)):
--> 102 img1= helpers.draw_box_label(img, z_box[i], box_color=(255, 0, 0))
103 plt.imshow(img1)
104 plt.show()

AttributeError: module 'helpers' has no attribute 'draw_box_label'

NameError: name 'Tracker' is not defined

Hi!

when i run the main.py, it happended to be a problem called ''NameError: name 'Tracker' is not defined" and "2.82it/s]wrong ratio or wrong size, [426 230 441 257] , confidence: 0.36141032 ratio: 0.5553498704183636". I don't know the cause. Please you help me!

Thank you!

training mode

Can you share the code for training the model using my own dataset
thank yo u

vehicle logo detect !!

Dear, Mr Kcg2015, How are you?
Your project is very helpful and explanation is very detail so thanks for your efforts for developing this project.
By the way, Did you have experiences in vehicle logo detection with YOLO?
I am new about training with YOLO so that I wanna receive your kindly help.

Thanks and Regards, RIchardMinh.

Error: 'Tracker' object has no attribute 'R_ratio'

Hello, this is an error when I run tracker.py.

File "tracker.py", line 58, in init
self.R_diag_array = self.R_ratio * np.array

AttributeError: 'Tracker' object has no attribute 'R_ratio'

So, I want to know, where is 'R_ratio' defined?

Thank you!

When no detections are present :

I am curious to know that will kalman tracker work when no object is detected in the frame.I saw few ropo(https://github.com/abewley/sort) required detection in every frame otherwise it will leave track on object(car in this case).
So will kalman predict function will give next location even when no detection is received from detector.

Thanks in advance.

Error occur when using my own video

Dear, Mr Kcg2015, How are you?
Your project is very helpful and explanation is very detail so thanks for your efforts for developing this project.
When I run main.py to test my own video, there is something wrong.(video information as follows, test file size about 1.5GB)

qq 20190130193440

When the first frame is detected, the program terminates. The results and errors of the first frame detection are as follows:

qq 20190130193615
qq 20190130193628

I would like to ask why there is such a mistake, thank you for your solution.

                                                                                                                                                             Best.

tracking is lost

Hello,
The tracking is lost and it's not accurate, sometimes in the cars the bounding box is hidden for few frames then it continues tracking again

about matching detections and trackers

hi helper ... can I take the principle you used for matching detection and trackers and use dlib for creating a new tracker for the unmatched detection?

Tracker without constant velocity

Dear Author(kcg2015),

your work is amazing and also great in sharing your work to research community.

Here you are considering the constant velocity model in the process matrix, as shown in snapshot:
image

Here Im having few queries mentioned below:

  1. If ego vehicle is not moving in constant velocity and then how to deal for tracking the target objects?
  2. what is DELTA_T, in your code mentioned a constant value =1.

Iam able to track the object when I capture frames at 30FPS but unable to track the objects when frames are captured at 10FPS as my position is changing vsatly, so how to deal when frame rate is less around 10FPS?

Thanks for your valuable time, I eagery look forward for your response.

Thanks,
Anil.

License?

Hey,
thank you for this awesome work! However I couldn't find any license information? Is it MIT- or BSD-licensed ?

TypeError in main.py

Traceback (most recent call last):
File "main.py", line 200, in
image_box = pipeline(image)
File "main.py", line 112, in pipeline
= assign_detections_to_trackers(x_box, z_box, iou_thrd = 0.3)
File "main.py", line 56, in assign_detections_to_trackers
if (d not in matched_idx[ : ,1]):
TypeError: tuple indices must be integers or slices, not tuple

Using this for person tracking on different videos

Hi,

First of all, thanks for sharing this great work!

I am using this on other videos of people walking and I figured the following code needs to change a bit to accommodate bigger detections/bounding boxes in addition to changing the ID to 1 (person) instead of 3 (car)

in detector.py I changed # if ((ratio < 0.8) and (box_h>10)): to be if ((ratio < 2) and (box_h>20) and (box_w>20)):

but I am still not seeing tracker properly working on this by following the detected object along like in your sample video

wondering what's going on?

A question about video tracking

Hi, thanks for your amazing project, i have a question about video tracking, how can i see the different ID for car in the final output video?

low frame rate issue

For low frame rate the tracker is lagging, is there a way i can make it work for low frame videos.
Like for example changing the dt value in tracker.py

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.