ultralytics 8.0.171 new SAHI guide and callbacks fix (#4748)
Co-authored-by: chuzihang <49548797+Aria-Leo@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sanghyun Choi <farewell518@gmail.com> Co-authored-by: Awsome <1579093407@qq.com> Co-authored-by: ConanQZ <49194386+ConanQZ@users.noreply.github.com>
This commit is contained in:
parent
aa9133bb88
commit
577d066fb2
15 changed files with 215 additions and 35 deletions
|
|
@ -121,11 +121,11 @@ class BasePredictor:
|
|||
im = np.ascontiguousarray(im) # contiguous
|
||||
im = torch.from_numpy(im)
|
||||
|
||||
img = im.to(self.device)
|
||||
img = img.half() if self.model.fp16 else img.float() # uint8 to fp16/32
|
||||
im = im.to(self.device)
|
||||
im = im.half() if self.model.fp16 else im.float() # uint8 to fp16/32
|
||||
if not_tensor:
|
||||
img /= 255 # 0 - 255 to 0.0 - 1.0
|
||||
return img
|
||||
im /= 255 # 0 - 255 to 0.0 - 1.0
|
||||
return im
|
||||
|
||||
def inference(self, im, *args, **kwargs):
|
||||
visualize = increment_path(self.save_dir / Path(self.batch[0][0]).stem,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue