If you have "gh" installed you can just do:
Code: Select all
gh repo clone 12dmodel/deep_motion_mag
Code: Select all
git clone https://github.com/12dmodel/deep_motion_mag.git
cd deep_motion_mag
Code: Select all
module load conda
Code: Select all
conda create --name deepmotion python=3.7.11
conda activate deepmotion
conda install opencv
conda install -c conda-forge configobj
conda install scipy
conda install setproctitle
conda install tqdm
conda install tensorflow==1.14.0
Code: Select all
import cv2
import argparse
from tqdm import tqdm
parser = argparse.ArgumentParser()
parser.add_argument("filename", help="enter a movie filename here")
args = parser.parse_args()
print("Extracting frames from:", args.filename)
vidcap = cv2.VideoCapture(args.filename)
frames = int(vidcap.get(cv2.CAP_PROP_FRAME_COUNT))
success, image = vidcap.read()
count = 0
pbar = tqdm(total=frames)
while success:
cv2.imwrite("%06d.png" % count, image) # save frame as PNG file
success, image = vidcap.read()
count += 1
pbar.update(1)
pbar.close()
Once the frames are created, I "mv" them into a working subdirectory.
I could never get ffmpeg to work properly on my Mac, but it may work on HiPerGator. You'll need to change magnet.py to specify "ffmpeg" as your movie program on line 23.