[Python] Funscript tools - Frame Extracting (Get frames from a video) | Extrapolating (Useful for Machine Learning datasets)

Hi, I’ve been meaning to publish these utilities for the community for a while now. Worked on this in July adapting from a project that extracted frames from a video when I was interested in helping develop machine learning solutions for scripting videos and just got back around to making this public.

Here is the GitHub link to the project. The readme file explains usage instructions, below is an overview of the two utilities.

There are two utilities:

  • Extract frames: Extracts the frames at every ‘percentage’ from a given video at each action point from the funscript file. For example, if a video has 30 actions, 10 are at position 90, and 20 are at position 50. The output would result in two folders, of which, one folder would be called ‘90’ and would contain 10 pictures captured at each of point.

  • Extrapolate frames: Useful utility for machine learning or for anyone wanting to add extra points to their script programmatically. This utility could be especially useful for machine learning applications as the more data one can feed into a machine learning algorithm, the better-expected accuracy. This utility function artificially creates points between each two action points. The user can vary the resulting output from a slight increase to large increases by adjusting the percentage in the config file.

7 Likes