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

Using Camera Error #51

Closed ahkarami closed 6 years ago

ahkarami commented 6 years ago

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!!!

ahkarami commented 6 years ago

By updating darkflow the problem has been addressed.