annofabapi-3dpc-extensions
annofabapiの3次元アノテーション用の拡張機能です。
Install
- Python 3.12+
Install
$ pip install annofabapi-3dpc-extensions
Usage
cuboidアノテーションやセグメントアノテーションに対応したデータクラスを利用できます。
from annofabapi.parser import SimpleAnnotationDirParser
from annofab_3dpc.annotation import (
CuboidAnnotationDetailDataV2,
EulerAnglesZXY,
SegmentAnnotationDetailData,
SegmentData,
convert_annotation_detail_data,
)
parser = SimpleAnnotationDirParser("tests/data/task1/input1.json")
result = parser.parse(convert_annotation_detail_data)
segment_annotation_data = result.details[0].data
cuboid_annotation_data = result.details[1].data
assert type(segment_annotation_data) == SegmentAnnotationDetailData
assert type(cuboid_annotation_data) == CuboidAnnotationDetailDataV2
### cuboid annotation
print(cuboid_annotation_data)
# => CuboidAnnotationDetailDataV2(shape=CuboidShapeV2(dimensions=Size(width=6.853874863204751, height=0.2929844409227371, depth=4.092537841193188), location=Location(x=-11.896872014598989, y=-3.0571381239812996, z=0.3601047024130821), rotation=EulerAnglesZXY(x=0, y=0, z=0), direction=CuboidDirection(front=Vector3(x=1, y=0, z=0), up=Vector3(x=0, y=0, z=1))), kind='CUBOID', version='2')
# オイラー角をクォータニオンに変換
print(cuboid_annotation_data.shape.rotation.to_quaternion())
# => [1.0, 0.0, 0.0, 0.0]
# クォータニオンからオイラー角に変換
print(EulerAnglesZXY.from([1.0, 0.0, 0.0, 0.0]))
# => EulerAnglesZXY(x=-0.0, y=0.0, z=0.0)
### segment annotation
print(segment_annotation_data)
# => SegmentAnnotationDetailData(data_uri='./input1/7ba51c15-f07a-4e29-8584-a4eaf3a6812a')
# セグメント情報が格納されたファイルを読み込む
with parser.open_outer_file(Path(segment_annotation_data.data_uri).name) as f:
dict_segmenta_data = json.load(f)
segment_data = SegmentData.from_dict(dict_segmenta_data)
assert type(segment_data) == SegmentData
assert len(segment_data.points) > 0
print(segment_data.points)
# => [130439, 130442, ... ]
開発者向けドキュメント
https://github.com/kurusugawa-computer/annofabapi-3dpc-extensions/blob/main/README_for_developer.md 参照
Metadata
Release files for annofabapi-3dpc-extensions 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| annofabapi_3dpc_extensions-0.3.1.tar.gz | 97.4 kB | Without provenance | Details for annofabapi_3dpc_extensions-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| annofabapi_3dpc_extensions-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for annofabapi_3dpc_extensions-0.3.1-py3-none-any.whl |
Total release size: 104.7 kB
Release files / annofabapi_3dpc_extensions-0.3.1.tar.gz
| Download URL | annofabapi_3dpc_extensions-0.3.1.tar.gz |
|---|---|
| Size | 97.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
075f8bc46efe9a9362e7f1ce177900b144553fadedd7647bf260c1f58d11d60d
|
|
BLAKE2b-256 checksum How to use checksums |
21ad8645ebdf8e8187f31e62a16e84fdce1d286f0b7976cf5b1b2cb088b9f618
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / annofabapi_3dpc_extensions-0.3.1-py3-none-any.whl
| Download URL | annofabapi_3dpc_extensions-0.3.1-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9ea1b0e46bed27bb08bcd0912510694f5aff87f0ce2eb6063a5d98177afbf1b
|
|
BLAKE2b-256 checksum How to use checksums |
4f156049acc0b8e767ac3c45450e2ba06764d17ee211bf9360b0b45da5a30bd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for annofabapi-3dpc-extensions 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.