forked from smitagh/Auto-Evaluation-of-Line-Following-Robot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto_eval.py
65 lines (52 loc) · 2.41 KB
/
auto_eval.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import os
import sys
import argparse
import cv2
import cv2.aruco as aruco
from standardization import standard
from threaded_final import mainplot
from evaluate_final_1 import evaluate
color_markers= ['Magenta','Neon Green','Green','Blue']
ap = argparse.ArgumentParser()
ap.add_argument("-ref", "--reference", required=True,
help="Path to mp4 or mov video")
ap.add_argument("-fol", "--folder", required=True,
help="path to the folder where videos are stored")
ap.add_argument("-cm_top", "--colormarker_top", required=False, default=0,type=int,
help="0 - Magenta, 1 - Neon Green , 2 - Green , 3 - Blue"
"Default Value = 0")
ap.add_argument("-cm_phys", "--colormarker_physical", required=False, default=3,type=int,
help="-1 - None ,0 - Magenta, 1 - Neon Green , 2 - Green , 3 - Blue"
"Default Value = 3")
ap.add_argument("-wid", "--width", required=False, default=20, type=int,
help="Any integer value between 10 to 40")
ap.add_argument("-weight", "--weightage", required=False, nargs="*",type=int, default=[10,70,0,10,10],
help="A tuple of weight given to each technique of evaluation")
#ap.add_argument("-cm_phys", "--colormarker_physical", required=False,help="0 - Magenta, 1 - Neon Green , 2 - Green , 3 - Blue")
args = vars(ap.parse_args())
# display a friendly message to the user
perfect_file_name = args["reference"]
videos_folder_path = args["folder"]
color_marker_top = args["colormarker_top"]
color_marker_physical =args["colormarker_physical"]
width = args["width"]
weightage = args["weightage"]
print("You have chosen the standard file :"+str(perfect_file_name))
print("You have chosen the folder's path :"+str(videos_folder_path))
print("You have chosen the top color marker as :"+str(color_markers[color_marker_top]))
print("You have chosen the physical color marker as :"+str(color_markers[color_marker_physical]))
print("You have chosen the width as :"+str(width))
if weightage.__len__()!=5 and sum(weightage)!=100:
print("Sum of the 5 methods should be 100")
else:
print("You have chosen the weightage as :"+str(weightage))
print("Do you want to start execution? Y/N")
choice = input()
if choice =='Y':
csv_file_name = standard(perfect_file_name, width)
mainplot(csv_file_name, videos_folder_path, color_marker_top, color_marker_physical)
evaluate(csv_file_name)
print("Check out the CSV file Results")
exit(1)
else:
exit(-1)