py3dcal 1.0.0__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.
Files changed (44) hide show
  1. py3DCal/__init__.py +12 -0
  2. py3DCal/data_collection/Calibrator.py +298 -0
  3. py3DCal/data_collection/Printers/Ender3/Ender3.py +82 -0
  4. py3DCal/data_collection/Printers/Ender3/__init__.py +0 -0
  5. py3DCal/data_collection/Printers/Printer.py +63 -0
  6. py3DCal/data_collection/Printers/__init__.py +0 -0
  7. py3DCal/data_collection/Sensors/DIGIT/DIGIT.py +47 -0
  8. py3DCal/data_collection/Sensors/DIGIT/__init__.py +0 -0
  9. py3DCal/data_collection/Sensors/DIGIT/default.csv +1222 -0
  10. py3DCal/data_collection/Sensors/GelsightMini/GelsightMini.py +45 -0
  11. py3DCal/data_collection/Sensors/GelsightMini/__init__.py +0 -0
  12. py3DCal/data_collection/Sensors/GelsightMini/default.csv +1210 -0
  13. py3DCal/data_collection/Sensors/Sensor.py +35 -0
  14. py3DCal/data_collection/Sensors/__init__.py +0 -0
  15. py3DCal/data_collection/__init__.py +0 -0
  16. py3DCal/model_training/__init__.py +0 -0
  17. py3DCal/model_training/datasets/DIGIT_dataset.py +75 -0
  18. py3DCal/model_training/datasets/GelSightMini_dataset.py +73 -0
  19. py3DCal/model_training/datasets/__init__.py +3 -0
  20. py3DCal/model_training/datasets/split_dataset.py +38 -0
  21. py3DCal/model_training/datasets/tactile_sensor_dataset.py +82 -0
  22. py3DCal/model_training/lib/__init__.py +0 -0
  23. py3DCal/model_training/lib/add_coordinate_embeddings.py +29 -0
  24. py3DCal/model_training/lib/depthmaps.py +74 -0
  25. py3DCal/model_training/lib/fast_poisson.py +51 -0
  26. py3DCal/model_training/lib/get_gradient_map.py +39 -0
  27. py3DCal/model_training/lib/precompute_gradients.py +61 -0
  28. py3DCal/model_training/lib/train_model.py +96 -0
  29. py3DCal/model_training/lib/validate_device.py +22 -0
  30. py3DCal/model_training/lib/validate_parameters.py +45 -0
  31. py3DCal/model_training/models/__init__.py +1 -0
  32. py3DCal/model_training/models/touchnet.py +211 -0
  33. py3DCal/model_training/touchnet/__init__.py +0 -0
  34. py3DCal/model_training/touchnet/dataset.py +78 -0
  35. py3DCal/model_training/touchnet/touchnet.py +736 -0
  36. py3DCal/model_training/touchnet/touchnet_architecture.py +72 -0
  37. py3DCal/utils/__init__.py +0 -0
  38. py3DCal/utils/utils.py +32 -0
  39. py3dcal-1.0.0.dist-info/LICENSE +21 -0
  40. py3dcal-1.0.0.dist-info/METADATA +29 -0
  41. py3dcal-1.0.0.dist-info/RECORD +44 -0
  42. py3dcal-1.0.0.dist-info/WHEEL +5 -0
  43. py3dcal-1.0.0.dist-info/entry_points.txt +3 -0
  44. py3dcal-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,72 @@
