SanniM3 / video_summarisation_git

GIT with scene change based frame sampling
MIT License
2 stars 0 forks source link

fix problems with one frame scenes #26

Closed uoefeb closed 1 year ago

uoefeb commented 1 year ago

@ip342 Ok, This time this should really fix the jumbled frame issue from earlier.

The problem was 99% my code.

the pyscene sampler was giving us scene lists that looked like this

[ [1  , 380],
  [381, 380] ]

This was because we had been adding a 1 to the starter index to avoid scenes from overlapping, but if a scene was only one frame long, this caused the start index to be bigger than the end index.

This fix removes the +1 from the start index, and relies on np.random.randint to exclude the end index, in order to avoid overlapping scenes.

randint doesn't like it though if start == end, so I've written an edge case here to just return the start frame when this happens.


I've tested this and it appears to work, but if you could glance and it quickly, it'd be a big help. Thanks! Evan

uoefeb commented 1 year ago

Since transnet is wrapping up, I'm going to merge this and use it.