Code Monkey home page Code Monkey logo

tracking-with-darkflow's Introduction

Intro

The purpose of this little project is to add object tracking to yolov2 and achieve real-time multiple object tracking.

The current architecture is set to only track one type of objects, but it should be easy to generalise over all objects.

Currently support people tracking (as the provided weights for deep_sort were trained on people tracking)

Dependencies

python
numpy
opencv 3
tensorflow 1.0
Cython.
sklean.

for using sort :

scikit-learn

scikit-image

FilterPy

Setup

1 - Clone this repository : git clone https://github.com/bendidi/Tracking-with-darkflow.git

2 - Initialize all submodules: git submodule update --init --recursive

3 - Go to darkflow directory and do in place build: python3 setup.py build_ext --inplace

Getting started

Download the weights :

Read more about YOLO (in darknet) and download weight files here,In case the weight file cannot be found, thtrieu has uploaded some of his here, which include yolo-full and yolo-tiny of v1.0, tiny-yolo-v1.1 of v1.1 and yolo, tiny-yolo-voc of v2.

The artchitecture I used/tested in this project is cfg/yolo.cfg with the weights bin/yolo.weights.

Next you need to download the deep_sort weights here (networks folder), provided by nwojke

The deep_sort weights provided by nwojke has been cancelled. you can get them from here instead ( thanks to @louxy126 )

extract the folder and copy it to deep_sort/resources

Edit Flags in run.py following your configuration :

  • demo : path to video file to use, set to "camera" if you wish to use your camera

  • model : what model configuration to use for YOLO, you can get more information and .cfg files in here(put them in darkflow/cfg/ folder)

  • load : The corresponding weights to use with the chosen model (put them in darkflow/bin/) more info in here

  • threshold : the confidance threshold of the YOLO detections

  • gpu : How much GPU to use, 0 means use cpu

  • track : to activate tracking or Not

  • trackObj: which objects to track as a list (notice that deep_sort's encoder was only trained on people , so you need train your own encoder, more information in here)

  • saveVideo : whether to save video or not

  • BK_MOG : add opencv's MOG background subtraction module, only useful when YOLO can't detect people in a video (low quality, ...) use it to detect boxes around moving objects

  • tracker : which tracker to use : "deep_sort" or "sort"

          **NOTE** : "deep_sort" only supports people tracking as it was only trained to track people(the code for training is not yet published)
    
          **TODO** : add support for GOTURN tracker(tensorflow implementation)
    
          **TODO** : add support for opencv trackers (MIL,KCF,TLD,MEDIANFLOW)
    
  • skip : skip frames to increase fps, might decrease accuracy !

  • csv : save csv file of detections in the format (frame_id,object_id,x,y,w,h)

  • display : display video while processing or Not

Next you just have to run python run.py, and enjoy !

Some numbers :

`speed using yolo.cfg:

YOLO with track Flag set to False : 30fps

YOLO with track Flag set to True (deep_sort) : 14 fps

YOLO with track and background subtraction Flags set to True : 10.5 fps

Tests done on (1024, 1280, 3) resolution video on Nvidia GTX 1080

skipping up to 3 frames allows for more speed up while keeping accuracy of tracking`

Disclamer :

this project is using code forked from:

thtrieu/darkflow: for the real-time object detections and classifications.

nwojke/deep_sort: for Simple Online Realtime Tracking with a Deep Association Metric.

Please follow the links to get an understanding of all the features of each project.

Citation

Yolov2 :

@article{redmon2016yolo9000,
  title={YOLO9000: Better, Faster, Stronger},
  author={Redmon, Joseph and Farhadi, Ali},
  journal={arXiv preprint arXiv:1612.08242},
  year={2016}
}

deep_sort :

@article{Wojke2017simple,
  title={Simple Online and Realtime Tracking with a Deep Association Metric},
  author={Wojke, Nicolai and Bewley, Alex and Paulus, Dietrich},
  journal={arXiv preprint arXiv:1703.07402},
  year={2017}
}

sort :

@inproceedings{Bewley2016_sort,
  author={Bewley, Alex and Ge, Zongyuan and Ott, Lionel and Ramos, Fabio and Upcroft, Ben},
  booktitle={2016 IEEE International Conference on Image Processing (ICIP)},
  title={Simple online and realtime tracking},
  year={2016},
  pages={3464-3468},
  keywords={Benchmark testing;Complexity theory;Detectors;Kalman filters;Target tracking;Visualization;Computer Vision;Data Association;Detection;Multiple Object Tracking},
  doi={10.1109/ICIP.2016.7533003}
}

tracking-with-darkflow's People

Contributors

hyunmoahn avatar jumabek avatar obendidi avatar souravsharan 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

tracking-with-darkflow's Issues

Algortihm pipeline

Hi, I'm trying to understand the overall behavior of this project... It works but I don't know how.
From what I understood:

  • Using Yolo you retrive the bb coordinates for person
  • Invoking SORT to "concatenate" information between frames
  • display correct bb with ID
    (is it correct??)

what happen to this pipeline (assuming it's correct) when deep_SORT is set to True?

numpy/arrayobject.h' file not found

Hi bendidi,

First of all thanks for sharing this implementation. I followed your instructions but I got the following error when I run the 'run.py' script:

_/Users/pedareva1/.pyxbld/temp.macosx-10.6-intel-3.6/pyrex/darkflow/darkflow/cython_utils/cy_yolo_findboxes.c:475:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
^
1 error generated.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command '/usr/bin/clang' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/pyximport/pyximport.py", line 215, in load_module
inplace=build_inplace, language_level=language_level)
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/pyximport/pyximport.py", line 191, in build_module
reload_support=pyxargs.reload_support)
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/pyximport/pyxbuild.py", line 102, in pyx_to_dll
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 185, in run
_build_ext.build_ext.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 193, in build_extensions
self.build_extension(ext)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command '/usr/bin/clang' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 3, in
from darkflow.darkflow.net.build import TFNet
File "/Users/pedareva1/Tracking-with-darkflow/darkflow/darkflow/net/build.py", line 7, in
from .framework import create_framework
File "/Users/pedareva1/Tracking-with-darkflow/darkflow/darkflow/net/framework.py", line 1, in
from . import yolo
File "/Users/pedareva1/Tracking-with-darkflow/darkflow/darkflow/net/yolo/init.py", line 2, in
from . import predict
File "/Users/pedareva1/Tracking-with-darkflow/darkflow/darkflow/net/yolo/predict.py", line 9, in
from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/pyximport/pyximport.py", line 458, in load_module
language_level=self.language_level)
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/pyximport/pyximport.py", line 231, in load_module
raise exc.with_traceback(tb)
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/pyximport/pyximport.py", line 215, in load_module
inplace=build_inplace, language_level=language_level)
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/pyximport/pyximport.py", line 191, in build_module
reload_support=pyxargs.reload_support)
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/pyximport/pyxbuild.py", line 102, in pyx_to_dll
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 185, in run
_build_ext.build_ext.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 193, in build_extensions
self.build_extension(ext)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/unixccompiler.py", line 120, in compile
raise CompileError(msg)
ImportError: Building module darkflow.darkflow.cython_utils.cy_yolo_findboxes failed: ["distutils.errors.CompileError: command '/usr/bin/clang' failed with exit status 1\n"]

I would really appreciate if you could help me detect what is causing the error.

Thanks!

yolo2 and deepsort models run on the same gpu?

it seems that in this project yolo2 and deepsort models run on the same gpu, can it be configured to run different models on multiple different gpus to further improve the fps of the whole end-to-end system?

Working with different data

Hi,

I wanted to know if this same tracking approach of deep_sort can be used for tracking with RADAR data.
If it can work on this, how do I change my inputs? I want to avoid radar - camera fusion and instead pass the detections from the RADAR directly to a tracker.

Thanks!

Difficulty tracking people with occlusion by tree branches

First off, thanks for combining Darkflow with DeepSort. I'm really enjoying playing around with it.

Generally, I've found the tracking to be pretty successful when there is limited occlusion by other objects. However, I'm trying to track people when there is occlusion by tree branches (see attached screenshot). As a result, I think that Darkflow is having trouble recognizing these as people -- given the strange lines, aka branches, that are randomly oriented across their bodies. I considered finetuning the existing model with images from some of my videos, but I'm getting stuck. How do you recommend dealing with this issue?

Thanks for any direction!

screenshot from 2018-02-19 11-04-16

Error: 'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>

Hi, I follow exactly the instructions in GitHub and I have installed all the necessary software. The only difference is I use Anaconda to run the code. I got the following error after I run python run.py:

Parsing darkflow/cfg/yolo.cfg
Parsing C:/Users/User/Anaconda3/Tracking-with-darkflow-master/darkflow/cfg/yolo.cfg
Loading C:/Users/User/Anaconda3/Tracking-with-darkflow-master/darkflow/bin/yolo.weights ...
Successfully identified 203934260 bytes
Finished in 0.03131508827209473s
Model has a coco model name, loading coco labels.

