theAIGuysCode / yolov4-deepsort

Object tracking implemented with YOLOv4, DeepSort, and TensorFlow.
GNU General Public License v3.0
1.31k stars 745 forks source link

DeepSORT-YOLOv4 with OpenVINO #118

Open hardik0 opened 2 years ago

hardik0 commented 2 years ago

Hey @MatPiech,

Can you please help me. I tried you code but I facing issue with openvino model, I follow all your instructions but I get this error:

[ INFO ] Loading network
[ INFO ] Preparing inputs
[ INFO ] Loading model to the plugin
[ INFO ] OpenVINO model loaded!
Frame #:  1
WARNING: Failed to extract image patch: [    0.     0.  1227. -2186.].
WARNING: Failed to extract image patch: [    0.     0.  1920. -2656.].
WARNING: Failed to extract image patch: [    0.     0.  1920. -2675.].
WARNING: Failed to extract image patch: [    0.  2816.  1338. -1736.].
WARNING: Failed to extract image patch: [    0.     0.  1920. -2509.].
WARNING: Failed to extract image patch: [    0.     0. -1279. -1163.].
WARNING: Failed to extract image patch: [    0.     0.  1920. -2418.].
WARNING: Failed to extract image patch: [ 5762.     0. -3842. -1719.].
WARNING: Failed to extract image patch: [   0. 1144. 1920.  -64.].
WARNING: Failed to extract image patch: [   0. 1398. 1920. -318.].
WARNING: Failed to extract image patch: [   0. 1497. 1920. -417.].

Traceback (most recent call last):
  File "object_tracker.py", line 238, in <module>
    main()
  File "C:\ProgramData\Anaconda3\lib\site-packages\click\core.py", line 829, in
__call__
    return self.main(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\click\core.py", line 782, in
main
    rv = self.invoke(ctx)
  File "C:\ProgramData\Anaconda3\lib\site-packages\click\core.py", line 1066, in
 invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\ProgramData\Anaconda3\lib\site-packages\click\core.py", line 610, in
invoke
    return callback(*args, **kwargs)
  File "object_tracker.py", line 158, in main
    features = encoder(frame, bboxes)
  File "V:\DeepSORT-YOLOv4-TensorRT-OpenVINO\d_tools\generate_detections.py", line 156, in encoder
    patch = extract_image_patch(image, box, image_shape[:2])
  File "V:\DeepSORT-YOLOv4-TensorRT-OpenVINO\d_tools\generate_detections.py", line 74, in extract_image_patch
    image = cv2.resize(image, tuple(patch_shape[::-1]))
cv2.error: OpenCV(4.5.4-dev) D:\a\opencv-python\opencv-python\opencv\modules\cor
e\src\matrix.cpp:466: error: (-215:Assertion failed) _step >= minstep in functio
n 'cv::Mat::Mat'
MatPiech commented 2 years ago

Hi @hardik0, It looks like you have incorrect detection's bounding boxes (at least one value in the detection box is negative - as you show in part of output with WARNING). Do you check for example on a single frame if after each step of model conversion objects are still detected?

asdsdk commented 2 years ago

Hi @hardik0 @MatPiech, May I know the reference for implementing deepsort in OpenVINO?Because I couldn't find the guide from the code. Thank you

MatPiech commented 2 years ago

@asdsdk the DeepSORT doesn't have an implementation in OpenVINO so far. It was run using TensorFlow, only object detector (YOLOv4) was used in OpenVINO format.