|
24 | 24 |
|
25 | 25 | from utils import TryExcept
|
26 | 26 | from utils.dataloaders import exif_transpose, letterbox
|
27 |
| -from utils.general import (LOGGER, ROOT, Profile, check_imshow, check_requirements, check_suffix, check_version, |
28 |
| - colorstr, increment_path, make_divisible, non_max_suppression, scale_boxes, xywh2xyxy, |
| 27 | +from utils.general import (LOGGER, ROOT, Profile, check_requirements, check_suffix, check_version, colorstr, |
| 28 | + increment_path, is_notebook, make_divisible, non_max_suppression, scale_boxes, xywh2xyxy, |
29 | 29 | xyxy2xywh, yaml_load)
|
30 | 30 | from utils.plots import Annotator, colors, save_one_box
|
31 | 31 | from utils.torch_utils import copy_attr, smart_inference_mode
|
32 | 32 |
|
33 |
| -CHECK_IMSHOW = check_imshow() |
34 |
| - |
35 | 33 |
|
36 | 34 | def autopad(k, p=None, d=1): # kernel, padding, dilation
|
37 | 35 | # Pad to 'same' shape outputs
|
@@ -760,7 +758,7 @@ def _run(self, pprint=False, show=False, save=False, crop=False, render=False, l
|
760 | 758 |
|
761 | 759 | im = Image.fromarray(im.astype(np.uint8)) if isinstance(im, np.ndarray) else im # from np
|
762 | 760 | if show:
|
763 |
| - im.show(self.files[i]) if CHECK_IMSHOW else display(im) |
| 761 | + display(im) if is_notebook() else im.show(self.files[i]) |
764 | 762 | if save:
|
765 | 763 | f = self.files[i]
|
766 | 764 | im.save(save_dir / f) # save
|
|
0 commit comments