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:
@ -26,6 +26,7 @@ class SourceTypes:
|
||||
webcam: bool = False
|
||||
screenshot: bool = False
|
||||
from_img: bool = False
|
||||
tensor: bool = False
|
||||
|
||||
|
||||
class LoadStreams:
|
||||
@ -329,6 +330,23 @@ class LoadPilAndNumpy:
|
||||
return self
|
||||
|
||||
|
||||
class LoadTensor:
|
||||
|
||||
def __init__(self, imgs) -> None:
|
||||
self.im0 = imgs
|
||||
self.bs = imgs.shape[0]
|
||||
|
||||
def __iter__(self):
|
||||
self.count = 0
|
||||
return self
|
||||
|
||||
def __next__(self):
|
||||
if self.count == 1:
|
||||
raise StopIteration
|
||||
self.count += 1
|
||||
return None, self.im0, self.im0, None, '' # self.paths, im, self.im0, None, ''
|
||||
|
||||
|
||||
def autocast_list(source):
|
||||
"""
|
||||
Merges a list of source of different types into a list of numpy arrays or PIL images
|
||||
|
@ -539,7 +539,7 @@ class LoadImagesAndLabels(Dataset):
|
||||
j = (label[:, 0:1] == include_class_array).any(1)
|
||||
self.labels[i] = label[j]
|
||||
if segment:
|
||||
self.segments[i] = segment[j]
|
||||
self.segments[i] = [segment[si] for si, idx in enumerate(j) if idx]
|
||||
if single_cls: # single-class training, merge all classes into 0
|
||||
self.labels[i][:, 0] = 0
|
||||
|
||||
|
Reference in New Issue
Block a user