From b5a2be8ca89acc4e2da2efba04eb1bf08204880c Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 25 Jun 2023 23:59:28 +0200 Subject: [PATCH] `ultralytics 8.0.123` Ubuntu security and VideoWriter codec fixes (#3380) --- docs/datasets/detect/index.md | 6 ++--- docs/datasets/pose/index.md | 48 +++++++++------------------------- docs/datasets/segment/index.md | 41 ++++++++++------------------- docs/models/fast-sam.md | 8 +++--- ultralytics/__init__.py | 2 +- 5 files changed, 35 insertions(+), 70 deletions(-) diff --git a/docs/datasets/detect/index.md b/docs/datasets/detect/index.md index ce7902f..6a9cd61 100644 --- a/docs/datasets/detect/index.md +++ b/docs/datasets/detect/index.md @@ -16,9 +16,9 @@ The Ultralytics YOLO format is a dataset configuration format that allows you to ```yaml # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..] -path: ../datasets/coco128 # dataset root dir -train: images/train2017 # train images (relative to 'path') 128 images -val: images/train2017 # val images (relative to 'path') 128 images +path: ../datasets/coco8 # dataset root dir +train: images/train # train images (relative to 'path') 4 images +val: images/val # val images (relative to 'path') 4 images test: # test images (optional) # Classes (80 COCO classes) diff --git a/docs/datasets/pose/index.md b/docs/datasets/pose/index.md index c9695fa..27d57d8 100644 --- a/docs/datasets/pose/index.md +++ b/docs/datasets/pose/index.md @@ -38,54 +38,32 @@ Format with Dim = 3 In this format, `` is the index of the class for the object,` ` are coordinates of boudning box, and ` ... ` are the pixel coordinates of the keypoints. The coordinates are separated by spaces. -** Dataset file format ** +### Dataset YAML format The Ultralytics framework uses a YAML file format to define the dataset and model configuration for training Detection Models. Here is an example of the YAML format used for defining a detection dataset: ```yaml -train: -val: - -nc: -names: [, , ..., ] +# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..] +path: ../datasets/coco8-pose # dataset root dir +train: images/train # train images (relative to 'path') 4 images +val: images/val # val images (relative to 'path') 4 images +test: # test images (optional) # Keypoints -kpt_shape: [num_kpts, dim] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible) -flip_idx: [n1, n2 ... , n(num_kpts)] -``` - -The `train` and `val` fields specify the paths to the directories containing the training and validation images, respectively. - -The `nc` field specifies the number of object classes in the dataset. - -The `names` field is a list of the names of the object classes. The order of the names should match the order of the object class indices in the YOLO dataset files. - -NOTE: Either `nc` or `names` must be defined. Defining both are not mandatory - -Alternatively, you can directly define class names like this: +kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible) +flip_idx: [0, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15] -```yaml +# Classes dictionary names: 0: person - 1: bicycle ``` -(Optional) if the points are symmetric then need flip_idx, like left-right side of human or face. -For example let's say there're five keypoints of facial landmark: [left eye, right eye, nose, left point of mouth, right point of mouse], and the original index is [0, 1, 2, 3, 4], then flip_idx is [1, 0, 2, 4, 3].(just exchange the left-right index, i.e 0-1 and 3-4, and do not modify others like nose in this example) - -** Example ** - -```yaml -train: data/train/ -val: data/val/ +The `train` and `val` fields specify the paths to the directories containing the training and validation images, respectively. -nc: 2 -names: ['person', 'car'] +`names` is a dictionary of class names. The order of the names should match the order of the object class indices in the YOLO dataset files. -# Keypoints -kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible) -flip_idx: [0, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15] -``` +(Optional) if the points are symmetric then need flip_idx, like left-right side of human or face. +For example if we assume five keypoints of facial landmark: [left eye, right eye, nose, left mouth, right mouth], and the original index is [0, 1, 2, 3, 4], then flip_idx is [1, 0, 2, 4, 3] (just exchange the left-right index, i.e 0-1 and 3-4, and do not modify others like nose in this example). ## Usage diff --git a/docs/datasets/segment/index.md b/docs/datasets/segment/index.md index a793f2f..bf145ac 100644 --- a/docs/datasets/segment/index.md +++ b/docs/datasets/segment/index.md @@ -37,44 +37,31 @@ Here is an example of the YOLO dataset format for a single image with two object Note: The length of each row does not have to be equal. -** Dataset file format ** +### Dataset YAML format The Ultralytics framework uses a YAML file format to define the dataset and model configuration for training Detection Models. Here is an example of the YAML format used for defining a detection dataset: ```yaml -train: -val: +# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..] +path: ../datasets/coco8-seg # dataset root dir +train: images/train # train images (relative to 'path') 4 images +val: images/val # val images (relative to 'path') 4 images +test: # test images (optional) -nc: -names: [, , ..., ] - -``` - -The `train` and `val` fields specify the paths to the directories containing the training and validation images, respectively. - -The `nc` field specifies the number of object classes in the dataset. - -The `names` field is a list of the names of the object classes. The order of the names should match the order of the object class indices in the YOLO dataset files. - -NOTE: Either `nc` or `names` must be defined. Defining both are not mandatory. - -Alternatively, you can directly define class names like this: - -```yaml +# Classes (80 COCO classes) names: 0: person 1: bicycle + 2: car + ... + 77: teddy bear + 78: hair drier + 79: toothbrush ``` -** Example ** - -```yaml -train: data/train/ -val: data/val/ +The `train` and `val` fields specify the paths to the directories containing the training and validation images, respectively. -nc: 2 -names: ['person', 'car'] -``` +`names` is a dictionary of class names. The order of the names should match the order of the object class indices in the YOLO dataset files. ## Usage diff --git a/docs/models/fast-sam.md b/docs/models/fast-sam.md index 3a4636a..25cb986 100644 --- a/docs/models/fast-sam.md +++ b/docs/models/fast-sam.md @@ -12,7 +12,7 @@ The Fast Segment Anything Model (FastSAM) is a novel, real-time CNN-based soluti ## Overview -FastSAM is designed to address the limitations of the Segment Anything Model (SAM), a heavy Transformer model with substantial computational resource requirements. The FastSAM decouples the segment anything task into two sequential stages: all-instance segmentation and prompt-guided selection. The first stage uses a Convolutional Neural Network (CNN)-based detector to produce the segmentation masks of all instances in the image. In the second stage, it outputs the region-of-interest corresponding to the prompt. +FastSAM is designed to address the limitations of the [Segment Anything Model (SAM)](sam.md), a heavy Transformer model with substantial computational resource requirements. The FastSAM decouples the segment anything task into two sequential stages: all-instance segmentation and prompt-guided selection. The first stage uses [YOLOv8-seg](../tasks/segment.md) to produce the segmentation masks of all instances in the image. In the second stage, it outputs the region-of-interest corresponding to the prompt. ## Key Features @@ -22,9 +22,9 @@ FastSAM is designed to address the limitations of the Segment Anything Model (SA 3. **Prompt-guided Segmentation:** FastSAM can segment any object within an image guided by various possible user interaction prompts, providing flexibility and adaptability in different scenarios. -4. **Based on YOLOv8-seg:** FastSAM is based on YOLOv8-seg, an object detector equipped with an instance segmentation branch. This allows it to effectively produce the segmentation masks of all instances in an image. +4. **Based on YOLOv8-seg:** FastSAM is based on [YOLOv8-seg](../tasks/segment.md), an object detector equipped with an instance segmentation branch. This allows it to effectively produce the segmentation masks of all instances in an image. -5. **Competitive Results on Benchmarks:** On the object proposal task on MS COCO, FastSAM achieves high scores at a significantly faster speed than SAM on a single NVIDIA RTX 3090, demonstrating its efficiency and capability. +5. **Competitive Results on Benchmarks:** On the object proposal task on MS COCO, FastSAM achieves high scores at a significantly faster speed than [SAM](sam.md) on a single NVIDIA RTX 3090, demonstrating its efficiency and capability. 6. **Practical Applications:** The proposed approach provides a new, practical solution for a large number of vision tasks at a really high speed, tens or hundreds of times faster than current methods. @@ -32,7 +32,7 @@ FastSAM is designed to address the limitations of the Segment Anything Model (SA ## Usage -FastSAM is not yet available directly via the `ultralytics` package, but it is available directly from the [https://github.com/CASIA-IVA-Lab/FastSAM](https://github.com/CASIA-IVA-Lab/FastSAM) repository. Here is a brief overview of the typical steps you might take to use FastSAM: +FastSAM is not yet available within the [`ultralytics` package](../quickstart.md), but it is available directly from the [https://github.com/CASIA-IVA-Lab/FastSAM](https://github.com/CASIA-IVA-Lab/FastSAM) repository. Here is a brief overview of the typical steps you might take to use FastSAM: ### Installation diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index bf1f0db..22622ac 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = '8.0.122' +__version__ = '8.0.123' from ultralytics.hub import start from ultralytics.vit.rtdetr import RTDETR