Skip to content

Commit 51f47ed

Browse files
committed
feat: new models and scripts
1 parent 5bae82a commit 51f47ed

12 files changed

+18609
-7
lines changed

car_detect.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
MODELS_DIR = Path(__file__).parent.joinpath("models/DepthAI")
1414

15-
DEFAULT_MODEL_LP_VENEZUELA = MODELS_DIR.joinpath("2022-09-17/frozen_inference_graph_openvino_2021.4_6shave.blob")
15+
DEFAULT_MODEL_LP_VENEZUELA = MODELS_DIR.joinpath("2023-09-25/anpr-best-train15-yolos-2023-09-25-1.blob")
1616

1717
parser = argparse.ArgumentParser()
1818
parser.add_argument("-d", "--debug", default=True, help="Debug mode")

converter.py

+29-6
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,36 @@
55
parser = argparse.ArgumentParser()
66
parser.add_argument("-bin", "--ov-bin-file", type=argparse.FileType("r"), required=True, help="OpenVINO’s IR format bin")
77
parser.add_argument("-xml", "--ov-xml-file", type=argparse.FileType("r", encoding="UTF-8"), required=True, help="OpenVINO’s IR format xml")
8+
parser.add_argument("-onn", "--onnx-file", type=argparse.FileType("r", encoding="UTF-8"), help="OpenVINO’s IR format onnx")
9+
10+
parser.add_argument("-o", "--output-dir", type=str, default="models/DepthAI", help="Output directory")
11+
812
parser.add_argument("-dt", "--data-type", type=str, default="FP16", help="Model data type")
913
parser.add_argument("-s", "--shaves", type=int, default=6, help="Model data type")
1014
args = parser.parse_args()
1115

12-
blob_path = blobconverter.from_openvino(
13-
xml=args.ov_xml_file.name,
14-
bin=args.ov_bin_file.name,
15-
data_type=args.data_type,
16-
shaves=args.shaves,
17-
)
16+
# ov parameters and onnx parameters are mutually exclusive
17+
if args.ov_bin_file and args.onnx_file:
18+
raise RuntimeError("OpenVINO’s IR format bin and OpenVINO’s IR format onnx are mutually exclusive")
19+
20+
if args.ov_bin_file and args.ov_xml_file:
21+
blob_path = blobconverter.from_openvino(
22+
xml=args.ov_xml_file.name,
23+
bin=args.ov_bin_file.name,
24+
data_type=args.data_type,
25+
shaves=args.shaves,
26+
output_dir=args.output_dir,
27+
)
28+
print(f"Blob path: {blob_path}")
29+
30+
if args.onnx_file:
31+
blob_path = blobconverter.from_onnx(
32+
model=args.onnx_file.name,
33+
data_type=args.data_type,
34+
shaves=args.shaves,
35+
output_dir=args.output_dir,
36+
)
37+
print(f"Blob path: {blob_path}")
38+
39+
40+
# python3 converter.py -bin models/DepthAI/vehicle-detection-0200/vehicle-detection-0200.bin -xml models/DepthAI/vehicle-detection-0200/vehicle-detection-0200.xml -o models/DepthAI/vehicle-detection-0200
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)