Update .pre-commit-config.yaml (#1026)

This commit is contained in:
Glenn Jocher
2023-02-17 22:26:40 +01:00
committed by GitHub
parent 9047d737f4
commit edd3ff1669
76 changed files with 928 additions and 935 deletions

View File

@ -28,7 +28,7 @@ class ClassificationPredictor(BasePredictor):
def write_results(self, idx, results, batch):
p, im, im0 = batch
log_string = ""
log_string = ''
if len(im.shape) == 3:
im = im[None] # expand for batch dim
self.seen += 1
@ -65,9 +65,9 @@ class ClassificationPredictor(BasePredictor):
def predict(cfg=DEFAULT_CFG, use_python=False):
model = cfg.model or "yolov8n-cls.pt" # or "resnet18"
source = cfg.source if cfg.source is not None else ROOT / "assets" if (ROOT / "assets").exists() \
else "https://ultralytics.com/images/bus.jpg"
model = cfg.model or 'yolov8n-cls.pt' # or "resnet18"
source = cfg.source if cfg.source is not None else ROOT / 'assets' if (ROOT / 'assets').exists() \
else 'https://ultralytics.com/images/bus.jpg'
args = dict(model=model, source=source)
if use_python:
@ -78,5 +78,5 @@ def predict(cfg=DEFAULT_CFG, use_python=False):
predictor.predict_cli()
if __name__ == "__main__":
if __name__ == '__main__':
predict()