ultralytics / yolov5

YOLOv5 ๐Ÿš€ in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
49.78k stars 16.12k forks source link

COCO2YOLO with the segmentation feature #12272

Closed Lokesh-26 closed 11 months ago

Lokesh-26 commented 11 months ago

Search before asking

Question

Hello, I have a coco.json file and I want to convert it to YOLO format. The inbuilt library from ultralytics.data.converter import convert_coco and the repository JSON2YOLO gives an error. I am trying to convert it to YOLO format with (use_segment = "False")>

I have also visited the issue in the JSON2YOLO repo. https://github.com/ultralytics/JSON2YOLO/issues

Annotations /home/gouda/test/coco/annotations/scene_gt_coco_modal.json: 0%| | 0/100 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/gouda/yolov5/main.py", line 4, in convert_coco(labels_dir='/home/gouda/test/coco/annotations',save_dir='/home/gouda/test/coco_converted',use_segments=False) File "/home/gouda/.local/lib/python3.8/site-packages/ultralytics/data/converter.py", line 139, in convert_coco with open((fn / f).with_suffix('.txt'), 'a') as file: FileNotFoundError: [Errno 2] No such file or directory: '/home/gouda/test/coco_converted/labels/scene_gt_coco_modal/rgb/000000.txt'

Additional

No response

github-actions[bot] commented 11 months ago

๐Ÿ‘‹ Hello @Lokesh-26, thank you for your interest in YOLOv5 ๐Ÿš€! Please visit our โญ๏ธ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a ๐Ÿ› Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training โ“ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Requirements

Python>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Introducing YOLOv8 ๐Ÿš€

We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 ๐Ÿš€!

Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.

Check out our YOLOv8 Docs for details and get started with:

pip install ultralytics
glenn-jocher commented 11 months ago

@Lokesh-26 the error you are encountering seems to be related to the convert_coco function from the ultralytics.data.converter module. This function is not part of the YOLOv5 repository, but rather from another repository called JSON2YOLO.

To troubleshoot this issue, I recommend visiting the issue you mentioned in the JSON2YOLO repository. The maintainers of that repository will be better equipped to help you resolve this problem. You can post the error message and any additional details in the issue thread, and they will provide guidance on how to proceed.

Please note that the YOLOv5 repository does not currently have a built-in function like convert_coco. However, there are other community-developed tools available that can help you convert COCO format annotations to YOLO format. You may want to explore these alternatives if the issue with JSON2YOLO persists.

I hope this helps, and I encourage you to seek assistance from the JSON2YOLO repository for a more accurate and specific solution to your problem.

Lokesh-26 commented 11 months ago

Thank you for your quick reply

Lokesh-26 commented 11 months ago

Thank you for your quick reply.

glenn-jocher commented 11 months ago

@Lokesh-26 you're welcome! If you have any further questions or need additional assistance, feel free to ask. We're here to help!