Building net ...
Source | Train? | Layer description                | Output size
-------+--------+----------------------------------+---------------
       |        | input                            | (?, 608, 608, 3)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 608, 608, 32)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 304, 304, 32)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 304, 304, 64)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 152, 152, 64)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 152, 152, 128)
 Load  |  Yep!  | conv 1x1p0_1  +bnorm  leaky      | (?, 152, 152, 64)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 152, 152, 128)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 76, 76, 128)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 76, 76, 256)
 Load  |  Yep!  | conv 1x1p0_1  +bnorm  leaky      | (?, 76, 76, 128)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 76, 76, 256)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 38, 38, 256)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 38, 38, 512)
 Load  |  Yep!  | conv 1x1p0_1  +bnorm  leaky      | (?, 38, 38, 256)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 38, 38, 512)
 Load  |  Yep!  | conv 1x1p0_1  +bnorm  leaky      | (?, 38, 38, 256)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 38, 38, 512)
 Load  |  Yep!  | maxp 2x2p0_2                     | (?, 19, 19, 512)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 19, 19, 1024)
 Load  |  Yep!  | conv 1x1p0_1  +bnorm  leaky      | (?, 19, 19, 512)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 19, 19, 1024)
 Load  |  Yep!  | conv 1x1p0_1  +bnorm  leaky      | (?, 19, 19, 512)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 19, 19, 1024)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 19, 19, 1024)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 19, 19, 1024)
 Load  |  Yep!  | concat [16]                      | (?, 38, 38, 512)
 Load  |  Yep!  | conv 1x1p0_1  +bnorm  leaky      | (?, 38, 38, 64)
 Load  |  Yep!  | local flatten 2x2                | (?, 19, 19, 256)
 Load  |  Yep!  | concat [27, 24]                  | (?, 19, 19, 1280)
 Load  |  Yep!  | conv 3x3p1_1  +bnorm  leaky      | (?, 19, 19, 1024)
 Load  |  Yep!  | conv 1x1p0_1    linear           | (?, 19, 19, 425)
-------+--------+----------------------------------+---------------
GPU mode with 0.8 usage
2018-03-09 17:54:44.052582: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.
2018-03-09 17:54:44.063919: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.
2018-03-09 17:54:44.070287: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
2018-03-09 17:54:44.077970: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2018-03-09 17:54:44.082216: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2018-03-09 17:54:44.086372: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2018-03-09 17:54:44.094907: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2018-03-09 17:54:44.099137: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Finished in 7.700326442718506s

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 888, in _find_spec
AttributeError: 'PyxImporter' object has no attribute 'find_spec'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run.py", line 30, in <module>
    tfnet.camera()
  File "C:\Users\User\Anaconda3\Tracking-with-darkflow-master\darkflow\darkflow\net\help.py", line 75, in camera
    from deep_sort import generate_detections
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 951, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 890, in _find_spec
  File "<frozen importlib._bootstrap>", line 864, in _find_spec_legacy
  File "C:\Users\User\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 253, in find_module
    fp, pathname, (ext,mode,ty) = imp.find_module(fullname,package_path)
  File "C:\Users\User\Anaconda3\lib\imp.py", line 271, in find_module
    "not {}".format(type(path)))
RuntimeError: 'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>

Does anyone have any clue? Thanks for the help....

On using camera: AttributeError: 'NoneType' object has no attribute 'update'

While using a video file the program was running successfully. But when I changed it to use web cam the following error occurs.

Press [ESC] to quit video
Traceback (most recent call last):
File "run.py", line 32, in
tfnet.camera()
File "/home/vuelogix/Documents/Tracking-with-darkflow-master/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 124, in camera
fps = 1 / self._get_fps(frame)
File "/home/vuelogix/Documents/Tracking-with-darkflow-master/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 66, in _get_fps
processed = self.framework.postprocess(net_out, frame)
File "/home/vuelogix/Documents/Tracking-with-darkflow-master/Tracking-with-darkflow/darkflow/darkflow/net/yolov2/predict.py", line 127, in postprocess
trackers = tracker.update(detections)
AttributeError: 'NoneType' object has no attribute 'update'

Can anyone find the reason for this?
Thanks.

Getting csv of other predictions

Hi,

I wanted to know if it is possible to get a real time csv file (no need to be tracked) of all the objects darkflow detects. This would be super useful for context analysis.

Thank you very much!

where is tiny-yolo-voc-traffic.pb and tiny-yolo-voc-traffic.meta

I find run.py is updated.

-# FLAGS.model = "darkflow/cfg/yolo.cfg" # tensorflow model
-# FLAGS.load = "darkflow/bin/yolo.weights" # tensorflow weights
-FLAGS.pbLoad = "tiny-yolo-voc-traffic.pb" # tensorflow model
-FLAGS.metaLoad = "tiny-yolo-voc-traffic.meta" # tensorflow weights

could you share the file of tiny-yolo-voc-traffic.pb and tiny-yolo-voc-traffic.meta ?
thank you very much!

how to track cars?

hello, I have a work to track people, cars, but deep sort only track people,how to track cars and people at the same time? do you train the model?

one line code in yolo2/predict.py

