Package providing utilities to load, manipulate, convert and visualize COCO format datasets.
Project description
rpycocotools
The rpycocotools
package provides tools to load, manipulate, convert and visualize COCO format datasets. The documentation is available here.
Installation
The package is available on PyPI here, and can installed with pip:
pip install rpycocotools
You can also git clone this repo and build it yourself with:
pip install -r requirements/requirements-build.txt
pip install .
Usage example
Visualize image with a given id
:
import rpycocotools
coco_dataset = rpycocotools.COCO("../data_samples/coco_25k/annotations.json", "../data_samples/coco_25k/images")
coco_dataset.visualize_img(174482)
import rpycocotools
coco_dataset = rpycocotools.COCO("../data_samples/coco_25k/annotations.json", "../data_samples/coco_25k/images")
anns = coco_dataset.get_img_anns(174482)
mask = rpycocotools.mask.decode(anns[0].segmentation)
The mask is a numpy array and can be visualized (for example with opencv):
Benchmarks
Details
There are a few benchmarking scripts to compare to pycocotools
.
The results reported here are done on my own PC and presented only to get a general idea. I might run the benchmark on a more reproducible environment in the future.
Setup
Some of the benchmarks use the instances_train2017.json
files from the 2017 COCO dataset.
Either place this file in the data_samples
folder or only run the commands below with the -m "not coco2017"
option.
pip install -r requirements/requirements-benchmarks.txt
pip install .
Load
Benchmark how much time it takes load a COCO dataset.
python -m pytest benchmarks/load.py -vv
Results:
Test Name | Mean time in s |
---|---|
rpycocotools on COCO instances_train2017.json |
4.4 |
pycocotools on COCO instances_train2017.json |
16.5 |
Area
Benchmark how much time it takes to compute the total number of mask pixels in a COCO dataset.
python -m pytest benchmarks/area.py -vv -m coco2017
Results:
Test Name | Mean time in ms |
---|---|
rpycocotools on COCO instances_train2017.json |
880.6 |
pycocotools on COCO instances_train2017.json |
19,302.9 |
Decode masks
Benchmark how much time it takes to decode all the masks in a COCO dataset.
python -m pytest benchmarks/decode.py -vv -m coco2017
Results:
Test Name | Mean time in s |
---|---|
rpycocotools on COCO instances_train2017.json |
371 |
pycocotools on COCO instances_train2017.json |
141 |
Results after converting all the segmentations to RLE before decoding (conversion time not included):
Test Name | Mean time in s |
---|---|
rpycocotools on COCO instances_train2017.json |
300 |
pycocotools on COCO instances_train2017.json |
120 |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for rpycocotools-0.0.7-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 024460cfdaf4d6f747c87a0b537ec7bd5b1f0b4af72299c9fc2c9df38050437a |
|
MD5 | 7a4f410242bb787bc77af34c6fc0f955 |
|
BLAKE2b-256 | eee70ee95afe7cd2a3305bc04d260f7ea9e2a5730c32d83903e1788465fdf4fd |
Hashes for rpycocotools-0.0.7-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d996bd9dde23fb52ad3ebe0ec072b489600903d5f68cced02a89bcee49b8595 |
|
MD5 | 199e3cc1354f48c1d40cd2a6a3fd96c4 |
|
BLAKE2b-256 | ced8230823a9081f53973ec42badb3b13fa43589420386700ed21edb3541cd0e |
Hashes for rpycocotools-0.0.7-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e00a335adfc3fa51fe3435cc3885ee26f23fb8d6298e60bd5058d5570f3d5a41 |
|
MD5 | f0229b92598b24ff81fe304a6f0cc5c1 |
|
BLAKE2b-256 | 0209302acb1d7f65acfe8dbd52368302a5184098a2c38f2d7772c34b35732ac8 |
Hashes for rpycocotools-0.0.7-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f227447a792d206ff6bd1e7500b472c9b41f32152fd0d3b52d38282c64939fa0 |
|
MD5 | 0571e3d203c586a53782623952489380 |
|
BLAKE2b-256 | 2133b23aa89df771f151e0b082395f79e0463fe223d75f157680d9d9ea7a8dac |
Hashes for rpycocotools-0.0.7-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 694d084b12179d764965694e3ee76e67dccaf56725f01d47896516fec3bb5ec3 |
|
MD5 | 4fa3636933bb07d6b87c3fab4e480290 |
|
BLAKE2b-256 | 7bfc270a94a8efcd9bcda45d2f6619e30a7d733c30a9d3980cc917cebf85a082 |
Hashes for rpycocotools-0.0.7-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b321a6cec6ac5b651a442ed5510abc5ce4e21b47ab5d28f5c2b62869992d849 |
|
MD5 | f746241f71dd0ba3201718af9e843ec6 |
|
BLAKE2b-256 | b7a0df16772ed5cde403b2443b6b0735d920021c34d5fd2cde6509eb94761af0 |
Hashes for rpycocotools-0.0.7-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cd8379a1612b3608aeb3ef0b4c03d7c78366ea61292e794273d719d8ad413f4 |
|
MD5 | 6bbf1be20c8571d77cd6cb46bd40326a |
|
BLAKE2b-256 | a907453d9d5c3e3a6c2495152b495f5dead4ca7d9cd0b6541376d6bc2ae9678d |
Hashes for rpycocotools-0.0.7-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9b7ee7b2aa45c957c7576a6900f8945858a49162421a04bf9aa7199c112f603 |
|
MD5 | 2bf760e9846bc964bb284f11ed2b1ae8 |
|
BLAKE2b-256 | 2c43888ffade71183090d9e26484be04480c29b8a1218b997257d73af7b3f0f5 |
Hashes for rpycocotools-0.0.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fe4722484f917b2b982588b67050f8812afed7d0e5bfce0f79892b2c403204e |
|
MD5 | ae7230b6c9c14db184a52e78e1af7675 |
|
BLAKE2b-256 | 88e6f127a6fa3c25504a1241c5abd669bd8f552e3868340c922392bd750dcba5 |
Hashes for rpycocotools-0.0.7-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99e36b9bbf8a3bd21cdbe26882d17124c52a2ff7f480c14556ac1eebe4e9b749 |
|
MD5 | 1d80242dcb9db4122a962889230d245e |
|
BLAKE2b-256 | 59953fb12768518cc8623050d518399eb198e486992568413df43ffd1e042974 |
Hashes for rpycocotools-0.0.7-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17f5c3091dbeb5fb830ca9ef033f95d4ab80d79bbe3a64be9b7b8b1165493150 |
|
MD5 | c269954140a2facbcedf2f4797fd72bf |
|
BLAKE2b-256 | 2a772f1ab5a8b8f71ce8ed96bbf1a58aafa6f02b1dcbd8fb445779a5a2bb5da7 |
Hashes for rpycocotools-0.0.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b53f43601b5c7853e32fb45dc6fef2e88f02e9b4baf5054981801a798d840ae8 |
|
MD5 | 4e0bef6a1f3585556ee916135fa3546b |
|
BLAKE2b-256 | 468f737ee0aed192040ba8b49470d210a6115092e0f6bd7abd281fe49de094d8 |
Hashes for rpycocotools-0.0.7-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad16ced412088400c59066ac70f354324dcca00505f00c300802f4210940d22b |
|
MD5 | 56e866843a9352c7438fff80d48af360 |
|
BLAKE2b-256 | cb56b79cdfdfe835cabb158f7f7ccc0119e946106eb7f6fa5f9a1741af395f77 |
Hashes for rpycocotools-0.0.7-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea2ca3f6142f26a2e70c426accb791d76ac9ead62463829ad302f147cf3ef862 |
|
MD5 | f6a6f1571e11330f1bc1b58bf5f43b0b |
|
BLAKE2b-256 | 653faa0b698c32bdd876205f7f7315cf95cbf4da120cdc6ddbfceac1d5cd8533 |
Hashes for rpycocotools-0.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3fc30d806444a849033c535161e36eadf7e3ba3d9d4f0b31b578632b78875bb |
|
MD5 | 9a81bb634a4d6a21cbae89702cc3d3e0 |
|
BLAKE2b-256 | 992e849cfbab050d93688aadadf0e78bcb043a10bc65f0cc0e00325702ef6d8c |
Hashes for rpycocotools-0.0.7-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01368b813633a3b3017c0321fbad96ab53a6ac94459897bfc15be792cc10f19f |
|
MD5 | 7c98a34dd46f0838257c367d5035f90e |
|
BLAKE2b-256 | a889e189a8eed467206c5a617b97f4bee5125338ac2f4644c74b5ed089b1b727 |
Hashes for rpycocotools-0.0.7-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ec2d7686d862e0e6ab8ae69945148b2141e95911d317a80419c6a9a33a43d7e |
|
MD5 | e3990fe8d61da1b9efa1ccad6cd1644e |
|
BLAKE2b-256 | f7e7e87b182e1894f129ff5bc5c000febb73ac0334c56a3244c8b09e33f00921 |
Hashes for rpycocotools-0.0.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64694cdf209ad258c06515220d6d19a82fde3ca66fe66ad01c52e58d8960da54 |
|
MD5 | 0fac9bf3d09c5a0e1e1c9a7d17804322 |
|
BLAKE2b-256 | 5f7543acdf2730b6adf27da3303e731f60ee6d10e3755e4edcbb08c260866774 |
Hashes for rpycocotools-0.0.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0b896b430aee33539c0c1f470d6be4fe4ff5bfbdf6910749e08b8d31a3616f7 |
|
MD5 | 94374a308b14ee43064d09e091009128 |
|
BLAKE2b-256 | 581aa2f3ea6ef3b70c37967a3a12721aedcd5408878b4b60c6072aad54edac01 |
Hashes for rpycocotools-0.0.7-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41d3659aa8731c0340df8d0f2acc2edac42c6feff0b310868971525c0d6bd820 |
|
MD5 | 9d920cca98bea5af8b9b1d624c37efe1 |
|
BLAKE2b-256 | 9a7082dff6f1f226ef716676df954d82be4270aee4e579238474d2197be26445 |
Hashes for rpycocotools-0.0.7-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3084634b572778c62367e28eca6140229c86ecfcde3c5e488d86347b94c6ee6d |
|
MD5 | bb5604f9058f16037a718e27e96fb384 |
|
BLAKE2b-256 | 664c51010149833b33db5b2eb3b3d96340c46f4248947a1d5189aa4b6b56d39b |
Hashes for rpycocotools-0.0.7-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3538387d1077c30cdd04ac7b0831f3649a701f0fe635ca3f3aed9d449cf3a9e9 |
|
MD5 | a83b0cea363ec92c2780764a48af875e |
|
BLAKE2b-256 | 6cea680b8e079cbcccf49c14710436607aaa23b0c75526513a569f018b9008b3 |
Hashes for rpycocotools-0.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 067beec02a16101f25519e2a842bf336b98be5e084c735a8900d553189cb4f7c |
|
MD5 | c76e5714c3bc2fdd439f5492b2c562f3 |
|
BLAKE2b-256 | c4ba6d46b0c3f997d97d11cd2aadd34992ae1eb69eaee757298ee688dec16d70 |
Hashes for rpycocotools-0.0.7-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7db5d4d3997691d1d30cc05b302df532755b9d84da823a8e5808575f16e76686 |
|
MD5 | 6f517b42faa5a34a9c93354e81fe54fa |
|
BLAKE2b-256 | 711d947112dbad5aac4b077c75cec6378ce891618796d5d2726e49adb682e825 |
Hashes for rpycocotools-0.0.7-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03f110648e6d1a2e2af7572e2852f275c47126fe73632d6bc28229211a30e670 |
|
MD5 | 5a80fde7f8bce96928182c358280c51c |
|
BLAKE2b-256 | 22fa4d2aa7edf14ee250da1c089dad5c25ba65baba3942ce8d9944f49b217eff |
Hashes for rpycocotools-0.0.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c4f4705c3d322c5987ba84c8cb515173834081f736b1486f1721c4322c85541 |
|
MD5 | 44c67440ba301a1c416db1bcfa4600d4 |
|
BLAKE2b-256 | f14d423e62d84b4ff0e33a440483299d7055fa5188043432ee96aa7e9e288e2a |
Hashes for rpycocotools-0.0.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7490d44e18e180a1459428f90f01272e5cf7e7396b1e98dd78df1165fa3fe107 |
|
MD5 | 93770fe44510b730c742f0b347a83c4d |
|
BLAKE2b-256 | f2dce883a247b21ff553d9367e7e295c2a3fc217ed8ad7c839a2bf53927884b6 |
Hashes for rpycocotools-0.0.7-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c10860957d93066fe8e3ff53f8e4dc5b2132671542959863c9a826f035ce3ac |
|
MD5 | 2338f9f4b4f9fb0993133161212d0c9a |
|
BLAKE2b-256 | a8245d30bd2b94ab9473501844f6f271440410d7fa7b9fb4f0d26936e2ccf679 |
Hashes for rpycocotools-0.0.7-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ffb5af32bcbfed0a2dfdbcb947310c13901d0fb58c48976e356c3fa825019b0 |
|
MD5 | 3f62590ff6559eb5acfe5d0b9c0b2eae |
|
BLAKE2b-256 | c49bbe32fe0936237afe382496ce908c708d808ad69776e7a6c13bb62d6ced6b |
Hashes for rpycocotools-0.0.7-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3870a298da2244e93532213f95642d583775bcd8496045a93e5eb4c961dd0ba0 |
|
MD5 | 675e063671309e876fb7d551c662f0e8 |
|
BLAKE2b-256 | eb14f3d9f772a0c686c53fe48c177c35c0ac3308341023416b8be624bcbaf3a9 |
Hashes for rpycocotools-0.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e23f3221b258e38696c6353dd1aeaca9e835d2623e6703b6ab4fa015678916 |
|
MD5 | 363996aad2c994aa8d8cc3ec16b8335d |
|
BLAKE2b-256 | 1da96721a81e5cb61118dd549e9c1b63687f694ed21c8fc5c32d4f926c4f68d8 |
Hashes for rpycocotools-0.0.7-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd4969bdb5d20c34005f741faf9ea768a128ba9a455a65d1ffa5d788bf3496ac |
|
MD5 | 56e4f5baff56f28d84cfcb179534c6ac |
|
BLAKE2b-256 | 3f1babee0a4601b1ec1370f43ba7358a0fa60a824a7d4e4a25ddddaac1d4befd |
Hashes for rpycocotools-0.0.7-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 480c51a971bf3750f01f84ab404ce69bf0c808c1002c229e4b2feacb9028ce19 |
|
MD5 | e0ace004699c7d2bdbccc9c9dd9abbb2 |
|
BLAKE2b-256 | 9c2bd7ca622fee9da5f02b09ce3a899290d9ff6ed21cfef33fd13a3fb6fea6f2 |
Hashes for rpycocotools-0.0.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cb93ce323d406f2ff98a06ba011c022d1c302d4cd60f84482d4260839c266ec |
|
MD5 | 99c1d6ac93aeea51fc5b4ee10657424e |
|
BLAKE2b-256 | 564d9320cdf503905571081127ad1a3c1a4eb099cfae2ff07d9bb3d7ee2dfa96 |
Hashes for rpycocotools-0.0.7-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96dbf3870359c5fb676013c30b1f8b19e4d7fb18a7a53cd20d6e63b8047e270f |
|
MD5 | 54a0ec0b1a1d144e2155931a679feca1 |
|
BLAKE2b-256 | 69604a8defc15f369d30af7766e945fbe487d3df65bcbf9302fbcf8773d74ccb |
Hashes for rpycocotools-0.0.7-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 306dd00c3845e9ff516f44be1fc88efeaa2d702488aef85f6820f11a2c9e20b7 |
|
MD5 | 30f1a0cb971c0ce9085df7fa0885f478 |
|
BLAKE2b-256 | 8669ced91a4cf03adb6250b42b30b904c3283d5a3cca296b026985e5039d2ec3 |
Hashes for rpycocotools-0.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 545429e5685a38260cae608e3febc85fd3e3d1aa19722d785c8f7ed53f0ca8de |
|
MD5 | bd8e867cec5064c9e6e67ab94a9a64fd |
|
BLAKE2b-256 | ff7ebc2d45aa210a5941e23afcf7057c22c76d4d4ee48f597ab75ae5847e841d |
Hashes for rpycocotools-0.0.7-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 501ef2ff6d881447634ff075fe3efe8b96b0171673b21e9477f12a25b5a3c8f1 |
|
MD5 | 827111f4ff182fb9d31494a51c068599 |
|
BLAKE2b-256 | 1d1246ce8639a2c423d137246fc92bbace477c3308914fbefb73b1d3da311865 |
Hashes for rpycocotools-0.0.7-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ebab1511cc11eb06514bf854c0c028ab1e1cf1778c70fa069caea89efbb5d3f |
|
MD5 | ccf7f9ea30501aaad6003f8b327e1f0e |
|
BLAKE2b-256 | cfe4c961781c6f5206b9fef7e35d8587f989aa6653c2d4d9745776a8b2e0b632 |
Hashes for rpycocotools-0.0.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dcf58acd311096db64d115e50edd9fed4a227ad20051bf7941688e5ded6dc0a |
|
MD5 | 698a47d3063d07df175c32b7a80bdfc5 |
|
BLAKE2b-256 | 6a8b15b7abf3ff12b0badef410f9f337cf5cabcd0fb1c335bd3c36ae07287399 |