From 1d2931f39b0b2afe23d203fa80294af3e6c3876d Mon Sep 17 00:00:00 2001 From: rooneysh Date: Thu, 19 Aug 2021 15:35:37 +0800 Subject: [PATCH] Update README.md --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 784e267..9f2e16b 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ Convert LabelMe Annotation Tool JSON format to YOLO text file format. ## How to Use -### Convert JSON Files, split training and validation dataset by --val_size -Put all LabelMe JSON files in to **labelme_json_dir**, and run this python command. +### Convert JSON files, split training and validation dataset by --val_size +Put all LabelMe JSON files under **labelme_json_dir**, and run this python command. ```bash python labelme2yolo.py --json_dir /home/username/labelme_json_dir/ --val_size 0.2 ``` @@ -24,13 +24,13 @@ Script would generate YOLO format dataset labels and images under different fold /home/username/labelme_json_dir/YOLODataset/images/val/ ``` -### Convert JSON Files, split training and validation dataset by folder +### Convert JSON files, split training and validation dataset by folder If you already split train dataset and validation dataset for LabelMe by yourself, please put these folder under labelme_json_dir, for example, ```bash /home/username/labelme_json_dir/train/ /home/username/labelme_json_dir/val/ ``` -Put all LabelMe JSON files in to **labelme_json_dir**. +Put all LabelMe JSON files under **labelme_json_dir**. Script would read train and validation dataset by folder. Run this python command. ```bash @@ -43,3 +43,14 @@ Script would generate YOLO format dataset labels and images under different fold /home/username/labelme_json_dir/YOLODataset/images/train/ /home/username/labelme_json_dir/YOLODataset/images/val/ ``` + +### Convert single JSON file +Put LabelMe JSON file under **labelme_json_dir**. , and run this python command. +```bash +python labelme2yolo.py --json_dir /home/username/labelme_json_dir/ --json_name 2.json +``` +Script would generate YOLO format text label and image under **labelme_json_dir**, for example, +```bash +/home/username/labelme_json_dir/2.text +/home/username/labelme_json_dir/2.png +```