pyorbbec 1.0.1.19__tar.gz → 1.0.1.21__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. pyorbbec-1.0.1.21/PKG-INFO +7 -0
  2. pyorbbec-1.0.1.21/pyorbbec.egg-info/PKG-INFO +7 -0
  3. pyorbbec-1.0.1.21/pyorbbec.egg-info/SOURCES.txt +13 -0
  4. pyorbbec-1.0.1.21/pyorbbec.egg-info/top_level.txt +1 -0
  5. pyorbbec-1.0.1.21/pyproject.toml +3 -0
  6. pyorbbec-1.0.1.21/setup.py +77 -0
  7. pyorbbec-1.0.1.21/test/test_context.py +54 -0
  8. pyorbbec-1.0.1.21/test/test_device.py +84 -0
  9. pyorbbec-1.0.1.21/test/test_pipeline.py +47 -0
  10. pyorbbec-1.0.1.21/test/test_sensor_control.py +474 -0
  11. pyorbbec-1.0.1.19/MANIFEST.in +0 -3
  12. pyorbbec-1.0.1.19/NOTICE +0 -2
  13. pyorbbec-1.0.1.19/PKG-INFO +0 -22
  14. pyorbbec-1.0.1.19/pyproject.toml +0 -4
  15. pyorbbec-1.0.1.19/setup.py +0 -91
  16. pyorbbec-1.0.1.19/src/pyorbbec.egg-info/PKG-INFO +0 -22
  17. pyorbbec-1.0.1.19/src/pyorbbec.egg-info/SOURCES.txt +0 -49
  18. pyorbbec-1.0.1.19/src/pyorbbec.egg-info/not-zip-safe +0 -1
  19. pyorbbec-1.0.1.19/src/pyorbbec.egg-info/requires.txt +0 -8
  20. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/.gitkeep +0 -0
  21. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/README.md +0 -26
  22. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/callback.py +0 -303
  23. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/color.py +0 -64
  24. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/coordinate_transform.py +0 -184
  25. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/depth.py +0 -107
  26. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/depth_work_mode.py +0 -50
  27. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/device_firmware_update.py +0 -155
  28. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/device_optional_depth_presets_update.py +0 -142
  29. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/enumerate.py +0 -118
  30. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/hdr.py +0 -216
  31. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/hot_plug.py +0 -160
  32. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/hw_d2c_align.py +0 -135
  33. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/imu.py +0 -60
  34. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/infrared.py +0 -115
  35. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/logger.py +0 -55
  36. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/metadata.py +0 -64
  37. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/multi_device.py +0 -169
  38. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/multi_streams.py +0 -219
  39. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/net_device.py +0 -158
  40. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/playback.py +0 -277
  41. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/point_cloud.py +0 -90
  42. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/post_processing.py +0 -119
  43. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/preset.py +0 -67
  44. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/quick_start.py +0 -90
  45. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/recorder.py +0 -236
  46. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/requirements.txt +0 -9
  47. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/save_image_to_disk.py +0 -106
  48. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/sync_align.py +0 -109
  49. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/two_devices_sync.py +0 -233
  50. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/examples/utils.py +0 -127
  51. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/depthengine/libdepthengine.so +0 -0
  52. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/depthengine/libdepthengine.so.2.0 +0 -0
  53. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/filters/libFilterProcessor.so +0 -0
  54. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/filters/libob_priv_filter.so +0 -0
  55. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/firmwareupdater/libfirmwareupdater.so +0 -0
  56. pyorbbec-1.0.1.19/src/pyorbbecsdk/linux_x64/extensions/frameprocessor/libob_frame_processor.so +0 -0
  57. {pyorbbec-1.0.1.19 → pyorbbec-1.0.1.21}/LICENSE +0 -0
  58. {pyorbbec-1.0.1.19 → pyorbbec-1.0.1.21}/README.md +0 -0
  59. {pyorbbec-1.0.1.19/src → pyorbbec-1.0.1.21}/pyorbbec.egg-info/dependency_links.txt +0 -0
  60. /pyorbbec-1.0.1.19/src/pyorbbec.egg-info/top_level.txt → /pyorbbec-1.0.1.21/pyorbbec.egg-info/not-zip-safe +0 -0
  61. {pyorbbec-1.0.1.19 → pyorbbec-1.0.1.21}/setup.cfg +0 -0
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyorbbec
3
+ Version: 1.0.1.21
4
+ Summary: pyorbbecsdk is a python wrapper for the OrbbecSDK
5
+ Author: zhonghong
6
+ Author-email: zhonghong@orbbec.com
7
+ License-File: LICENSE
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyorbbec
3
+ Version: 1.0.1.21
4
+ Summary: pyorbbecsdk is a python wrapper for the OrbbecSDK
5
+ Author: zhonghong
6
+ Author-email: zhonghong@orbbec.com
7
+ License-File: LICENSE
@@ -0,0 +1,13 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ pyorbbec.egg-info/PKG-INFO
6
+ pyorbbec.egg-info/SOURCES.txt
7
+ pyorbbec.egg-info/dependency_links.txt
8
+ pyorbbec.egg-info/not-zip-safe
9
+ pyorbbec.egg-info/top_level.txt
10
+ test/test_context.py
11
+ test/test_device.py
12
+ test/test_pipeline.py
13
+ test/test_sensor_control.py
@@ -0,0 +1 @@
1
+ pyorbbecsdk
@@ -0,0 +1,3 @@
1
+ [tool.cibuildwheel]
2
+ build = "cp39-* cp310-*"
3
+ archs = "AMD64" # Options: AMD64 ARM64 x86
@@ -0,0 +1,77 @@
1
+ # ******************************************************************************
2
+ # Copyright (c) 2024 Orbbec 3D Technology, Inc
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http:# www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ # ******************************************************************************
16
+
17
+ import os
18
+ import shutil
19
+
20
+ from setuptools import setup, Extension
21
+ from setuptools.command.build_ext import build_ext
22
+
23
+
24
+ class PrebuiltExtension(Extension):
25
+ def __init__(self, name, lib_dir=''):
26
+ super().__init__(name, sources=[]) # No sources to compile
27
+ self.lib_dir = os.path.abspath(lib_dir)
28
+
29
+
30
+ class CustomBuildExt(build_ext):
31
+ def run(self):
32
+ for ext in self.extensions:
33
+ self.build_extension(ext)
34
+
35
+ def build_extension(self, ext):
36
+ # Check if the lib directory exists and contains files
37
+ if not os.path.isdir(ext.lib_dir) or not os.listdir(ext.lib_dir):
38
+ raise FileNotFoundError(
39
+ f"Directory '{ext.lib_dir}' is empty or does not exist. "
40
+ "Please compile the necessary components with CMake as described in the README."
41
+ )
42
+
43
+ extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
44
+ os.makedirs(extdir, exist_ok=True) # Ensure the destination path exists
45
+ self.copy_all_files(ext.lib_dir, extdir)
46
+
47
+ def copy_all_files(self, source_dir, destination_dir):
48
+ os.makedirs(destination_dir, exist_ok=True) # Ensure the entire destination directory structure exists
49
+
50
+ for item in os.listdir(source_dir):
51
+ source_path = os.path.join(source_dir, item)
52
+ destination_path = os.path.join(destination_dir, item)
53
+
54
+ if os.path.islink(source_path):
55
+ link_target = os.readlink(source_path)
56
+ if os.path.exists(destination_path):
57
+ os.remove(destination_path)
58
+ os.symlink(link_target, destination_path)
59
+ print(f"Preserved symbolic link {destination_path} -> {link_target}")
60
+ elif os.path.isdir(source_path):
61
+ self.copy_all_files(source_path, destination_path)
62
+ else:
63
+ shutil.copy2(source_path, destination_path)
64
+ print(f"Copied {source_path} to {destination_path}")
65
+
66
+
67
+ setup(
68
+ name='pyorbbec',
69
+ version='1.0.1.21',
70
+ author='zhonghong',
71
+ author_email='zhonghong@orbbec.com',
72
+ description='pyorbbecsdk is a python wrapper for the OrbbecSDK',
73
+ long_description='',
74
+ ext_modules=[PrebuiltExtension('pyorbbecsdk', 'install/lib')],
75
+ cmdclass={'build_ext': CustomBuildExt},
76
+ zip_safe=False,
77
+ )
@@ -0,0 +1,54 @@
1
+ import unittest
2
+ from pyorbbecsdk import *
3
+
4
+
5
+ def on_device_connected_callback(_: DeviceList):
6
+ print("on_device_connected_callback")
7
+
8
+
9
+ def on_device_disconnected_callback(_: DeviceList):
10
+ print("on_device_disconnected_callback")
11
+
12
+
13
+ def on_set_device_changed_callback(disconn_list: DeviceList, conn_list: DeviceList):
14
+ on_device_disconnected_callback(disconn_list)
15
+ on_device_connected_callback(conn_list)
16
+
17
+
18
+ class ContextTest(unittest.TestCase):
19
+
20
+ def setUp(self) -> None:
21
+ self.context = Context()
22
+
23
+ def tearDown(self) -> None:
24
+ self.context = None
25
+
26
+ def test_get_device_list(self):
27
+ device_list = self.context.query_devices()
28
+ self.assertIsNotNone(device_list)
29
+ self.assertGreater(device_list.get_count(), 0)
30
+
31
+ def test_setup_logger_level(self):
32
+ self.context.set_logger_level(OBLogLevel.DEBUG)
33
+ self.context.set_logger_level(OBLogLevel.INFO)
34
+ self.context.set_logger_level(OBLogLevel.WARNING)
35
+ self.context.set_logger_level(OBLogLevel.ERROR)
36
+ self.context.set_logger_level(OBLogLevel.FATAL)
37
+ self.context.set_logger_level(OBLogLevel.NONE)
38
+
39
+ def test_set_device_changed_callback(self):
40
+ self.context.set_device_changed_callback(on_set_device_changed_callback)
41
+
42
+ def test_enable_multi_device_sync(self):
43
+ self.context.enable_multi_device_sync(100)
44
+
45
+ def test_set_logger_to_console(self):
46
+ self.context.set_logger_to_console(OBLogLevel.DEBUG)
47
+
48
+ def test_set_logger_to_file(self):
49
+ self.context.set_logger_to_file(OBLogLevel.DEBUG, "test.log")
50
+
51
+
52
+ if __name__ == '__main__':
53
+ print("Start test Context interface, Please make sure you have connected a device to your computer.")
54
+ unittest.main()
@@ -0,0 +1,84 @@
1
+ import unittest
2
+ from pyorbbecsdk import *
3
+
4
+
5
+ class DeviceTest(unittest.TestCase):
6
+ def setUp(self) -> None:
7
+ self.context = Context()
8
+ device_list = self.context.query_devices()
9
+ self.assertIsNotNone(device_list)
10
+ self.assertGreater(device_list.get_count(), 0)
11
+ self.device = device_list.get_device_by_index(0)
12
+ self.assertIsNotNone(self.device)
13
+
14
+ def tearDown(self) -> None:
15
+ self.device = None
16
+ self.context = None
17
+
18
+ def test_get_device_info(self):
19
+ device_info = self.device.get_device_info()
20
+ self.assertIsNotNone(device_info)
21
+ self.assertIsNotNone(device_info.get_name())
22
+ self.assertIsNotNone(device_info.get_pid())
23
+ self.assertIsNotNone(device_info.get_vid())
24
+ self.assertIsNotNone(device_info.get_serial_number())
25
+ self.assertIsNotNone(device_info.get_firmware_version())
26
+ self.assertIsNotNone(device_info.get_hardware_version())
27
+ self.assertIsNotNone(device_info.get_connection_type())
28
+ self.assertIsNotNone(device_info.get_device_type())
29
+ print("Device info: ", device_info)
30
+
31
+ def test_get_sensor_list(self):
32
+ sensor_list = self.device.get_sensor_list()
33
+ self.assertIsNotNone(sensor_list)
34
+ self.assertGreater(sensor_list.get_count(), 0)
35
+ for i in range(sensor_list.get_count()):
36
+ sensor = sensor_list.get_sensor_by_index(i)
37
+ self.assertIsNotNone(sensor)
38
+ self.assertIsNotNone(sensor.get_type())
39
+ print(sensor)
40
+
41
+ def test_get_depth_work_mode_list(self):
42
+ if not self.device.is_property_supported(OBPropertyID.OB_STRUCT_CURRENT_DEPTH_ALG_MODE,
43
+ OBPermissionType.PERMISSION_READ_WRITE):
44
+ print("Current device not support depth work mode!")
45
+ return
46
+ current_depth_work_mode = self.device.get_depth_work_mode()
47
+ self.assertIsNotNone(current_depth_work_mode)
48
+ print("Current depth work mode: ", current_depth_work_mode)
49
+ depth_work_mode_list = self.device.get_depth_work_mode_list()
50
+ self.assertIsNotNone(depth_work_mode_list)
51
+ self.assertGreater(depth_work_mode_list.get_count(), 0)
52
+ select_depth_work_mode = None
53
+ for i in range(depth_work_mode_list.get_count()):
54
+ depth_work_mode = depth_work_mode_list.get_depth_work_mode_by_index(i)
55
+ self.assertIsNotNone(depth_work_mode)
56
+ print(depth_work_mode)
57
+ if depth_work_mode != current_depth_work_mode:
58
+ select_depth_work_mode = depth_work_mode
59
+ if select_depth_work_mode is not None:
60
+ self.device.set_depth_work_mode(select_depth_work_mode)
61
+ self.assertEqual(select_depth_work_mode, self.device.get_depth_work_mode())
62
+ self.device.set_depth_work_mode(current_depth_work_mode)
63
+ self.assertEqual(current_depth_work_mode, self.device.get_depth_work_mode())
64
+
65
+ self.device.set_depth_work_mode(current_depth_work_mode)
66
+
67
+ def test_get_calib_camera_params(self):
68
+ calib_camera_params_list = self.device.get_calibration_camera_param_list()
69
+ self.assertIsNotNone(calib_camera_params_list)
70
+ self.assertGreater(calib_camera_params_list.get_count(), 0)
71
+ for i in range(calib_camera_params_list.get_count()):
72
+ calib_camera_params = calib_camera_params_list.get_camera_param(i)
73
+ self.assertIsNotNone(calib_camera_params)
74
+ print(calib_camera_params)
75
+
76
+ def test_get_temperature(self):
77
+ temperature = self.device.get_temperature()
78
+ self.assertIsNotNone(temperature)
79
+ print("Device temperature: ", temperature)
80
+
81
+
82
+ if __name__ == '__main__':
83
+ print("Start test Device interface, Please make sure you have connected a device to your computer.")
84
+ unittest.main()
@@ -0,0 +1,47 @@
1
+ import unittest
2
+ from pyorbbecsdk import *
3
+
4
+
5
+ class PipelineTest(unittest.TestCase):
6
+
7
+ def setUp(self) -> None:
8
+ self.context = Context()
9
+ device_list = self.context.query_devices()
10
+ self.assertIsNotNone(device_list)
11
+ self.assertGreater(device_list.get_count(), 0)
12
+ self.device = device_list.get_device_by_index(0)
13
+ self.assertIsNotNone(self.device)
14
+ self.pipeline = Pipeline(self.device)
15
+ self.assertIsNotNone(self.pipeline)
16
+
17
+ def tearDown(self) -> None:
18
+ self.pipeline = None
19
+ self.device = None
20
+ self.context = None
21
+
22
+ def test_get_device_info(self):
23
+ device_info = self.device.get_device_info()
24
+ self.assertIsNotNone(device_info)
25
+ self.assertIsNotNone(device_info.get_name())
26
+ self.assertIsNotNone(device_info.get_pid())
27
+ self.assertIsNotNone(device_info.get_vid())
28
+ self.assertIsNotNone(device_info.get_serial_number())
29
+ self.assertIsNotNone(device_info.get_firmware_version())
30
+ self.assertIsNotNone(device_info.get_hardware_version())
31
+ self.assertIsNotNone(device_info.get_connection_type())
32
+ self.assertIsNotNone(device_info.get_device_type())
33
+ print("Device info: ", device_info)
34
+
35
+ def test_get_camera_param(self):
36
+ camera_param = self.pipeline.get_camera_param()
37
+ self.assertIsNotNone(camera_param)
38
+ print(camera_param.depth_intrinsic)
39
+ print(camera_param.rgb_intrinsic)
40
+ print(camera_param.depth_distortion)
41
+ print(camera_param.rgb_distortion)
42
+ print(camera_param.transform)
43
+
44
+
45
+ if __name__ == '__main__':
46
+ print("Start test Pipeline interface, Please make sure you have connected a device to your computer.")
47
+ unittest.main()