def extract_boxes(self,new_im):
cont = []
new_im=new_im.astype(np.uint8)
ret, thresh=cv2.threshold(new_im, 127, 255, 0)
p, contours, hierarchy=cv2.findContours(
thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
for i in range(0, len(contours)):
cnt=contours[i]
x, y, w, h=cv2.boundingRect(cnt)
if w*h > 30**2 and ((w < new_im.shape[0] and h <= new_im.shape[1]) or (w <= new_im.shape[0] and h < new_im.shape[1])):
if self.FLAGS.tracker == "sort":
cont.append([x, y, x+w, y+h])
else : cont.append([x, y, x, y])
return cont

this line else : cont.append([x, y, x, y]) is correct?
or should be
else : cont.append([x, y, x, y])

`AttributeError: 'NoneType' object has no attribute 'astype' ` occurs after running run.py

Here is my traceback:

Traceback (most recent call last):
  File "run.py", line 30, in <module>
    tfnet.camera()
  File "/home/nisheetsinvhal/Desktop/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 124, in camera
    fps = 1 / self._get_fps(frame)
  File "/home/nisheetsinvhal/Desktop/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 66, in _get_fps
    processed = self.framework.postprocess(net_out, frame)
  File "/home/nisheetsinvhal/Desktop/Tracking-with-darkflow/darkflow/darkflow/net/yolov2/predict.py", line 107, in postprocess
    detections = detections + extract_boxes(self,mask)
  File "/home/nisheetsinvhal/Desktop/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'

This is my run.py

from darkflow.darkflow.defaults import argHandler #Import the default arguments
import os
from darkflow.darkflow.net.build import TFNet


FLAGS = argHandler()
FLAGS.setDefaults()

FLAGS.demo = "camera" # video file to use, or if camera just put "camera"
FLAGS.model = "darkflow/cfg/yolo-voc.cfg" # tensorflow model
FLAGS.load = "darkflow/bin/yolo-voc.weights" # tensorflow weights
# FLAGS.pbLoad = "tiny-yolo-voc-traffic.pb" # tensorflow model
# FLAGS.metaLoad = "tiny-yolo-voc-traffic.meta" # tensorflow weights
FLAGS.threshold = 0.7 # threshold of decetion confidance (detection if confidance > threshold )
FLAGS.gpu = 0 #how much of the GPU to use (between 0 and 1) 0 means use cpu
FLAGS.track = True # wheither to activate tracking or not
FLAGS.trackObj = ['Bicyclist','Pedestrian','Skateboarder','Cart','Car','Bus'] # the object to be tracked
#FLAGS.trackObj = ["person"]
FLAGS.saveVideo = True  #whether to save the video or not
FLAGS.BK_MOG = True # activate background substraction using cv2 MOG substraction,
                        #to help in worst case scenarion when YOLO cannor predict(able to detect mouvement, it's not ideal but well)
                        # helps only when number of detection < 3, as it is still better than no detection.
FLAGS.tracker = "sort" # wich algorithm to use for tracking deep_sort/sort (NOTE : deep_sort only trained for people detection )
FLAGS.skip = 2 # how many frames to skipp between each detection to speed up the network
FLAGS.csv = False #whether to write csv file or not(only when tracking is set to True)
FLAGS.display = True # display the tracking or not

tfnet = TFNet(FLAGS)

tfnet.camera()
exit('Demo stopped, exit.')

In addition to this I had changed the /darkflow/net/help.py a little bit for the new opencv
Line 88: fgbg = cv2.createBackgroundSubtractorMOG2()

Any idea how to solve the traceback error?

getting error in in tensorflow v 1.3

Please confirm, does this work later versions of TF as well?

I am getting following error when python run.py

feature dimensionality:  128
2017-12-07 17:34:08.821323: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1045] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1080, pci bus id: 0000:03:00.0)
2017-12-07 17:34:08.821453: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1045] Creating TensorFlow device (/gpu:1) -> (device: 1, name: GeForce GTX 1080, pci bus id: 0000:04:00.0)
Press [ESC] to quit demo
2017-12-07 17:34:11.043341: E C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\stream_executor\cuda\cuda_dnn.cc:371] could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED
2017-12-07 17:34:11.043522: E C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\stream_executor\cuda\cuda_dnn.cc:375] error retrieving driver version: Unimplemented: kernel reported driver version not implemented on Windows
2017-12-07 17:34:11.045137: E C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\stream_executor\cuda\cuda_dnn.cc:338] could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM
2017-12-07 17:34:11.046425: F C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\kernels\conv_ops.cc:672] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(), &algorithms)

Change the video/csv output filename to handle inputs from relative path

I'm totally not familiar with pull request or relevant GitHub functions, so I decided to post my minor modification here.

Several days ago I was trying to run the code with a video as the input, but got some errors about writing the output video. After some tracking, I found the reason was the file name coded in darkflow/darkflow/net/help.py could not handle filenames from relative path.

