-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.py
26 lines (24 loc) · 804 Bytes
/
utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Import common packages
import glob
import os
import os.path as osp
from Sequence import Sequence
# Check if folder exists, if not create it
def checkExist(folderPath):
if not os.path.exists(folderPath):
os.makedirs(folderPath)
# Extract all information of sequence
def extractInfo(seqPath):
fullName = osp.basename(seqPath).split(".")[0]
name_only = fullName.split("__")[0]
size = fullName.split("__")[1]
numFrames = fullName.split("__")[2]
width = size.split('x')[0]
height = size.split('x')[1]
return fullName, int(width), int(height), int(numFrames)
# IO sequence
def prepareSeqs(SeqPth, args):
fullName, width, height, numFrames = extractInfo(SeqPth)
seq = Sequence(SeqPth, numFrames, args.format, [width,height])
seq.showInfo()
return seq