-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
45 lines (36 loc) · 1.13 KB
/
Copy pathtest.py
File metadata and controls
45 lines (36 loc) · 1.13 KB
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
36
37
38
39
40
41
42
43
44
45
import argparse
import os
import random
import cv2
import numpy as np
def init_parameter():
parser = argparse.ArgumentParser(description="Test")
parser.add_argument(
"--videos", type=str, default="foo_videos/", help="Dataset folder"
)
parser.add_argument(
"--results", type=str, default="foo_results/", help="Results folder"
)
args = parser.parse_args()
return args
args = init_parameter()
# Here you should initialize your method
################################################
# For all the test videos
for video in os.listdir(args.videos):
# Process the video
ret = True
cap = cv2.VideoCapture(video)
while ret:
ret, img = cap.read()
# Here you should add your code for applying your method
########################################################
cap.release()
f = open(args.results + video + ".txt", "w")
# Here you should add your code for writing the results
pos_neg = random.randint(0, 1)
if pos_neg:
t = random.randint(0, 10)
f.write(str(t))
########################################################
f.close()