Skip to content

Commit 6e440f5

Browse files
Adding explanation for command arguments
1 parent 5152b3b commit 6e440f5

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

capture.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,36 @@ def parse_argument():
1919
)
2020
parser.add_argument(
2121
"--detectionType",
22-
help="Type of detection for traditional method: color OR shape",
22+
help="""For traditional method, two types of detection are
23+
provided: color or shape.
24+
For deeplearning, this argument is not needed.""",
2325
required=False,
2426
default="color",
2527
)
2628
parser.add_argument(
2729
"--multipleObject",
28-
help="Whether to detect single or multiple types of objects.",
30+
help="Whether to detect objects with single or multiple classes.",
2931
required=False,
3032
default=False,
3133
)
3234
parser.add_argument(
3335
"--trueClass",
34-
help="Name of the object class to be detected if it is a single type.",
36+
help="""For single class, name of the object class to be detected.
37+
For multiple, this argument is not needed.""",
3538
required=False,
3639
type=str,
3740
default="yellow_duck",
3841
)
3942
parser.add_argument(
4043
"--collectAll",
41-
help="Whether to collect all images or only the True Positive one.",
44+
help="""Whether to collect all images of detected objects or
45+
only the detections with correct labels.""",
4246
required=False,
4347
default=False,
4448
)
4549
parser.add_argument(
4650
"--model",
47-
help="Path of the object detection model.",
51+
help="For deeplearning, path of the object detection model.",
4852
required=False,
4953
default="./model/frogducky2.tflite",
5054
)
@@ -64,14 +68,14 @@ def parse_argument():
6468
)
6569
parser.add_argument(
6670
"--numThreads",
67-
help="Number of CPU threads to run the model.",
71+
help="For deeplearning, number of CPU threads to run the model.",
6872
required=False,
6973
type=int,
7074
default=4,
7175
)
7276
parser.add_argument(
7377
"--enableEdgeTPU",
74-
help="Whether to run the model on EdgeTPU.",
78+
help="For deeplearning, whether to run the model on EdgeTPU.",
7579
action="store_true",
7680
required=False,
7781
default=False,

run.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,38 @@ def parse_arguments():
1313
)
1414
parser.add_argument(
1515
"--method",
16-
help="Two computer vision method: traditional or deeplearning",
16+
help="Two computer vision method: traditional or deeplearning.",
1717
required=False,
1818
type=str,
1919
default="deeplearning",
2020
)
2121
parser.add_argument(
2222
"--detectionType",
23-
help="Type of object detection: color, shape, or category",
23+
help="""For deeplearning, three types of object detection are
24+
provided: color, shape, or category.
25+
For traditional, only two types are provided: color or shape.""",
2426
required=False,
2527
default="color",
2628
)
2729
parser.add_argument(
2830
"--multipleObject",
29-
help="Whether to detect single or multiple types of objects.",
31+
help="Whether to detect objects with single or multiple classes.",
3032
required=False,
3133
default=False,
3234
)
3335
parser.add_argument(
3436
"--trueLabel",
35-
help="""If it is color detection, input (Blue, Green, Red)
36-
of the object. Else if shape, input (Height, Width, Size).
37-
Else, input class_name of the object. In traditional,
38-
the label is also class_name""",
37+
help="""For deeplearning, if it is color detection, input
38+
(Blue, Green, Red) of the object. Else if shape, input
39+
(Height, Width, Size). Else, input class_name of the object.
40+
For traditional, the label is also class_name""",
3941
required=False,
4042
type=str,
4143
default="(55, 232, 254)",
4244
)
4345
parser.add_argument(
4446
"--model",
45-
help="Path of the object detection model.",
47+
help="For deeplearning, path of the object detection model.",
4648
required=False,
4749
default="./model/color_detector2.tflite",
4850
)
@@ -62,14 +64,14 @@ def parse_arguments():
6264
)
6365
parser.add_argument(
6466
"--numThreads",
65-
help="Number of CPU threads to run the model.",
67+
help="For deeplearning, number of CPU threads to run the model.",
6668
required=False,
6769
type=int,
6870
default=4,
6971
)
7072
parser.add_argument(
7173
"--enableEdgeTPU",
72-
help="Whether to run the model on EdgeTPU.",
74+
help="For deeplearning, whether to run the model on EdgeTPU.",
7375
action="store_true",
7476
required=False,
7577
default=False,
@@ -82,13 +84,15 @@ def parse_arguments():
8284
)
8385
parser.add_argument(
8486
"--plcAddress",
85-
help="IP Address of the PLC to be sent detection data to",
87+
help="""In client mode, IP Address of the PLC to which request
88+
will be sent""",
8689
required=False,
8790
default="10.42.26.129",
8891
)
8992
parser.add_argument(
9093
"--ethAddress",
91-
help="IP Address of the Ethernet so Raspberry Pi can act as a server",
94+
help="""In server mode, Ethernet Address of the Raspberry Pi so
95+
that it can receive requests from the PLC""",
9296
required=False,
9397
default="10.42.26.165",
9498
)

0 commit comments

Comments
 (0)