forked from AlexeyAB/darknet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.py
35 lines (26 loc) · 957 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
27
28
29
30
31
32
33
34
35
import os
def arg_parse():
"""
Parse arguements to the detect module
"""
parser = argparse.ArgumentParser(description='YOLO v3 Video Detection Module')
parser.add_argument("--videoPath", dest = 'video', help =
"Video to run detection upon",
default = "video.avi", type = str)
return parser.parse_args()
def get_video_from_visdrone(path):
for item in os.listdir(path):
folder = os.path.join(path,item)
if not os.path.isfile(folder) and item=="sequences":
listVideo = []
for vid in os.listdir(folder):
video = []
videoFrames = []
videoPath = os.path.join(folder,vid)
for frame in os.listdir(videoPath):
if(os.path.isfile(os.path.join(videoPath,frame))):
videoFrames.append(frame)
video.append(videoPath)
video.append(videoFrames)
listVideo.append(video)
return listVideo