|
1 | | -<br> |
2 | | -<a href="https://www.ultralytics.com/" target="_blank"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a> |
| 1 | +<a href="https://www.ultralytics.com/"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a> |
3 | 2 |
|
4 | 3 | # 🚀 Introduction |
5 | 4 |
|
6 | | -Welcome to the [JSON2YOLO](https://github.com/ultralytics/JSON2YOLO) repository! This toolkit is designed to help you convert datasets in JSON format, following the COCO (Common Objects in Context) standards, into YOLO (You Only Look Once) format, which is widely recognized for its efficiency in real-time object detection tasks. |
| 5 | +Welcome to the [JSON2YOLO](https://github.com/ultralytics/JSON2YOLO) repository! This toolkit is designed to help you convert datasets in [JSON](https://www.ultralytics.com/glossary/json) format, particularly those following the [COCO (Common Objects in Context)](https://cocodataset.org/#home) standards, into the [YOLO format](https://docs.ultralytics.com/datasets/#yolo-format). The YOLO format is widely recognized for its efficiency in [real-time](https://www.ultralytics.com/glossary/real-time-inference) [object detection](https://docs.ultralytics.com/tasks/detect/) tasks. |
7 | 6 |
|
8 | | -This process is essential for machine learning practitioners looking to train object detection models using the Darknet framework. Our code is flexible and can be utilized across various platforms including Linux, MacOS, and Windows. |
| 7 | +This conversion process is essential for [machine learning](https://www.ultralytics.com/glossary/machine-learning-ml) practitioners looking to train object detection models using frameworks compatible with the YOLO format, such as [Ultralytics YOLO](https://docs.ultralytics.com/models/yolo11/). Our code is flexible and designed to run across various platforms including Linux, macOS, and Windows. |
9 | 8 |
|
10 | | -[](https://github.com/ultralytics/JSON2YOLO/actions/workflows/format.yml) <a href="https://discord.com/invite/ultralytics"><img alt="Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a> <a href="https://community.ultralytics.com/"><img alt="Ultralytics Forums" src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue"></a> <a href="https://reddit.com/r/ultralytics"><img alt="Ultralytics Reddit" src="https://img.shields.io/reddit/subreddit-subscribers/ultralytics?style=flat&logo=reddit&logoColor=white&label=Reddit&color=blue"></a> |
| 9 | +[](https://github.com/ultralytics/JSON2YOLO/actions/workflows/format.yml) |
| 10 | +[](https://discord.com/invite/ultralytics) |
| 11 | +[](https://community.ultralytics.com/) |
| 12 | +[](https://reddit.com/r/ultralytics) |
11 | 13 |
|
12 | | -# ⚙️ Requirements |
| 14 | +## ⚙️ Requirements |
13 | 15 |
|
14 | | -To get started with COCO2YOLO, you'll need a Python environment running version 3.8 or later. Additionally, you'll need to install all the necessary dependencies listed in our [requirements.txt](https://github.com/ultralytics/JSON2YOLO/blob/main/requirements.txt) file. You can install these dependencies using the following pip command in your terminal: |
| 16 | +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: |
15 | 17 |
|
16 | 18 | ```bash |
17 | | -$ pip install -r requirements.txt # Installs all the required packages |
| 19 | +pip install -r requirements.txt # Installs all the required packages |
18 | 20 | ``` |
19 | 21 |
|
20 | | -# 📚 Citation |
| 22 | +## 💡 Usage |
| 23 | + |
| 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. |
| 25 | + |
| 26 | +```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 | +``` |
| 30 | + |
| 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. |
| 33 | + |
| 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. |
| 35 | + |
| 36 | +## 📚 Citation |
21 | 37 |
|
22 | 38 | If you find our tool useful for your research or development, please consider citing it: |
23 | 39 |
|
24 | 40 | [](https://zenodo.org/badge/latestdoi/186122711) |
25 | 41 |
|
26 | | -# 🤝 Contribute |
| 42 | +## 🤝 Contribute |
27 | 43 |
|
28 | 44 | We welcome contributions from the community! Whether you're fixing bugs, adding new features, or improving documentation, your input is invaluable. Take a look at our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) to get started. Also, we'd love to hear about your experience with Ultralytics products. Please consider filling out our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). A huge 🙏 and thank you to all of our contributors! |
29 | 45 |
|
30 | | -<!-- Ultralytics contributors --> |
31 | | - |
32 | | -<a href="https://github.com/ultralytics/yolov5/graphs/contributors"> |
33 | | -<img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/image-contributors.png" alt="Ultralytics open-source contributors"></a> |
| 46 | +[](https://github.com/ultralytics/ultralytics/graphs/contributors) |
34 | 47 |
|
35 | | -# ©️ License |
| 48 | +## ©️ License |
36 | 49 |
|
37 | | -Ultralytics is excited to offer two different licensing options to meet your needs: |
| 50 | +Ultralytics offers two licensing options to accommodate diverse needs: |
38 | 51 |
|
39 | | -- **AGPL-3.0 License**: Perfect for students and hobbyists, this [OSI-approved](https://opensource.org/license) open-source license encourages collaborative learning and knowledge sharing. Please refer to the [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) file for detailed terms. |
40 | | -- **Enterprise License**: Ideal for commercial use, this license allows for the integration of Ultralytics software and AI models into commercial products without the open-source requirements of AGPL-3.0. For use cases that involve commercial applications, please contact us via [Ultralytics Licensing](https://www.ultralytics.com/license). |
| 52 | +- **AGPL-3.0 License**: Ideal for students and enthusiasts, this [OSI-approved](https://opensource.org/license/agpl-v3) open-source license promotes collaboration and knowledge sharing. See the [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) file for details. |
| 53 | +- **Enterprise License**: Designed for commercial use, this license permits seamless integration of Ultralytics software and AI models into commercial products and services, bypassing the open-source requirements of AGPL-3.0. For commercial inquiries, please contact us through [Ultralytics Licensing](https://www.ultralytics.com/license). |
41 | 54 |
|
42 | | -# 📬 Contact Us |
| 55 | +## 📬 Contact Us |
43 | 56 |
|
44 | | -For bug reports, feature requests, and contributions, head to [GitHub Issues](https://github.com/ultralytics/JSON2YOLO/issues). For questions and discussions about this project and other Ultralytics endeavors, join us on [Discord](https://discord.com/invite/ultralytics)! |
| 57 | +For bug reports, feature requests, and contributions, please visit [GitHub Issues](https://github.com/ultralytics/JSON2YOLO/issues). For broader questions and discussions about this project and other Ultralytics initiatives, join our vibrant community on [Discord](https://discord.com/invite/ultralytics)! |
45 | 58 |
|
46 | 59 | <br> |
47 | 60 | <div align="center"> |
|
0 commit comments