The original output filename was 'output_{}'.format(file) and it could produce something like output_../..//RELATIVE/PATH/INPUT/VIDEO.avi and therefore caused problems.

So I changed the code as the following:

--- videoWriter = cv2.VideoWriter(
---     'output_{}'.format(file), fourcc, fps, (width, height))

+++ output_vid_file = 'output_{}'.format(os.path.basename(file))
+++ print('Saving output video to {}...'.format(output_vid_file))
+++ videoWriter = cv2.VideoWriter(output_vid_file, fourcc, fps, (width, height))

Also, to be consistent and make all the output files be in the same folder of run.py, I also modified the csv part as follows:

--- f = open('{}.csv'.format(file),'w')

+++ output_csv_file = 'output_{}.csv'.format( os.path.splitext( os.path.basename(file) )[0] )
+++ print('Saving output video to {}...'.format(output_csv_file))
+++ f = open(output_csv_file,'w')

Hope this will help.

error while running the second time

Hi

I have modified run.py by defining a function run(videoPath) which takes video as an input and assign that to FLAGS.demo and runs the original Tracking-with-darkflow.

Now, If I call this run(videoPath) for the first time it runs properly but for the second time, it throws the error.

I have attached code and error to this post. Can you please help in solving this error.

Thanks in advance.

# run.py

from darkflow.darkflow.defaults import argHandler  # Import the default arguments
import os
from darkflow.darkflow.net.build import TFNet

def run(videoPath):

    FLAGS = argHandler()
    FLAGS.setDefaults()

    FLAGS.demo = videoPath # video file to use, or if camera just put "camera"
    FLAGS.model = "darkflow/cfg/yolo.cfg" # tensorflow model
    FLAGS.load = "darkflow/bin/yolo.weights" # tensorflow weights
    FLAGS.threshold = 0.35 # threshold of decetion confidance (detection if confidance > threshold )
    FLAGS.gpu = 0 #how much of the GPU to use (between 0 and 1) 0 means use cpu
    FLAGS.track = True # wheither to activate tracking or not
    FLAGS.trackObj = "person" # the object to be tracked
    FLAGS.saveVideo = False  #whether to save the video or not
    FLAGS.BK_MOG = False # activate background substraction using cv2 MOG substraction,
                            #to help in worst case scenarion when YOLO cannor predict(able to detect mouvement, it's not ideal but well)
                            # helps only when number of detection < 5, as it is still better than no detection.
    FLAGS.tracker = "deep_sort" # wich algorithm to use for tracking deep_sort/sort (NOTE : deep_sort only trained for people detection )
    FLAGS.skip = 0 # how many frames to skipp between each detection to speed up the network
    FLAGS.csv = True #whether to write csv file or not(only when tracking is set to True)
    FLAGS.display = True # display the tracking or not

    tfnet = TFNet(FLAGS)

    tfnet.camera()
    # exit('Demo stopped, exit.')

print("Running for the first time")
run("data/test_1.avi")

print("Running for the second time")
run("data/test_2.avi")

twd-error

.csv result

  1. bug1
    bug

track_id from 7 to 18? may be is 8?


  1. bug2
    bug2
    x is -59?

I want to track by using deep_sort or sort, but have some errors

In the run.py, whatever I set FLAGS.tracker = "deep_sort" or set FLAGS.tracker = "sort", the tracker can not work, and show that:
File "/home/xx/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 88, in camera fgbg = cv2.bgsegm.createBackgroundSubtractorMOG() AttributeError: module 'cv2.cv2' has no attribute 'bgsegm'

So then, I set FLAGS.BK_MOG = False, but still can not work, and shows that:
` File "/home/xx/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 639, in _get_single_variable
name, "".join(traceback.format_list(tb))))

ValueError: Variable ball/mean_vectors already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

File "/home/xx/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 225, in variable
partitioner=partitioner)
File "/home/xx/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 177, in func_with_args
return func(*args, **current_args)
File "/home/xx/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 268, in model_variable
partitioner=partitioner, custom_getter=custom_getter)`
Do you have the same errors, and how do you solve them?

print class value for python

I want to print the detections class
but it show the
[<deep_sort.deep_sort.detection.Detection object at 0x7f87fe29c710>]

have any method to print value of class?

Testing video on 2 Gerforce GTX Titan x

YOLO with track Flag set to False : 7fps

YOLO with track Flag set to True (deep_sort) : 6 fps

YOLO with track and background subtraction Flags set to Ture : 7 fps

My testing FPS is much lower than yours,
what is the reason?

Does this project work with uav data

Hi bendidi,

Thank you for your work.

