We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import os import cv2 from tqdm import tqdm base_dir = '/home/simplew/dataset/sod/DHF1K' video_dir = os.path.join(base_dir, 'video') movies = [mov for mov in os.listdir(video_dir) if mov.endswith('.AVI')] for movie in tqdm(movies): image_dir = os.path.join(base_dir , 'annotation', '0' + movie[:-4], 'images') os.makedirs(image_dir, exist_ok=True) # use opencv # cap = cv2.VideoCapture(f"{video_dir}/{movie}") # numFrames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) # for k in range(numFrames): # ret, frame = cap.read() # cv2.imwrite(f"{image_dir}/{k+1:04}.png", frame) # cap.release() # ubuntu command = f"ffmpeg -i {video_dir}/{movie} {image_dir}/%04d.png" os.system(command)
The text was updated successfully, but these errors were encountered:
sudo apt install ffmpeg
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: