-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
46 lines (39 loc) · 1.22 KB
/
main.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
import argparse
from detection import Detection
from inference import Inference
def main():
detection = Detection(modelWeights=args.modelDetection, cfgPath=args.cfgPath)
Inference(
folderPath=args.folderPath,
labelFile=args.labelFile,
modelDetection=detection,
).start_inference(debug=True)
return
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Image File Folder")
parser.add_argument(
"--folderPath",
type=str,
default="./input",
help="Folder to search for images",
)
parser.add_argument(
"--modelDetection",
type=str,
default="http://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_FPN_3x/137849458/model_final_280758.pkl",
help="Pre-trained Weights for Detectron Detection",
)
parser.add_argument(
"--cfgPath",
type=str,
default="COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml",
help="Path to model cfg file relative to 'detectron2/model_zoo/configs' ",
)
parser.add_argument(
"--labelFile",
type=str,
default="./labels.csv",
help="Path to model labels",
)
args = parser.parse_args()
main()