Does this project work with uav data(such as http://cvgl.stanford.edu/projects/uav_data/ )? I'm trying it with my own video file. It does not work well. Maybe I should train the classifier net with my own data set.
Could you provide any clue to train SORT or use pretrained weights (since deep sort training code is not available)?

Thanks.

Getting all detections

Hi,

I would like to know if there is a way to get the other detections as well while getting the people count? I am interested in having a way to get info on the context (no need to be tracked), as well as the unique number of people.

Thanks a lot for your help.

Using Camera Error

Dear @Bendidi,
Thank you for your fantastic work. when I use your code via the below parameters, I got the following error. Would you please kindly help me to address this problem?
My Used Parameter:

FLAGS.demo = "camera"  # video file to use, or if camera just put "camera"
FLAGS.model = "./cfg/yolo-voc.cfg" 
FLAGS.load = "./bin/yolo-voc.weights" 
FLAGS.threshold = 0.5  # threshold of decetion confidance (detection if confidance > threshold )
FLAGS.gpu = 0.8  # how much of the GPU to use (between 0 and 1) 0 means use cpu
FLAGS.track = False  # whether to activate tracking or not
# FLAGS.trackObj = ['Bicyclist','Pedestrian','Skateboarder','Cart','Car','Bus'] # the object to be tracked
FLAGS.trackObj = ["person"]  # for VOC weights
FLAGS.saveVideo = False   # whether to save the video or not
FLAGS.BK_MOG = False  
FLAGS.tracker = "deep_sort" # wich algorithm to use for tracking deep_sort/sort (NOTE : deep_sort only trained for people detection )
FLAGS.skip = 0  # how many frames to skipp between each detection to speed up the network
FLAGS.csv = False  # whether to write csv file or not(only when tracking is set to True)
FLAGS.display = False  # display the tracking or not

The Error:

Traceback (most recent call last):
  File ".../anaconda3/bin/flow", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File ".../YoLo-DarkFlow Object Detector/darkflow/flow", line 6, in <module>
    cliHandler(sys.argv)
  File ".../YoLo-DarkFlow Object Detector/darkflow/darkflow/cli.py", line 25, in cliHandler
    tfnet.camera()
  File ".../YoLo-DarkFlow Object Detector/darkflow/darkflow/net/help.py", line 122, in camera
    single_out, img, False)
  File ".../YoLo-DarkFlow Object Detector/darkflow/darkflow/net/yolov2/predict.py", line 65, in postprocess
    fileName = os.path.basename(im)[:-4] + str(uuid.uuid4())
  File ".../anaconda3/lib/python3.6/posixpath.py", line 144, in basename
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not numpy.ndarray

It is worth noting that I have checked the script to test if camera is running on OpenCV, and it worked correctly. However, when I run the darkflow with flow --model cfg/yolo-voc.cfg --load bin/yolo-voc.weights --demo camera --gpu 1.0, I got the same error as above!!!

Getting error when trying to run mulitple videos from folder

Run.py

from darkflow.darkflow.defaults import argHandler #Import the default arguments
import os
from darkflow.darkflow.net.build import TFNet
#import tensorflow as tf

topdir = 'C:\Users\13067_000\Downloads\Videos'
FLAGS = argHandler()
FLAGS.setDefaults()

for dirpath, dirnames, files in os.walk(topdir):
for name in files:
#tf.reset_default_graph()
FLAGS.demo = "C:\Users\13067_000\Downloads\Videos\"+name# video file to use, or if camera just put "camera"
FLAGS.model = "darkflow/cfg/yolo.cfg" # tensorflow model
FLAGS.load = "darkflow/bin/yolo.weights" # tensorflow weights
FLAGS.threshold = 0.5 # threshold of decetion confidance (detection if confidance > threshold )
FLAGS.gpu = 0.75 #how much of the GPU to use (between 0 and 1) 0 means use cpu
FLAGS.track = True # wheither to activate tracking or not
FLAGS.trackObj = "person" # the object to be tracked
FLAGS.saveVideo = True #whether to save the video or not
FLAGS.BK_MOG = False # activate background substraction using cv2 MOG substraction,
#to help in worst case scenarion when YOLO cannor predict(able to detect mouvement, it's not ideal but well)
# helps only when number of detection < 5, as it is still better than no detection.
FLAGS.tracker = "deep_sort" # wich algorithm to use for tracking deep_sort/sort (NOTE : deep_sort only trained for people detection )
FLAGS.skip = 3# how many frames to skipp between each detection to speed up the network
FLAGS.csv = True #whether to write csv file or not(only when tracking is set to True)
FLAGS.display = True # display the tracking or not
tfnet = TFNet(FLAGS)
tfnet.camera()
exit('Demo stopped, exit.')

Error:
ValueError: Variable conv1_1/weights already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:

File "C:\Python35\lib\site-packages\tensorflow\python\framework\ops.py", line 1470, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
File "C:\Python35\lib\site-packages\tensorflow\python\framework\ops.py", line 2956, in create_op
op_def=op_def)
File "C:\Python35\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)

