Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit suggestions (#2056)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit suggestions

updates:
- [github.com/asottile/pyupgrade: v3.3.1 → v3.3.2](asottile/pyupgrade@v3.3.1...v3.3.2)
- [github.com/google/yapf: v0.32.0 → v0.33.0](google/yapf@v0.32.0...v0.33.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] committed May 2, 2023
1 parent 48aad6c commit 2f7ef58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: detect-private-key

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.3.2
hooks:
- id: pyupgrade
name: Upgrade code
Expand All @@ -35,7 +35,7 @@ repos:
name: Sort imports

- repo: https://github.com/google/yapf
rev: v0.32.0
rev: v0.33.0
hooks:
- id: yapf
name: YAPF formatting
Expand Down
5 changes: 3 additions & 2 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@ def __init__(self, weights='yolov5s.pt', device=torch.device('cpu'), dnn=False,
model.half() if fp16 else model.float()
if extra_files['config.txt']: # load metadata dict
d = json.loads(extra_files['config.txt'],
object_hook=lambda d: {int(k) if k.isdigit() else k: v
for k, v in d.items()})
object_hook=lambda d: {
int(k) if k.isdigit() else k: v
for k, v in d.items()})
stride, names = int(d['stride']), d['names']
elif dnn: # ONNX OpenCV DNN
LOGGER.info(f'Loading {w} for ONNX OpenCV DNN inference...')
Expand Down

0 comments on commit 2f7ef58

Please sign in to comment.