Utility functions to parse json file generated by labelme
Project description
labelme-parse
Utility functions to parse json file generated by labelme
Installation
You can install the package via pip:
pip install labelme-parse
Usage
from pathlib import Path
from labelme_parse import get_point
from labelme_parse import get_point_names
from labelme_parse import get_poly
from labelme_parse import get_poly_names
from labelme_parse import get_rect
from labelme_parse import get_rect_names
d = Path("path/to/dir")
print(get_point_names(d))
# ["dp_7_to_dp_0"]
print(get_rect_names(d))
# ["dp_0"]
print(get_poly_names(d))
# ["dp_8"]
print(get_point(d, "dp_7_to_dp_0"))
# (329, 919)
print(get_rect(d, "dp_0"))
# (301, 897, 38, 38)
print(get_poly(d, "dp_8"))
# [(317, 909), (309, 909), (309, 914), (313, 914), (313, 920), (327, 920), (327, 914), (331, 914), (331, 909), (322, 909), (322, 907), (317, 907)]
License
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
labelme_parse-1.0.6.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for labelme_parse-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f336d8b3cf5e1c24ccfe177ee6a9cdb9fc48dcbd7d9ec55e8ec0b425bcb3d830 |
|
MD5 | 898329a419755e45d1c1fc503e2785ee |
|
BLAKE2b-256 | d4478100da5f45b12eaa2e07e6aa776b2d6634f394b9d5ca2c50bbcaee850404 |