abramjos / Scene-boundary-detection

Implementation of the paper 'Ridiculously Fast Shot Boundary Detection with Fully Convolutional Neural Networks' from scratch.
60 stars 18 forks source link

Issue when running `model.py` #5

Open ranka47 opened 4 years ago

ranka47 commented 4 years ago

https://github.com/abramjos/Scene-boundary-detection/blob/f781c95fb3f23026dd0f99d0bb7a87a533f01c25/model.py#L61

Here, the data_gen only returns "Done" https://github.com/abramjos/Scene-boundary-detection/blob/f781c95fb3f23026dd0f99d0bb7a87a533f01c25/datagen.py#L126 as a result of which it fails with the error

Traceback (most recent call last):
  File "model.py", line 115, in <module>
    train_model.train()
  File "model.py", line 61, in train
    for image_64,prediction in tqdm(gen.data_gen(),total=gen.len):
ValueError: not enough values to unpack (expected 2, got 1)

Is there any modification required here? Or should I yield an image and its prediction?

abramjos commented 4 years ago

Yes. I think you should use yield in the while loop if it finds the csv data.

ranka47 commented 4 years ago

Great. Thanks for that.

Another question is the use of columns cut and transition in the sample_video_csv_gen.py. What I observed from the datagen.py code and the paper is that generated CSV should contain only those frames that are first frame of the new shot in case of an abrupt transition or the frames of a gradual transition.

The value of the prediction being put here is a tuple (1,0) or (0,0) and then in the model.py that gets reduced to a single vector using argmin which essentially is the first column in the cut matrix obtained from cut.npy.

Is the use of those extra columns in CSV and prediction variable part of some future research that you are planning to do or did I miss something while going through the code?