obendidi / Tracking-with-darkflow

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

Object Tracking #2

Closed arevel190 closed 7 years ago

arevel190 commented 7 years ago

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 :)

obendidi commented 7 years ago

the training code is not yet published by the authors of deep_sort, you can find more information here and here

EDIT : Alternatively you can use sort for the object tracking, it's not as accurate as deep_sort , but it should do the trick, I will be adding it to the repo some time soon

arevel190 commented 7 years ago

@bendidi I'll have a look into Sort. Also, is there a way to output the ID number to a txt file or print it?

Once again thank you for your help!

obendidi commented 7 years ago

you can set the csv FLAG to true it will write at run time the ID number ans the corresponding box in a csv file as mentioned in ReadMe :

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

obendidi commented 7 years ago

I've added sort to the project , you can test it by setting FLAGS.tracker = "sort" and changing FLAGS.trackObj = "people" to the object you want to track

arevel190 commented 7 years ago

@bendidi I just used the code you provided and now I am getting the following error:

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 3, in from . import help File "/Users/pedareva1/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 68 def camera(self): ^ SyntaxError: import * only allowed at module level

I really appreciate your help.

obendidi commented 7 years ago

@arevel190 it should be working now ! Tested on my machine with python2 & 3 , and i had no problem

arevel190 commented 7 years ago

@bendidi Hi, I tried reinstalling your git but now when I initialize all submodules I get the following error:

_Submodule 'darkflow' (https://github.com/bendidi/darkflow) registered for path 'darkflow' Submodule 'deep_sort' (https://github.com/bendidi/deep_sort.git) registered for path 'deep_sort' Submodule 'sort' (https://github.com/bendidi/sort.git) registered for path 'sort' Cloning into '/Users/pedareva1/Tracking-with-darkflow/darkflow'... Cloning into '/Users/pedareva1/Tracking-with-darkflow/deepsort'... Cloning into '/Users/pedareva1/Tracking-with-darkflow/sort'... error: Server does not allow request for unadvertised object 225c4eb02a10caa375d2f76c185a34750a57fa61 Fetched in submodule path 'darkflow', but it did not contain 225c4eb02a10caa375d2f76c185a34750a57fa61. Direct fetching of that commit failed.

Once again, thank you very much for your constant help.

obendidi commented 7 years ago

it should propably work now, I've removed darkflow and re-added it so there shouldn't be a problem(Althrough I still don't understand why it wasn't working in the first place )

arevel190 commented 7 years ago

@bendidi I just tested it again and it is working fine when I use deep_sort. But when I use sort I get this error:

_Traceback (most recent call last): File "run.py", line 27, in tfnet.camera() File "/Users/pedareva1/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 83, in camera from sort.sort import Sort File "/Users/pedareva1/Tracking-with-darkflow/sort/sort.py", line 23, in import matplotlib.pyplot as plt File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/matplotlib/pyplot.py", line 115, in _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/matplotlib/backends/init.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "/Users/pedareva1/envs/cv2/lib/python3.6/site-packages/matplotlib/backends/backend_macosx.py", line 19, in from matplotlib.backends import macosx RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

Thanks a lot for your help.

obendidi commented 7 years ago

I can't really help in this case as this an error specific for python in Mac OS, you can start with doing what they said :

´please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.´

arevel190 commented 7 years ago

@bendidi Sounds good. I will try to test it on a Windows and Linux Machine to see how it goes. Thanks a lot for your help!