obendidi / Tracking-with-darkflow

Real-time people Multitracker using YOLO v2 and deep_sort with tensorflow
GNU General Public License v3.0
524 stars 174 forks source link

if SaveVideo true there's exception thrown #29

Open gnoopy opened 6 years ago

gnoopy commented 6 years ago

Hi bendidi, first of all, I would like to thank you for your sharing precious code and experiences. Recently I am enjoying your code to play around for people tracking algorithm.

I faced one exception today. So I wanna get some advice from you.

if I turn off the FLAGS.saveVideo, it works fine. Once FLAGS.saveVideo is True, python run.py throw one exception like below. Can I ask your opinion where I need to change in the code ?

File "run.py", line 30, in tfnet.camera() File "/ai/track/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 125, in camera fps = 1 / self._get_fps(frame) File "/ai/track/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 66, in _get_fps processed = self.framework.postprocess(net_out, frame) File "/ai/track/Tracking-with-darkflow/darkflow/darkflow/net/yolov2/predict.py", line 110, in postprocess detections = detections + extract_boxes(self,mask) File "/ai/track/Tracking-with-darkflow/darkflow/darkflow/net/yolov2/predict.py", line 40, in extract_boxes new_im=new_im.astype(np.uint8) AttributeError: 'NoneType' object has no attribute 'astype'

My configuration is like below.

FLAGS.demo = "camera" FLAGS.model = "darkflow/cfg/yolo.cfg" FLAGS.load = "darkflow/bin/yolo.weights" FLAGS.threshold = 0.4 FLAGS.gpu = 0.7 FLAGS.track = True FLAGS.trackObj = ["person"] #,"bottle","tvmonitor","remote","book","cellphone"] FLAGS.saveVideo = True FLAGS.BK_MOG = True FLAGS.tracker = "deep_sort" FLAGS.skip = 0 FLAGS.csv = False FLAGS.display = True tfnet = TFNet(FLAGS) tfnet.camera() exit('Demo stopped, exit.')

hiankun commented 6 years ago

I have forgotten my error message, but your problem looks like what I had encountered.

My code modification to solve the "save video" error was posted at issue https://github.com/bendidi/Tracking-with-darkflow/issues/36 .

Hope this helps.