Please help me in running darkflow for multiple videos

Object Tracking

Hi,

I wanted to know if there is a clear path / tutorial that I could follow to train deep sort on detecting my own categories, like logos or objects?

Thanks a lot for your help :)

deep sort can track cars?

hello, bendidi,
I use you code of YOLO +deep sort to track videos with cars, and the result is good, the code can track cars, I don't konw why?
Do you know other algorithm for tracking cars and people? thanks!

ID csv location

Hi,

I wanted to know where in the code is the ID csv file being generated.

Thanks a lot!

Performance in terms of objects

I wanted to know how many objects can be tracked in each frame as the README doesn't clearly state it.

Also, I wanted to know if this can be extended to track objects of different classes. Like, people, animals simultaneously. (Yolo can do that, but can the tracking keep the IDs?)

Thanks

Attempted to use a closed Session

Hello, I run the deep sort in py-faster-rcnn, but there are error when use the generate_detections.create_box_encoder get the encoder about "Attempted to use a closed Session", are you get this error, thanks

can't track the objects when I use the sort

when i use the sort ,FLAGS.track =True,FLAGS.BK_MOG = False ,it can't show the tracking boxes in the video, when I set FLAGS.track =True and FLAGS.BK_MOG =True,it can show same error boxes, so I wonder the code of sort doesn't receive the detecting boxes of darkflow or not ,when I use the deep_sort ,It can work. is there some problems of the code of sort-with-darkflow?

if SaveVideo true there's exception thrown

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.')

AttributeError: 'module' object has no attribute 'bgsegm'

This error was generated when I run the file

Running entirely on CPU
2018-02-20 11:13:14.834956: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
Finished in 5.81529521942s
Traceback (most recent call last):
File "run.py", line 30, in
tfnet.camera()
File "/home/itsme/Documents/Tracking-with-darkflow-master/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 88, in camera
fgbg = cv2.bgsegm.createBackgroundSubtractorMOG()
AttributeError: 'module' object has no attribute 'bgsegm'

Can anybody tell whats the issue?

ID Numbers

Hi,

I would like to know if there is a way to mitigate the problem of getting the IDs to jump to much from number. I am currently using your code and whenever a new person enters the frame the ID number tends to jump at least 10 numbers up.

Thanks!

can't track the objects when I use the sort

when i use the sort ,FLAGS.track =True,FLAGS.BK_MOG = False ,it can't show the tracking boxes in the video, but when i set FLAGS.track =False and FLAGS.BK_MOG = False , it can show the darkflow detecting boxes, when I set FLAGS.track =True and FLAGS.BK_MOG =True,it can show same error boxes, so I wonder the code of sort doesn't receive the detecting boxes of darkflow or not ,when I use the deep_sort ,It can work. is there some problems of the code of sort-with-darkflow?

error when tracking other objects by using sort

HI,bendidi! I met some problem when trying to track cars.
9.893 FPSTraceback (most recent call last):
File "run.py", line 26, in
tfnet.camera()
File "F:\Tracking-with-darkflow\darkflow\darkflow\net\help.py", line 171, in camera
encoder=encoder,tracker=tracker)
File "F:\Tracking-with-darkflow\darkflow\darkflow\net\yolov2\predict.py", line 124, in postprocess
trackers = tracker.update(detections)
File "F:\Tracking-with-darkflow\sort\sort.py", line 213, in update
trk.update(dets[d,:][0])
IndexError: too many indices for array
I use python3.5,am i use the wrong version of python?
thank you!

support for KCF

TODO : add support for opencv trackers (MIL,KCF,TLD,MEDIANFLOW)
Thank you very much for releasing code. Could you give me some introductions about it?
image
Should I just embed the KCF to here?

Couldn't import dot_parser, loading of dot files will not be possible.

