Package: labelme2datasets
labelme2Datasetspython scripts to convert labelme-generated-jsons to voc/coco style datasets.Report Bug·Request Feature（中文 README）Table of ContentsAbout The ProjectBuilt WithGetting StartedPrerequisitesInstallationUsageRoadmapContributingLicenseContactAcknowledgmentsAbout The ProjectScripts in this repository are used to convertlabelme-annotated jsons into standard datasets inPASCAL VOCformat orMS COCOformat.Scripts are written inPython.Most of the scripts refer to theexamplessection of labelme. Then I add some features according my own dataset, like class name conversion, customise image name, etc.Attention: these scripts are not complicated, and if you have the basis of python, please go through the convert workflows, and ensure that it fits your datasets. There are some places I annotatedMARK, which means pay attention to it, and you could customize it to fit your needs.Customize: these scripts are only for the conversion of data I currently have. If you want to convert datasets in other areas, like instance segmentation, segmantic segmentation, video annotation, etc. please take a look at theexamplessection in labelme.(back to top)Built WithPythonlabelmeimgviz(back to top)Getting StartedPrerequisitesgather the labelme-annotated jsons into a folder. In the next steps, we will refer to this folder aslabelme_jsons_dir.prepare a text file to store class names in your dataset. named itlabel_names.txt. take a look attest/label_names.txtfor an example.if need class name conversion, prepare a text file to store the conversion rules. named itlabel_dict.txt. take a look attest/label_dict.txtfor an example.Installationinstall in develop modesuggested to use virtualenv to install python packages.condacreate--name=labelmepython=3.6
condaactivatelabelme
pipinstall-rrequirements.txtclone the repo.gitclonegit@github.com:veraposeidon/labelme2Datasets.gitinstall the packagecdlabelme2Datasets# (prefer this way!) install in editable mode, so that you can modify the packagepipinstall-e.# install in non-editable mode, so that you can use the package, but cannot modify it#python setup.py installsimply use PyPII also published a PyPI package namedlabelme2datasets.you can just usepip3 install labelme2datasetsto install this package.if the baseline in this project not work for your datasets, you can install in develop mode, and modify the code by your own.(back to top)Usageconvert a single json into dataset. (labelme_json2dataset.py)labelme_json2dataset--json_file=data/test.json\--output_dir=output/test_single_outputconvert a folder of jsons into voc-format dataset. (labelme_bbox_json2voc.py)without label conversionlabelme_bbox_json2voc--json_dir=data/test_jsons\--output_dir=output/test_voc_output--labelsdata/label_names.txtwith label conversionlabelme_bbox_json2voc--json_dir=data/test_jsons\--output_dir=output/test_voc_output\--labelsdata/label_names.txt\--label_dictdata/label_dict.txtsplitting voc datasets into train set and test set. (split_voc_datasets.py)split_voc_datasets--voc_diroutput/test_voc_output--test_ratio0.3--random_seed42train.txtandtest.txtshould be generated invoc_dir/ImageSets/Main/.turn voc format dataset into coco style dataset. (voc2coco.py)voc2coco--voc_diroutput/test_voc_output--coco_diroutput/test_coco_output(back to top)Roadmapadd all scripts with pylint passedchinese and english readmemodify project architecturepublish as packageSee theopen issuesfor a full list of proposed features (and known issues).(back to top)ContributingContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make aregreatly appreciated.If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull Request(back to top)LicenseDistributed under the MIT License. SeeLICENSEfor more information.(back to top)Contactveraposeidon -veraposeidon@gmail.comProject Link:https://github.com/veraposeidon/labelme2Datasets(back to top)Acknowledgmentslabelmelabelme2coco(back to top)