py3dcal 1.0.5__py3-none-any.whl
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.
Potentially problematic release.
This version of py3dcal might be problematic. Click here for more details.
- py3DCal/__init__.py +14 -0
- py3DCal/data_collection/Calibrator.py +300 -0
- py3DCal/data_collection/__init__.py +0 -0
- py3DCal/data_collection/printers/Ender3/Ender3.py +82 -0
- py3DCal/data_collection/printers/Ender3/__init__.py +0 -0
- py3DCal/data_collection/printers/Printer.py +63 -0
- py3DCal/data_collection/printers/__init__.py +0 -0
- py3DCal/data_collection/sensors/DIGIT/DIGIT.py +47 -0
- py3DCal/data_collection/sensors/DIGIT/__init__.py +0 -0
- py3DCal/data_collection/sensors/DIGIT/default.csv +1222 -0
- py3DCal/data_collection/sensors/GelsightMini/GelsightMini.py +45 -0
- py3DCal/data_collection/sensors/GelsightMini/__init__.py +0 -0
- py3DCal/data_collection/sensors/GelsightMini/default.csv +1210 -0
- py3DCal/data_collection/sensors/Sensor.py +44 -0
- py3DCal/data_collection/sensors/__init__.py +0 -0
- py3DCal/model_training/__init__.py +0 -0
- py3DCal/model_training/datasets/DIGIT_dataset.py +77 -0
- py3DCal/model_training/datasets/GelSightMini_dataset.py +75 -0
- py3DCal/model_training/datasets/__init__.py +3 -0
- py3DCal/model_training/datasets/split_dataset.py +38 -0
- py3DCal/model_training/datasets/tactile_sensor_dataset.py +83 -0
- py3DCal/model_training/lib/__init__.py +0 -0
- py3DCal/model_training/lib/add_coordinate_embeddings.py +29 -0
- py3DCal/model_training/lib/annotate_dataset.py +422 -0
- py3DCal/model_training/lib/depthmaps.py +82 -0
- py3DCal/model_training/lib/fast_poisson.py +51 -0
- py3DCal/model_training/lib/get_gradient_map.py +39 -0
- py3DCal/model_training/lib/precompute_gradients.py +61 -0
- py3DCal/model_training/lib/train_model.py +96 -0
- py3DCal/model_training/lib/validate_parameters.py +87 -0
- py3DCal/model_training/models/__init__.py +1 -0
- py3DCal/model_training/models/touchnet.py +211 -0
- py3DCal/utils/__init__.py +0 -0
- py3DCal/utils/utils.py +32 -0
- py3dcal-1.0.5.dist-info/LICENSE +21 -0
- py3dcal-1.0.5.dist-info/METADATA +29 -0
- py3dcal-1.0.5.dist-info/RECORD +40 -0
- py3dcal-1.0.5.dist-info/WHEEL +5 -0
- py3dcal-1.0.5.dist-info/entry_points.txt +3 -0
- py3dcal-1.0.5.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from ..Sensor import Sensor
|
|
2
|
+
import cv2
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
import gsdevice
|
|
7
|
+
except:
|
|
8
|
+
pass
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class GelsightMini(Sensor):
|
|
12
|
+
"""
|
|
13
|
+
GelsightMini: A Sensor Class for the GelSight Mini sensor
|
|
14
|
+
"""
|
|
15
|
+
def __init__(self):
|
|
16
|
+
self.name = "GelSight Mini"
|
|
17
|
+
self.x_offset = 108
|
|
18
|
+
self.y_offset = 110
|
|
19
|
+
self.z_offset = 67
|
|
20
|
+
self.z_clearance = 2
|
|
21
|
+
self.max_penetration = 3.5
|
|
22
|
+
self.default_calibration_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "default.csv")
|
|
23
|
+
|
|
24
|
+
def connect(self):
|
|
25
|
+
"""
|
|
26
|
+
Connects to the GelSight Mini sensor.
|
|
27
|
+
"""
|
|
28
|
+
# Code to connect to the sensor
|
|
29
|
+
self.sensor = gsdevice.Camera("GelSight Mini")
|
|
30
|
+
self.sensor.connect()
|
|
31
|
+
|
|
32
|
+
def disconnect(self):
|
|
33
|
+
"""
|
|
34
|
+
Disconnects from the GelSight Mini sensor.
|
|
35
|
+
"""
|
|
36
|
+
# Code to disconnect from the sensor
|
|
37
|
+
self.sensor.stop_video()
|
|
38
|
+
|
|
39
|
+
def capture_image(self):
|
|
40
|
+
"""
|
|
41
|
+
Captures an image from the GelSight Mini sensor.
|
|
42
|
+
"""
|
|
43
|
+
# Code to return an image from the sensor
|
|
44
|
+
image = cv2.cvtColor(self.sensor.get_image(), cv2.COLOR_BGR2RGB)
|
|
45
|
+
return cv2.flip(image, 1)
|
|
File without changes
|