Couldn't import dot_parser, loading of dot files will not be possible.
/home/zhihui/.pyxbld/temp.linux-x86_64-2.7/pyrex/darkflow/darkflow/cython_utils/cy_yolo_findboxes.c:435:31: fatal error: numpy/arrayobject.h: No such file or directory
#include "numpy/arrayobject.h"
^
compilation terminated.
Traceback (most recent call last):
File "run.py", line 3, in
from darkflow.darkflow.net.build import TFNet
File "/home/zhihui/Jillian/Programes/Tracking-with-darkflow/darkflow/darkflow/net/build.py", line 7, in
from .framework import create_framework
File "/home/zhihui/Jillian/Programes/Tracking-with-darkflow/darkflow/darkflow/net/framework.py", line 1, in
from . import yolo
File "/home/zhihui/Jillian/Programes/Tracking-with-darkflow/darkflow/darkflow/net/yolo/init.py", line 2, in
from . import predict
File "/home/zhihui/Jillian/Programes/Tracking-with-darkflow/darkflow/darkflow/net/yolo/predict.py", line 9, in
from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor
File "/usr/local/lib/python2.7/dist-packages/pyximport/pyximport.py", line 445, in load_module
language_level=self.language_level)
File "/usr/local/lib/python2.7/dist-packages/pyximport/pyximport.py", line 234, in load_module
exec("raise exc, None, tb", {'exc': exc, 'tb': tb})
File "/usr/local/lib/python2.7/dist-packages/pyximport/pyximport.py", line 216, in load_module
inplace=build_inplace, language_level=language_level)
File "/usr/local/lib/python2.7/dist-packages/pyximport/pyximport.py", line 192, in build_module
reload_support=pyxargs.reload_support)
File "/usr/local/lib/python2.7/dist-packages/pyximport/pyxbuild.py", line 102, in pyx_to_dll
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/old_build_ext.py", line 185, in run
_build_ext.build_ext.run(self)
File "/usr/lib/python2.7/distutils/command/build_ext.py", line 337, in run
self.build_extensions()
File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/old_build_ext.py", line 193, in build_extensions
self.build_extension(ext)
File "/usr/lib/python2.7/distutils/command/build_ext.py", line 496, in build_extension
depends=ext.depends)
File "/usr/lib/python2.7/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/usr/lib/python2.7/distutils/unixccompiler.py", line 122, in _compile
raise CompileError, msg
ImportError: Building module darkflow.darkflow.cython_utils.cy_yolo_findboxes failed: ["CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n"]

I inplace with python2.7, and no error after inplace, but when I run the run.py, it display errors. What should I do?
Thanks a lot

ImportError: No module named 'darkflow.cython_utils'

I installed the repo and build dependences on a clean docker container, according to the instructions in the readme.md.

When I executed the python3 run.py, I got the following error message.

Traceback (most recent call last):
  File "run.py", line 5, in <module>
    from darkflow.darkflow.net.build import TFNet
  File "/workspace/Tracking-with-darkflow/darkflow/darkflow/net/build.py", line 7, in <module>
    from .framework import create_framework
  File "/workspace/Tracking-with-darkflow/darkflow/darkflow/net/framework.py", line 1, in <module>
    from . import yolo
  File "/workspace/Tracking-with-darkflow/darkflow/darkflow/net/yolo/__init__.py", line 2, in <module>
    from . import predict
  File "/workspace/Tracking-with-darkflow/darkflow/darkflow/net/yolo/predict.py", line 9, in <module>
    from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor
  File "darkflow/cython_utils/cy_yolo_findboxes.pyx", line 1, in init darkflow.cython_utils.cy_yolo_findboxes
ImportError: No module named 'darkflow.cython_utils'

I also tried to install darkflow form thtrieu directly and got the same error.

I've searched similar issues both on Google and Stack overflow, but I don't find a feasible solution.

How to solve Windows 10 error: Cannot open include file: 'numpy/arrayobject.h': No such file or directory

Hi @Bendidi ,
I am trying to run the demo, however python run.py giving me following errors:

cy_yolo_findboxes.c C:\Users\jumab\.pyxbld\temp.win-amd64-3.5\Release\pyrex\darkflow\darkflow\cython_utils\cy_yolo_findboxes.c(475): fatal error C1083: Cannot open include file: 'numpy/arrayobject.h': No such file or directory Traceback (most recent call last): File "C:\Anaconda3\envs\tensorflow\lib\distutils\_msvccompiler.py", line 382, in compile self.spawn(args) File "C:\Anaconda3\envs\tensorflow\lib\distutils\_msvccompiler.py", line 501, in spawn return super().spawn(cmd) File "C:\Anaconda3\envs\tensorflow\lib\distutils\ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "C:\Anaconda3\envs\tensorflow\lib\distutils\spawn.py", line 38, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "C:\Anaconda3\envs\tensorflow\lib\distutils\spawn.py", line 81, in _spawn_nt "command %r failed with exit status %d" % (cmd, rc)) distutils.errors.DistutilsExecError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

I know another issue had the same problem, but my OS is windows 10 this time.

new trained tiny-yolo-voc model, track problem

I trained the new Yolo model. I just modified the following 2 aspects(filters and classes) in tiny-yolo-voc.cfg file as picture show. I want to track one of the classes we have labeled.
image
But there are some problems
image
Could you help me to solve this problem? Thank you very much.

Why using the GPU can not display the output window, but the CPU can?

I use the MOT test video, when I let FLAGS.gpu = 0, the program can output the normal display window, and save the video. But when I use the GPU(FLAGS.gpu = 0.8), the program works without any output (without any warning or error), does not output a display window but saves a video file with no content. Thank you for taking the time to help me solve the problem.

System:Win10
GPU:1050TI
CUDA: cuda_8.0.61
cudnn:cudnn v6.0

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.