102102
103103#########
104104Full list of SparseZoo stubs for benchmarking
105- * Baseline dense YOLOv3 - "zoo:cv/detection/yolo_v3-spp/pytorch/ultralytics/coco/base-none"
106- * Pruned YOLOv3 (87% sparse) - "zoo:cv/detection/yolo_v3-spp/pytorch/ultralytics/coco/pruned-aggressive-97"
105+ * Baseline dense YOLOv3 -
106+ "zoo:cv/detection/yolo_v3-spp/pytorch/ultralytics/coco/base-none"
107+ * Pruned YOLOv3 (87% sparse) -
108+ "zoo:cv/detection/yolo_v3-spp/pytorch/ultralytics/coco/pruned-aggressive-97"
107109* Pruned-Quantized YOLOv3 (83% sparse, CPU must support VNNI) -
108110 "zoo:cv/detection/yolo_v3-spp/pytorch/ultralytics/coco/pruned_quant-aggressive-94"
109111"""
116118from pathlib import Path
117119from typing import Any , Iterable , List , Optional , Tuple , Union
118120
119- import cv2
120121import numpy
121122import onnx
122123import onnxruntime
123124import torch
124125from tqdm .auto import tqdm
125126
126- from deepsparse import compile_model , cpu
127+ from deepsparse import compile_model
127128from deepsparse .benchmark import BenchmarkResults
128129from deepsparse_utils import (
129130 YoloPostprocessor ,
@@ -172,10 +173,10 @@ def parse_args():
172173 type = Optional [str ],
173174 default = None ,
174175 help = (
175- "Optional filepath to image examples to run the benchmark on. Can be path to "
176- "directory, single image jpg file, or a glob path. All files should be "
177- "in jpg format. If not provided, sample COCO images will be downloaded from "
178- "the SparseZoo"
176+ "Optional filepath to image examples to run the benchmark on. Can be path "
177+ "to directory, single image jpg file, or a glob path. All files should be "
178+ "in jpg format. If not provided, sample COCO images will be downloaded "
179+ "from the SparseZoo"
179180 ),
180181 )
181182
@@ -201,8 +202,8 @@ def parse_args():
201202 default = None ,
202203 help = (
203204 "The number of physical cores to run the benchmark on, "
204- "defaults to None where it uses all physical cores available on the system. "
205- "For DeepSparse benchmarks, this value is the number of cores per socket"
205+ "defaults to None where it uses all physical cores available on the system."
206+ " For DeepSparse benchmarks, this value is the number of cores per socket"
206207 ),
207208 )
208209 parser .add_argument (
@@ -266,7 +267,7 @@ def parse_args():
266267def _parse_device (device : Union [str , int ]) -> Union [str , int ]:
267268 try :
268269 return int (device )
269- except :
270+ except Exception :
270271 return device
271272
272273
0 commit comments