Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting all detections #4

Closed
arevel190 opened this issue Aug 17, 2017 · 10 comments
Closed

Getting all detections #4

arevel190 opened this issue Aug 17, 2017 · 10 comments

Comments

@arevel190
Copy link

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.

@obendidi
Copy link
Owner

to get all detection + the people tracking, you can just change this line in darkflow to something like this :

if self.FLAGS.trackObj != mess :
       cv2.rectangle(imgcv,
			(left, top), (right, bot),
			colors[max_indx], thick)
       cv2.putText(imgcv, mess, (left, top - 12),
			0, 1e-3 * h, colors[max_indx],thick//3)
       continue

it will draw the other objects in the image as well.

@arevel190
Copy link
Author

@Bendidi Awesome, thanks. Also, is there a way to output in real time (via txt or csv file) the last ID number detected?

@obendidi
Copy link
Owner

here is the line where it writes to a csv each new box ID+ frame number + box coordinate in pixels

and as I've said here in one of my answers :

you can set the csv FLAG to true it will write at run time the ID number and 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)

@arevel190
Copy link
Author

@Bendidi Thanks again for your prompt reply. I tested this solution, but the csv table is only populated after the program has been stopped. I meant to output real time data, like a stream of values or a csv file that is constantly being populated by the new IDs.

@obendidi
Copy link
Owner

it should be fixed with the last commit 👍

@arevel190
Copy link
Author

arevel190 commented Aug 18, 2017

@Bendidi For some reason after your update I am getting a 404 error on the github repo (the darkflow folder to be specific), and it is not updating. Once again thank you very much!

@arevel190
Copy link
Author

I just double checked and the folder is up again. Now there is another error that is being generated:

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 2, in
from . import yolov2
File "/Users/pedareva1/Tracking-with-darkflow/darkflow/darkflow/net/yolov2/init.py", line 2, in
from . import predict
File "/Users/pedareva1/Tracking-with-darkflow/darkflow/darkflow/net/yolov2/predict.py", line 134
csv_file.flush()
^
TabError: inconsistent use of tabs and spaces in indentation

(Sorry for asking too many questions).

@arevel190
Copy link
Author

I just checked and could solve the error by converting indentation to spaces. Now another error pops up:

Traceback (most recent call last):
File "run.py", line 27, in
tfnet.camera()
File "/home/pedareva1/Tracking-with-darkflow/darkflow/darkflow/net/help.py", line 107, in camera
writer.writerow(['frame_id', 'track_id' , 'x', 'y', 'w', 'h'])
TypeError: a bytes-like object is required, not 'str'

I would really appreciate your help with this.

@obendidi
Copy link
Owner

in line 106 of darkflow/darkflow/net/help.py , just change the 'wb' to 'w' , I'll make the change in the repo later

It's a problem that happens when using python 3 , when I tested last time it was with python 2 ^^

@arevel190
Copy link
Author

@Bendidi Awesome, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants