You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This script should utilize the frames naming pattern (string+number.jpg) to make selection easier.
We can simple generate a random number from 1 till (number of frames) and select the corresponding frame. Afterwards the generated number is stored in a selected_frames list. Then for each number we generate we check if the frame was already selected
The text was updated successfully, but these errors were encountered:
importosos.chdir('videos/')
defreadFilenames():
files=set()
withos.scandir('.') asentries:
forentryinentries:
filename=entry.name.split('.')[0]
files.add(filename)
returnfiles# Each filename must be unique to avoid processing the same file twicefiles=readFilenames()
# Read all files and strip the extension # We use just the filename title to avoid having to if-else about the extensionswithos.scandir('.') asentries:
forentryinentries:
filename=entry.name.split('.')[0]
files.add(filename)
The code above is can be used as a blueprint for reading the images from the filesystem
This script should utilize the frames naming pattern (string+number.jpg) to make selection easier.
We can simple generate a random number from 1 till (number of frames) and select the corresponding frame. Afterwards the generated number is stored in a selected_frames list. Then for each number we generate we check if the frame was already selected
The text was updated successfully, but these errors were encountered: