ultralytics 8.0.184 https://yolovision.ultralytics.com #YV23 (#5008)
Co-authored-by: Kengo Miyakawa <s_flashback@yahoo.co.jp>
This commit is contained in:
parent
fa826db45f
commit
92753ebd84
4 changed files with 26 additions and 39 deletions
|
|
@ -13,7 +13,7 @@ import numpy as np
|
|||
import torch
|
||||
|
||||
from ultralytics.data.augment import LetterBox
|
||||
from ultralytics.utils import LOGGER, SimpleClass, deprecation_warn, ops
|
||||
from ultralytics.utils import LOGGER, SimpleClass, ops
|
||||
from ultralytics.utils.plotting import Annotator, colors, save_one_box
|
||||
|
||||
|
||||
|
|
@ -153,21 +153,20 @@ class Results(SimpleClass):
|
|||
return Results(orig_img=self.orig_img, path=self.path, names=self.names)
|
||||
|
||||
def plot(
|
||||
self,
|
||||
conf=True,
|
||||
line_width=None,
|
||||
font_size=None,
|
||||
font='Arial.ttf',
|
||||
pil=False,
|
||||
img=None,
|
||||
im_gpu=None,
|
||||
kpt_radius=5,
|
||||
kpt_line=True,
|
||||
labels=True,
|
||||
boxes=True,
|
||||
masks=True,
|
||||
probs=True,
|
||||
**kwargs # deprecated args TODO: remove support in 8.2
|
||||
self,
|
||||
conf=True,
|
||||
line_width=None,
|
||||
font_size=None,
|
||||
font='Arial.ttf',
|
||||
pil=False,
|
||||
img=None,
|
||||
im_gpu=None,
|
||||
kpt_radius=5,
|
||||
kpt_line=True,
|
||||
labels=True,
|
||||
boxes=True,
|
||||
masks=True,
|
||||
probs=True,
|
||||
):
|
||||
"""
|
||||
Plots the detection results on an input RGB image. Accepts a numpy array (cv2) or a PIL Image.
|
||||
|
|
@ -207,17 +206,6 @@ class Results(SimpleClass):
|
|||
if img is None and isinstance(self.orig_img, torch.Tensor):
|
||||
img = (self.orig_img[0].detach().permute(1, 2, 0).contiguous() * 255).to(torch.uint8).cpu().numpy()
|
||||
|
||||
# Deprecation warn TODO: remove in 8.2
|
||||
if 'show_conf' in kwargs:
|
||||
deprecation_warn('show_conf', 'conf')
|
||||
conf = kwargs['show_conf']
|
||||
assert isinstance(conf, bool), '`show_conf` should be of boolean type, i.e, show_conf=True/False'
|
||||
|
||||
if 'line_thickness' in kwargs:
|
||||
deprecation_warn('line_thickness', 'line_width')
|
||||
line_width = kwargs['line_thickness']
|
||||
assert isinstance(line_width, int), '`line_width` should be of int type, i.e, line_width=3'
|
||||
|
||||
names = self.names
|
||||
pred_boxes, show_boxes = self.boxes, boxes
|
||||
pred_masks, show_masks = self.masks, masks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue