kcg2015 / Vehicle-Detection-and-Tracking

Computer vision based vehicle detection and tracking using Tensorflow Object Detection API and Kalman-filtering
533 stars 191 forks source link

name 'CarDetector' is not defined #2

Closed SignalImageCV closed 6 years ago

SignalImageCV commented 6 years ago

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

kcg2015 commented 6 years ago

@SignalImageCV , let me look into this. Meanwhile, if you use Spyder IDE, you can try to run helpers.py, detector.py, and tracker.py first. Then run main.py again, see if you still get this error message. Let me know.

Best, Kyle

maearnie commented 6 years ago

Hi I also got the same error. I run helpers.py, detector.py, and tracker.py and each file got the same error

kcg2015 commented 6 years ago

@maearnie, thanks for letting me know. So you have an error message even running helpers.py?

SignalImageCV commented 6 years ago

@kcg2015 , @maearnie, I think this error was related to python Object-Oriented Programming--the combination of class, and I have fixed this error. for example, in the main.py, "det = CarDetector()" should be written as "det = detector.CarDetector()", because it is outside the detector.py. in the helpers.py, "def draw_box_label(img, bbox_cv2, box_color=(0, 255, 255), show_label=True):" should be written as "def draw_box_label(self,img, bbox_cv2, box_color=(0, 255, 255), show_label=True):"

kcg2015 commented 6 years ago

Thanks a lot, @SignalImageCV! I will look into your suggestion and fix the bug.

lad-admin commented 6 years ago

@SignalImageCV NameError: name 'draw_box_label' is not defined. I tried using your suggestion and it worked for CarDetector and did not work for draw_box_label. Is there a solved solution ? Thanks @kcg2015

lad-admin commented 6 years ago

Actually I solved it. You need to add helpers. draw_box_label in tracker.py and in main.py

3073 commented 6 years ago

This repo is very very nice and easy for beginners like me. I would have given multiple stars if it was possible. I understand most of the codes except the lines of codes from 122-162 in main.py it is better if anyone explain me. thank you.