Skip to content

Commit c402233

Browse files
HapyrJakob GeblerUltralyticsAssistantglenn-jocher
authored
Add redirect notice to ultralytics repo for new updates (#122)
Signed-off-by: Glenn Jocher <[email protected]> Co-authored-by: Jakob Gebler <[email protected]> Co-authored-by: UltralyticsAssistant <[email protected]> Co-authored-by: Glenn Jocher <[email protected]>
1 parent ad8092f commit c402233

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ This conversion process is essential for [machine learning](https://www.ultralyt
1111
[![Ultralytics Forums](https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue)](https://community.ultralytics.com/)
1212
[![Ultralytics Reddit](https://img.shields.io/reddit/subreddit-subscribers/ultralytics?style=flat&logo=reddit&logoColor=white&label=Reddit&color=blue)](https://reddit.com/r/ultralytics)
1313

14+
> **📢 Important Update**: The JSON2YOLO project is now integrated into the main Ultralytics package at https://github.com/ultralytics/ultralytics. The standalone scripts in this repository are no longer being actively updated. For the latest functionality, please use the new `convert_coco()` method described in our updated [data converter documentation](https://docs.ultralytics.com/reference/data/converter/).
15+
1416
## ⚙️ Requirements
1517

1618
To get started with JSON2YOLO, you'll need a [Python](https://www.python.org/) environment running version 3.8 or later. Additionally, you'll need to install all the necessary dependencies listed in the `requirements.txt` file. You can install these dependencies using the following [pip](https://pip.pypa.io/en/stable/) command in your terminal:
@@ -21,17 +23,25 @@ pip install -r requirements.txt # Installs all the required packages
2123

2224
## 💡 Usage
2325

24-
To convert your COCO JSON dataset to YOLO format, run the `convert.py` script from your terminal. You need to specify the path to the directory containing your COCO JSON annotation files and the directory where you want to save the resulting YOLO label files.
26+
JSON2YOLO functionality is now part of the main `ultralytics` Python package. To use the converter, first install the package:
2527

2628
```bash
27-
# Example usage: Convert COCO annotations to YOLO format
28-
python convert.py --json_dir path/to/coco/annotations --save_dir path/to/yolo/labels
29+
pip install ultralytics
2930
```
3031

31-
- `--json_dir`: Path to the directory containing COCO JSON annotation files (e.g., `instances_train2017.json`).
32-
- `--save_dir`: Path to the directory where the converted YOLO label files (`.txt`) will be saved.
32+
You can then easily convert COCO JSON datasets to YOLO format using the `convert_coco` method. Here's an example using keypoint annotations:
33+
34+
```python
35+
from ultralytics.data.converter import convert_coco
36+
37+
convert_coco(
38+
labels_dir="path/to/labels.json",
39+
save_dir="path/to/output_dir",
40+
use_keypoints=True,
41+
)
42+
```
3343

34-
This script will process the JSON files, extract bounding box information, and convert it into the YOLO format, saving one `.txt` file per image in the specified save directory. For more details on [dataset formats](https://docs.ultralytics.com/datasets/), refer to our documentation.
44+
This method processes your JSON file, converts annotations (bounding boxes and keypoints), and saves the labels in YOLO format (`.txt` files) within the specified directory. For more details, refer to our [dataset format documentation](https://docs.ultralytics.com/datasets/).
3545

3646
## 📚 Citation
3747

0 commit comments

Comments
 (0)