anushkadhiman / YOLOv3-TensorFlow-2.x

YOLOv3 implementation in TensorFlow 2 version.
https://medium.com/analytics-vidhya/yolov3-object-detection-in-tensorflow-2-x-8a1a104c46a8
16 stars 16 forks source link

Prediction only works on first frame of video #2

Open topinfrassi01 opened 2 years ago

topinfrassi01 commented 2 years ago

Hi,

I had problems with your DeepSORT repo : https://github.com/anushkadhiman/ObjectTracking-DeepSORT-YOLOv3-TF2 and while searching for the problem I saw that the problem came from the Yolo code.

If I run the detect_video function instead of detect_image (with the following parameter: detect_video(yolo, 'test.mp4', 'test_2.mp4', show=True, input_size=YOLO_INPUT_SIZE, rectangle_colors=(255,0,0))

The bounding boxes only have values for the first frame of the video, after that all bounding boxes have NaN values and don't appear on the output video.

I'll try to look more into the problem to see if I can find the solution, but it's pretty weird.

topinfrassi01 commented 2 years ago

I've made a test where I call Yolo = Load_Yolo_model() before every prediction and it works (although it's very slow).

So I think there might be a state change when the model is called for the first time and it makes it not work for all subsequent calls.

zoendev commented 2 years ago

Hi, How can I solve this problem? (Without this method -call the model every prediction.)

topinfrassi01 commented 2 years ago

I think our best bet is to use another repo.