Skip to content

Commit d6ad351

Browse files
committed
Added PointCloud()
1 parent d9ccdac commit d6ad351

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

backend/kangas/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
Tensor,
2727
Text,
2828
Video,
29+
PointCloud,
2930
)
3031
from .integrations import export_to_comet, import_from_comet # noqa
3132
from .server.queries import sqlite_query, sqlite_query_explain # noqa

backend/kangas/datatypes/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
from .tensor import Tensor
2222
from .text import Text
2323
from .video import Video
24+
from .pointcloud import PointCloud
2425

2526
for name, cls, asset_type in [
2627
(None, Asset, "asset"),
2728
("AUDIO-ASSET", Audio, "audio"),
2829
("CURVE-ASSET", Curve, "curve"),
2930
("IMAGE-ASSET", Image, "image"),
31+
("POINTCLOUD-ASSET", PointCloud, "pointcloud"),
3032
("TEXT-ASSET", Text, "text"),
3133
("VIDEO-ASSET", Video, "video"),
3234
("EMBEDDING-ASSET", Embedding, "embedding"),
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
######################################################
3+
# _____ _____ _ _ #
4+
# (____ \ _ | ___) (_) | | #
5+
# _ \ \ ____| |_ ____| | ___ ___ _ _ | | #
6+
# | | | )/ _ | _)/ _ | |(_ / __) |/ || | #
7+
# | |__/ ( ( | | | ( ( | | |__| | | | ( (_| | #
8+
# |_____/ \_||_|___)\_||_|_____/|_| |_|\____| #
9+
# #
10+
# Copyright (c) 2023-2024 Kangas Development Team #
11+
# All rights reserved #
12+
######################################################
13+
14+
import logging
15+
import json
16+
17+
from .base import Asset
18+
19+
LOGGER = logging.getLogger(__name__)
20+
21+
class PointCloud(Asset):
22+
"""
23+
A PointCloud asset.
24+
"""
25+
26+
ASSET_TYPE = "PointCloud"
27+
28+
def __init__(
29+
self,
30+
scene_name=None,
31+
points=None,
32+
boxes=None,
33+
step=None,
34+
metadata=None,
35+
source=None,
36+
unserialize=False,
37+
):
38+
super().__init__(source)
39+
if unserialize:
40+
# A function that takes the object to lookup
41+
self._unserialize = unserialize
42+
return
43+
44+
self.metadata["scene_name"] = scene_name
45+
self.metadata["step"] = step
46+
47+
self.asset_data = json.dumps(
48+
{
49+
"points": points,
50+
"boxes": boxes,
51+
}
52+
)

frontend/lib/consts/cellMap.js

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ const cellMap = {
6363
groupedWidth: 300,
6464
component: EmbeddingCell
6565
},
66+
'POINTCLOUD-ASSET': {
67+
width: 150,
68+
groupedWidth: 300,
69+
component: NACell
70+
},
6671
ROW_ID: {
6772
width: 100,
6873
groupedWidth: 100,

0 commit comments

Comments
 (0)