ultralytics 8.3.38 SAM 2 video inference (#14851)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Signed-off-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
This commit is contained in:
parent
407815cf9e
commit
dcc9bd536f
16 changed files with 917 additions and 124 deletions
|
|
@ -2111,10 +2111,9 @@ class Format:
|
|||
h (int): Height of the image.
|
||||
|
||||
Returns:
|
||||
(tuple): Tuple containing:
|
||||
masks (numpy.ndarray): Bitmap masks with shape (N, H, W) or (1, H, W) if mask_overlap is True.
|
||||
instances (Instances): Updated instances object with sorted segments if mask_overlap is True.
|
||||
cls (numpy.ndarray): Updated class labels, sorted if mask_overlap is True.
|
||||
masks (numpy.ndarray): Bitmap masks with shape (N, H, W) or (1, H, W) if mask_overlap is True.
|
||||
instances (Instances): Updated instances object with sorted segments if mask_overlap is True.
|
||||
cls (numpy.ndarray): Updated class labels, sorted if mask_overlap is True.
|
||||
|
||||
Notes:
|
||||
- If self.mask_overlap is True, masks are overlapped and sorted by area.
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ class LoadImagesAndVideos:
|
|||
self.nf = ni + nv # number of files
|
||||
self.ni = ni # number of images
|
||||
self.video_flag = [False] * ni + [True] * nv
|
||||
self.mode = "image"
|
||||
self.mode = "video" if ni == 0 else "image" # default to video if no images
|
||||
self.vid_stride = vid_stride # video frame-rate stride
|
||||
self.bs = batch
|
||||
if any(videos):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue