yuanyao366 / PRP

Apache License 2.0
40 stars 10 forks source link

Error in predict_dataset.py #1

Closed BestJuly closed 4 years ago

BestJuly commented 4 years ago

I think the logic is not strict.

In the predict_dataset.py, I list several lines in the following.

count_need=16
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
start = np.random.randint(0, frame_count - count_need + 1)

There is no garantee that the frame_count is larger than the default setting 16, and it will report an error here.

File "/raid/home/taoli/exp/prp/datasets/predict_dataset.py", line 222, in loadcvvideo
    start = np.random.randint(0, frame_count - count_need + 1);
  File "mtrand.pyx", line 993, in mtrand.RandomState.randint
ValueError: low >= high

When I add the following codes

if frame_count - count_need + 1 < 1:
    start = 0
else:
    start = np.random.randint(0, frame_count - count_need + 1)

It will print too many reload msg in the command line.

BestJuly commented 4 years ago

Using a filtering function and generate a new list for training can help.