DetectMultiBackend() default `stride=32` (#7342)
Browse files* set common default stride as 32
* restore default stride, and set it on argument optional
* fix wrong use of opt
* fix missing parameter of stride
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix format of parameters
* Update val.py
* Update common.py
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <[email protected]>
- models/common.py +1 -1
models/common.py
CHANGED
@@ -296,7 +296,7 @@ class DetectMultiBackend(nn.Module):
|
|
296 |
super().__init__()
|
297 |
w = str(weights[0] if isinstance(weights, list) else weights)
|
298 |
pt, jit, onnx, xml, engine, coreml, saved_model, pb, tflite, edgetpu, tfjs = self.model_type(w) # get backend
|
299 |
-
stride, names =
|
300 |
w = attempt_download(w) # download if not local
|
301 |
fp16 &= (pt or jit or onnx or engine) and device.type != 'cpu' # FP16
|
302 |
if data: # data.yaml path (optional)
|
|
|
296 |
super().__init__()
|
297 |
w = str(weights[0] if isinstance(weights, list) else weights)
|
298 |
pt, jit, onnx, xml, engine, coreml, saved_model, pb, tflite, edgetpu, tfjs = self.model_type(w) # get backend
|
299 |
+
stride, names = 32, [f'class{i}' for i in range(1000)] # assign defaults
|
300 |
w = attempt_download(w) # download if not local
|
301 |
fp16 &= (pt or jit or onnx or engine) and device.type != 'cpu' # FP16
|
302 |
if data: # data.yaml path (optional)
|