1
+ import torch.nn as nn
2
+ import torch.nn.functional as F
3
+
4
+ class TouchNetArchitecture(nn.Module):
5
+ """
6
+ TouchNetArchitecture: A PyTorch neural network architecture for TouchNet.
7
+ """
8
+ def __init__(self):
9
+ super().__init__()
10
+
11
+ self.conv1 = nn.Conv2d(5, 32, kernel_size=7, padding=3)
12
+ self.bn1 = nn.BatchNorm2d(32)
13
+ self.dropout1 = nn.Dropout2d(0.2)
14
+
15
+ self.conv2 = nn.Conv2d(32, 64, kernel_size=7, padding=3)
16
+ self.bn2 = nn.BatchNorm2d(64)
17
+ self.dropout2 = nn.Dropout2d(0.2)
18
+
19
+ self.conv3 = nn.Conv2d(64, 128, kernel_size=7, padding=3)
20
+ self.bn3 = nn.BatchNorm2d(128)
21
+ self.dropout3 = nn.Dropout2d(0.2)
22
+
23
+ self.conv4 = nn.Conv2d(128, 256, kernel_size=5, padding=2)
24
+ self.bn4 = nn.BatchNorm2d(256)
25
+ self.dropout4 = nn.Dropout2d(0.3)
26
+
27
+ self.conv5 = nn.Conv2d(256, 256, kernel_size=5, padding=2)
28
+ self.bn5 = nn.BatchNorm2d(256)
29
+ self.dropout5 = nn.Dropout2d(0.3)
30
+
31
+ self.conv6 = nn.Conv2d(256, 128, kernel_size=5, padding=2)
32
+ self.bn6 = nn.BatchNorm2d(128)
33
+ self.dropout6 = nn.Dropout2d(0.2)
34
+
35
+ self.conv7 = nn.Conv2d(128, 64, kernel_size=3, padding=1)
36
+ self.bn7 = nn.BatchNorm2d(64)
37
+ self.dropout7 = nn.Dropout2d(0.2)
38
+
39
+ self.conv8 = nn.Conv2d(64, 32, kernel_size=3, padding=1)
40
+ self.bn8 = nn.BatchNorm2d(32)
41
+ self.dropout8 = nn.Dropout2d(0.2)
42
+
43
+ self.conv9 = nn.Conv2d(32, 2, kernel_size=1)
44
+
45
+ def forward(self, x):
46
+ x = F.relu(self.bn1(self.conv1(x)))
47
+ x = self.dropout1(x)
48
+
49
+ x = F.relu(self.bn2(self.conv2(x)))
50
+ x = self.dropout2(x)
51
+
52
+ x = F.relu(self.bn3(self.conv3(x)))
53
+ x = self.dropout3(x)
54
+
55
+ x = F.relu(self.bn4(self.conv4(x)))
56
+ x = self.dropout4(x)
57
+
58
+ x = F.relu(self.bn5(self.conv5(x)))
59
+ x = self.dropout5(x)
60
+
61
+ x = F.relu(self.bn6(self.conv6(x)))
62
+ x = self.dropout6(x)
63
+
64
+ x = F.relu(self.bn7(self.conv7(x)))
65
+ x = self.dropout7(x)
66
+
67
+ x = F.relu(self.bn8(self.conv8(x)))
68
+ x = self.dropout8(x)
69
+
70
+ x = self.conv9(x)
71
+
72
+ return x
File without changes
py3DCal/utils/utils.py ADDED
@@ -0,0 +1,32 @@
1
+ import serial
2
+ import sys
3
+ import glob
4
+
5
+ def list_com_ports():
6
+ """ Prints serial port names
7
+
8
+ :raises EnvironmentError:
9
+ On unsupported or unknown platforms
10
+ """
11
+ if sys.platform.startswith('win'):
12
+ ports = ['COM%s' % (i + 1) for i in range(256)]
13
+ elif sys.platform.startswith('linux') or sys.platform.startswith('cygwin'):
14
+ # this excludes your current terminal "/dev/tty"
15
+ ports = glob.glob('/dev/tty[A-Za-z]*')
16
+ elif sys.platform.startswith('darwin'):
17
+ ports = glob.glob('/dev/tty.*')
18
+ else:
19
+ raise EnvironmentError('Unsupported platform')
20
+
21
+ result = []
22
+ for port in ports:
23
+ try:
24
+ s = serial.Serial(port)
25
+ s.close()
26
+ result.append(port)
27
+ except (OSError, serial.SerialException):
28
+ pass
29
+
30
+ print('Available COM Ports: ', end='')
31
+ print(result)
32
+ print('\n')
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Rohan Kota
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,29 @@
1
+ Metadata-Version: 2.1
2
+ Name: py3dcal
3
+ Version: 1.0.0
4
+ Summary: UNKNOWN
5
+ Home-page: https://github.com/rohankotanu/py3DCal
6
+ Author: Rohan Kota
7
+ Author-email: rohankota2026@u.northwestern.edu
8
+ License: MIT
9
+ Platform: UNKNOWN
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: numpy>=1.0.0
15
+ Requires-Dist: matplotlib>=3.0.0
16
+ Requires-Dist: pandas>=2.0.0
17
+ Requires-Dist: scipy>=1.0.0
18
+ Requires-Dist: torch>=2.0.0
19
+ Requires-Dist: torchvision>=0.23.0
20
+ Requires-Dist: pyserial>=3.0
21
+ Requires-Dist: opencv-python>=4.0.0
22
+ Requires-Dist: pillow>=11.0.0
23
+ Requires-Dist: tqdm>=4.0.0
24
+ Requires-Dist: requests>=2.0.0
25
+ Requires-Dist: scikit-learn>=1.0.0
26
+ Requires-Dist: digit-interface>=0.2.1
27
+
28
+ # For instructions on how to use this library, please visit https://rohankotanu.github.io/3DCal/
29
+
@@ -0,0 +1,44 @@
1
+ py3DCal/__init__.py,sha256=a2eY2WoX_GOmAIlLTi-pmp3Xm4TVpNf_7H__FtQIDh0,697
2
+ py3DCal/data_collection/Calibrator.py,sha256=pxj6gqrQLHTxbMsdUfsUxUgOgY8pLqKarzkYxjpxW58,11496
3
+ py3DCal/data_collection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ py3DCal/data_collection/Printers/Printer.py,sha256=ouqgWuJWk8PPjhTRFwolnupXbE0SzO819LIgw1ug-7s,1628
5
+ py3DCal/data_collection/Printers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ py3DCal/data_collection/Printers/Ender3/Ender3.py,sha256=pkE9Kt-mMH-fpZC5Gl6YyDPAxOdfZxp4Z7s68N7D_is,2239
7
+ py3DCal/data_collection/Printers/Ender3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ py3DCal/data_collection/Sensors/Sensor.py,sha256=i-2BQENm3tezpE0ErpY057pQfeH5F8iufWMbfrRx8_s,801
9
+ py3DCal/data_collection/Sensors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ py3DCal/data_collection/Sensors/DIGIT/DIGIT.py,sha256=1Jc1qXwinsOFjJ6-QUoUcXOBFjG4M6ylnUjbWMe3NSc,1268
11
+ py3DCal/data_collection/Sensors/DIGIT/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ py3DCal/data_collection/Sensors/DIGIT/default.csv,sha256=OqjTE9b5uAEAxrHyjsxS7UyUWHgjO8yWPN0gVbBj7_Q,26728
13
+ py3DCal/data_collection/Sensors/GelsightMini/GelsightMini.py,sha256=1jr9nfpja_19gEflw_o0CGa9JC5Sz2PlhVZNzbBtMKM,1193
14
+ py3DCal/data_collection/Sensors/GelsightMini/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ py3DCal/data_collection/Sensors/GelsightMini/default.csv,sha256=lavPHcJ6o4VkvMvOk7lcdRCp9dOJxg_VrPNayf9zVvM,26449
16
+ py3DCal/model_training/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ py3DCal/model_training/datasets/DIGIT_dataset.py,sha256=wNjmUHr9m_44Yq-KPldjLdWrb6ecpwHnmXmEY8X1DyM,2986
18
+ py3DCal/model_training/datasets/GelSightMini_dataset.py,sha256=EY-6yVj6rCmcIhNeui-ZCmsf14f1-GDXcGL4ZmTToGo,3039
19
+ py3DCal/model_training/datasets/__init__.py,sha256=vqrB177ZXrBmqDnL472EWleJS6Y-BxYEy2Ao9hWWDHc,137
20
+ py3DCal/model_training/datasets/split_dataset.py,sha256=AzNJlTgcXGa9AdHJnVJYNEyv__OuNHZAMB76Haqc-io,1351
21
+ py3DCal/model_training/datasets/tactile_sensor_dataset.py,sha256=O7jEtArQukV-jssXLHEueRiII5hE01kv2OBn0HS82Dc,3246
22
+ py3DCal/model_training/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ py3DCal/model_training/lib/add_coordinate_embeddings.py,sha256=8wit43RIx28IKEB82SnH_Of09FAmiWM3jgOeXpamM1I,1198
24
+ py3DCal/model_training/lib/depthmaps.py,sha256=v-UL7ui8ZMJLMtwVqfrYIecS2KTGjRwPXa7mhFQLztk,2684
25
+ py3DCal/model_training/lib/fast_poisson.py,sha256=Eh0Q_cr6r1MMppZ0xUMnQXpHTnZ-W6VQlwYcRREcN20,2198
26
+ py3DCal/model_training/lib/get_gradient_map.py,sha256=IbCigrK_-6ZkeOSaHZAIhMu2pFmkSpWAaz1EjUtenCM,1438
27
+ py3DCal/model_training/lib/precompute_gradients.py,sha256=zc1uvishZP7PjBWYF2VSrIMCtEkLrTPtLktOTpCh9P8,1860
28
+ py3DCal/model_training/lib/train_model.py,sha256=fxFIfKWp3WA1Aa2IEczKBJCivVyVovj7IW2HqNw5IlE,4016
29
+ py3DCal/model_training/lib/validate_device.py,sha256=P_yFdAa0nj8camlEryol7AVtBos0gMhtalmAVLGwx08,778
30
+ py3DCal/model_training/lib/validate_parameters.py,sha256=lOOw5zg4feQngVElr54Q0SHsF7bhb7-3MFF_iceZNfE,1368
31
+ py3DCal/model_training/models/__init__.py,sha256=FTMTEyUglpRIFJ4hi3Z7y1KdScGDVVg_OxYXip4b8wg,42
32
+ py3DCal/model_training/models/touchnet.py,sha256=JIfhwXX0uIk6UcN2tmCLoiH9il9U2IByjbjYIjQEIqc,8079
33
+ py3DCal/model_training/touchnet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
+ py3DCal/model_training/touchnet/dataset.py,sha256=L2n5mHa_90UeZSLluhDyS7yck5x2WfqaqRSouKFbBc4,2924
35
+ py3DCal/model_training/touchnet/touchnet.py,sha256=c7FyDviwclaAQtak-QY5710r53aiczhvvUAfoizYw24,31236
36
+ py3DCal/model_training/touchnet/touchnet_architecture.py,sha256=CGWodHCezCGVBPrjezj6574Sh0QQwSGWhRckUY8d7Hw,2137
37
+ py3DCal/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
+ py3DCal/utils/utils.py,sha256=hgTyWZuBXfo9lxLnOLd0445Aw2-uARtKGXuBhZmz-Z0,995
39
+ py3dcal-1.0.0.dist-info/LICENSE,sha256=D95ljbgz6PW9niwHP26EWFN77QBvepSCsMKGp0mRVFM,1066
40
+ py3dcal-1.0.0.dist-info/METADATA,sha256=RGWNQiOoZ0vAwjd1jq3mBLJO6eWK0UOEAb2KyrMr9fU,882
41
+ py3dcal-1.0.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
42
+ py3dcal-1.0.0.dist-info/entry_points.txt,sha256=_N1ruxvLEyZmSAaPsCx8kEzbYSJ5bHG5S8bvpua_X5E,59
43
+ py3dcal-1.0.0.dist-info/top_level.txt,sha256=NbatjyXjN_E6UMifZpkx-ohahGQH_ZFvqovwmvU7FMA,8
44
+ py3dcal-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.45.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ list-com-ports = py3DCal:list_com_ports
3
+
@@ -0,0 +1 @@
1
+ py3DCal