This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from torch.autograd import Variable | |
import tools.utils as utils | |
import tools.dataset as dataset | |
from PIL import Image | |
from collections import OrderedDict | |
import cv2 | |
from models.moran import MORAN | |
model_path = '/home/ryan/Downloads/2000_0.8805.pth' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://gist.github.com/DecentMakeover/23d9b84b698f7acf6ccb85ff201205d7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frames =5 | |
video_folder = '/media/ryan/shakira/3d-cnn-action-recognition/some_folder' | |
for file in os.listdir(video_folder): | |
if file.endswith('.webm'): | |
os.mkdir(os.path.join(video_folder,file.split('.')[0])) | |
folder_name = file.split('.')[0] | |
os.system('ffmpeg -t 4 -i {} -vf fps={} {}/%05d.jpg -t 10'.format(os.path.join(video_folder,file), frames,os.path.join(video_folder,folder_name ))) | |
elif file.endswith('.mp4'): | |
os.mkdir(os.path.join(video_folder,file.split('.')[0])) | |
folder_name = file.split('.')[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch.nn as nn | |
import torch | |
class Modified3DUNet(nn.Module): | |
def __init__(self, in_channels, n_classes, base_n_filter = 8): | |
super(Modified3DUNet, self).__init__() | |
self.in_channels = in_channels | |
self.n_classes = n_classes | |
self.base_n_filter = base_n_filter |