py3dcal 1.0.0__py3-none-any.whl → 1.0.3__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.
py3DCal/__init__.py CHANGED
@@ -9,4 +9,5 @@ from .model_training.datasets.split_dataset import split_dataset
9
9
  from .model_training.models.touchnet import SensorType
10
10
  from .model_training.lib.train_model import train_model
11
11
  from .model_training.lib.depthmaps import get_depthmap, save_2d_depthmap, show_2d_depthmap
12
+ from .model_training.lib.fast_poisson import fast_poisson
12
13
  from .utils.utils import list_com_ports
@@ -21,13 +21,15 @@ class DIGIT(TactileSensorDataset):
21
21
  def __init__(self, root: Union[str, Path] = Path("."), download=False, add_coordinate_embeddings=True, subtract_blank=True, transform=None):
22
22
  validate_root(root)
23
23
 
24
- self.dataset_path = os.path.join(root, "digit_calibration_data")
24
+ self.root = root
25
25
 
26
- super().__init__(root=self.dataset_path, add_coordinate_embeddings=add_coordinate_embeddings, subtract_blank=subtract_blank, transform=transform)
26
+ self.dataset_path = os.path.join(self.root, "digit_calibration_data")
27
27
 
28
28
  if download:
29
29
  self._download_dataset()
30
30
 
31
+ super().__init__(root=self.dataset_path, add_coordinate_embeddings=add_coordinate_embeddings, subtract_blank=subtract_blank, transform=transform)
32
+
31
33
  def _download_dataset(self):
32
34
  """
33
35
  Downloads the dataset for either the DIGIT sensor.
@@ -21,13 +21,15 @@ class GelSightMini(TactileSensorDataset):
21
21
  def __init__(self, root: Union[str, Path] = Path("."), download=False, add_coordinate_embeddings=True, subtract_blank=True, transform=None):
22
22
  validate_root(root)
23
23
 
24
- self.dataset_path = os.path.join(root, "gsmini_calibration_data")
24
+ self.root = root
25
25
 
26
- super().__init__(root=self.dataset_path, add_coordinate_embeddings=add_coordinate_embeddings, subtract_blank=subtract_blank, transform=transform)
26
+ self.dataset_path = os.path.join(self.root, "gsmini_calibration_data")
27
27
 
28
28
  if download:
29
29
  self._download_dataset()
30
30
 
31
+ super().__init__(root=self.dataset_path, add_coordinate_embeddings=add_coordinate_embeddings, subtract_blank=subtract_blank, transform=transform)
32
+
31
33
  def _download_dataset(self):
32
34
  """
33
35
  Downloads the dataset for the GelSight Mini sensor.
@@ -2,25 +2,25 @@ import numpy as np
2
2
  from scipy.fftpack import dst
3
3
  from scipy.fftpack import idst
4
4
 
5
- def fast_poisson(Fx, Fy):
5
+ def fast_poisson(Gx, Gy):
6
6
  """
7
7
  Fast Poisson solver for 2D images.
8
8
  Args:
9
- Fx: 2D array of x-derivatives
10
- Fy: 2D array of y-derivatives
9
+ Gx (np.ndarray): 2D array of x-derivatives
10
+ Gy (np.ndarray): 2D array of y-derivatives
11
11
  Returns:
12
- img: 2D array of the solution to the Poisson equation
12
+ depthmap (np.ndarray): 2D array of the solution to the Poisson equation
13
13
  """
14
14
 
15
- height, width = Fx.shape
15
+ height, width = Gx.shape
16
16
 
17
- # Compute the difference of the Fx array in the x-direction to approximate the second derivative in the x-direction (only for interior)
18
- Fxx = Fx[1:-1,1:-1] - Fx[1:-1,:-2]
19
- # Compute the difference of the Fy array in the y-direction to approximate the second derivative in the y-direction (only for interior)
20
- Fyy = Fy[1:-1,1:-1] - Fy[:-2,1:-1]
17
+ # Compute the difference of the Gx array in the x-direction to approximate the second derivative in the x-direction (only for interior)
18
+ Gxx = Gx[1:-1,1:-1] - Gx[1:-1,:-2]
19
+ # Compute the difference of the Gy array in the y-direction to approximate the second derivative in the y-direction (only for interior)
20
+ Gyy = Gy[1:-1,1:-1] - Gy[:-2,1:-1]
21
21
 
22
22
  # Combine the two second derivatives to form the source term for the Poisson equation, g
23
- g = Fxx + Fyy
23
+ g = Gxx + Gyy
24
24
 
25
25
  # Apply the Discrete Sine Transform (DST) to the 2D array g (row-wise transform)
26
26
  g_sinx = dst(g, norm='ortho')
@@ -46,6 +46,6 @@ def fast_poisson(Fx, Fy):
46
46
  # Note: The norm='ortho' option in the DST and IDST ensures that the transforms are orthonormal, maintaining energy conservation in the transforms
47
47
 
48
48
  # Pad the result (which is only for the interior) with 0's at the border because we are assuming fixed boundary conditions
49
- img = np.pad(g_xy, pad_width=1, mode='constant')
49
+ depthmap = np.pad(g_xy, pad_width=1, mode='constant')
50
50
 
51
- return img
51
+ return depthmap
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py3dcal
3
- Version: 1.0.0
3
+ Version: 1.0.3
4
4
  Summary: UNKNOWN
5
5
  Home-page: https://github.com/rohankotanu/py3DCal
6
6
  Author: Rohan Kota
@@ -1,4 +1,4 @@
1
- py3DCal/__init__.py,sha256=a2eY2WoX_GOmAIlLTi-pmp3Xm4TVpNf_7H__FtQIDh0,697
1
+ py3DCal/__init__.py,sha256=NM8ftqmz739vw9q6l8Uo-teuwklAX3Smywf9NSwXSNA,755
2
2
  py3DCal/data_collection/Calibrator.py,sha256=pxj6gqrQLHTxbMsdUfsUxUgOgY8pLqKarzkYxjpxW58,11496
3
3
  py3DCal/data_collection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  py3DCal/data_collection/Printers/Printer.py,sha256=ouqgWuJWk8PPjhTRFwolnupXbE0SzO819LIgw1ug-7s,1628
@@ -14,15 +14,15 @@ py3DCal/data_collection/Sensors/GelsightMini/GelsightMini.py,sha256=1jr9nfpja_19
14
14
  py3DCal/data_collection/Sensors/GelsightMini/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  py3DCal/data_collection/Sensors/GelsightMini/default.csv,sha256=lavPHcJ6o4VkvMvOk7lcdRCp9dOJxg_VrPNayf9zVvM,26449
16
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
17
+ py3DCal/model_training/datasets/DIGIT_dataset.py,sha256=IYRqWDawbTTe4IOVjZuKVr0yVNBe1XLGC6PoDxsTMfo,3017
18
+ py3DCal/model_training/datasets/GelSightMini_dataset.py,sha256=H8Fr_4f3HDHLLl6KshRfqt0FP8-3d4n9XRK0xfPcH0k,3070
19
19
  py3DCal/model_training/datasets/__init__.py,sha256=vqrB177ZXrBmqDnL472EWleJS6Y-BxYEy2Ao9hWWDHc,137
20
20
  py3DCal/model_training/datasets/split_dataset.py,sha256=AzNJlTgcXGa9AdHJnVJYNEyv__OuNHZAMB76Haqc-io,1351
21
21
  py3DCal/model_training/datasets/tactile_sensor_dataset.py,sha256=O7jEtArQukV-jssXLHEueRiII5hE01kv2OBn0HS82Dc,3246
22
22
  py3DCal/model_training/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  py3DCal/model_training/lib/add_coordinate_embeddings.py,sha256=8wit43RIx28IKEB82SnH_Of09FAmiWM3jgOeXpamM1I,1198
24
24
  py3DCal/model_training/lib/depthmaps.py,sha256=v-UL7ui8ZMJLMtwVqfrYIecS2KTGjRwPXa7mhFQLztk,2684
25
- py3DCal/model_training/lib/fast_poisson.py,sha256=Eh0Q_cr6r1MMppZ0xUMnQXpHTnZ-W6VQlwYcRREcN20,2198
25
+ py3DCal/model_training/lib/fast_poisson.py,sha256=wJ5MTkSCxkFU3wUx-zomvIYPcAyEpPZj-LX7JQOx8JE,2252
26
26
  py3DCal/model_training/lib/get_gradient_map.py,sha256=IbCigrK_-6ZkeOSaHZAIhMu2pFmkSpWAaz1EjUtenCM,1438
27
27
  py3DCal/model_training/lib/precompute_gradients.py,sha256=zc1uvishZP7PjBWYF2VSrIMCtEkLrTPtLktOTpCh9P8,1860
28
28
  py3DCal/model_training/lib/train_model.py,sha256=fxFIfKWp3WA1Aa2IEczKBJCivVyVovj7IW2HqNw5IlE,4016
@@ -36,9 +36,9 @@ py3DCal/model_training/touchnet/touchnet.py,sha256=c7FyDviwclaAQtak-QY5710r53aic
36
36
  py3DCal/model_training/touchnet/touchnet_architecture.py,sha256=CGWodHCezCGVBPrjezj6574Sh0QQwSGWhRckUY8d7Hw,2137
37
37
  py3DCal/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
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,,
39
+ py3dcal-1.0.3.dist-info/LICENSE,sha256=D95ljbgz6PW9niwHP26EWFN77QBvepSCsMKGp0mRVFM,1066
40
+ py3dcal-1.0.3.dist-info/METADATA,sha256=vGiIuSBhT17_m0ciZhR066JNydbf0YDYZxVmgCbdA18,882
41
+ py3dcal-1.0.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
42
+ py3dcal-1.0.3.dist-info/entry_points.txt,sha256=_N1ruxvLEyZmSAaPsCx8kEzbYSJ5bHG5S8bvpua_X5E,59
43
+ py3dcal-1.0.3.dist-info/top_level.txt,sha256=NbatjyXjN_E6UMifZpkx-ohahGQH_ZFvqovwmvU7FMA,8
44
+ py3dcal-1.0.3.dist-info/RECORD,,