ultralytics 8.0.50 AMP check and YOLOv5u YAMLs (#1263)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Troy <wudashuo@vip.qq.com> Co-authored-by: Yonghye Kwon <developer.0hye@gmail.com> Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com> Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com> Co-authored-by: Huijae Lee <46982469+ZeroAct@users.noreply.github.com>
This commit is contained in:
parent
3861e6c82a
commit
f0d8e4718b
29 changed files with 440 additions and 83 deletions
|
|
@ -183,6 +183,8 @@ class BasePredictor:
|
|||
'preprocess': self.dt[0].dt * 1E3 / n,
|
||||
'inference': self.dt[1].dt * 1E3 / n,
|
||||
'postprocess': self.dt[2].dt * 1E3 / n}
|
||||
if self.source_type.tensor: # skip write, show and plot operations if input is raw tensor
|
||||
continue
|
||||
p, im0 = (path[i], im0s[i].copy()) if self.source_type.webcam or self.source_type.from_img \
|
||||
else (path, im0s.copy())
|
||||
p = Path(p)
|
||||
|
|
@ -218,11 +220,16 @@ class BasePredictor:
|
|||
|
||||
self.run_callbacks('on_predict_end')
|
||||
|
||||
def setup_model(self, model):
|
||||
device = select_device(self.args.device)
|
||||
def setup_model(self, model, verbose=True):
|
||||
device = select_device(self.args.device, verbose=verbose)
|
||||
model = model or self.args.model
|
||||
self.args.half &= device.type != 'cpu' # half precision only supported on CUDA
|
||||
self.model = AutoBackend(model, device=device, dnn=self.args.dnn, data=self.args.data, fp16=self.args.half)
|
||||
self.model = AutoBackend(model,
|
||||
device=device,
|
||||
dnn=self.args.dnn,
|
||||
data=self.args.data,
|
||||
fp16=self.args.half,
|
||||
verbose=verbose)
|
||||
self.device = device
|
||||
self.model.eval()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue