prefab 0.4.6__py3-none-any.whl → 0.4.7__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.
prefab/predictor.py CHANGED
@@ -4,9 +4,11 @@ using machine learning models deployed in the cloud.
4
4
  """
5
5
 
6
6
  import base64
7
+
7
8
  import numpy as np
8
9
  import requests
9
- from cv2 import imencode, imdecode, IMREAD_GRAYSCALE
10
+ from cv2 import IMREAD_GRAYSCALE, imdecode, imencode
11
+
10
12
  from prefab.processor import binarize_hard
11
13
 
12
14
 
@@ -49,6 +51,7 @@ def predict(
49
51
  "device": _encode_image(device),
50
52
  "model_name": model_name,
51
53
  "model_tags": model_tags,
54
+ "binary": binarize,
52
55
  }
53
56
 
54
57
  prediction = _decode_image(
@@ -62,7 +65,11 @@ def predict(
62
65
 
63
66
 
64
67
  def correct(
65
- device: np.ndarray, model_name: str, model_tags: str, binarize: bool = False
68
+ device: np.ndarray,
69
+ model_name: str,
70
+ model_tags: str,
71
+ binarize: bool = True,
72
+ multi_correct: bool = False,
66
73
  ) -> np.ndarray:
67
74
  """
68
75
  Generates a correction for a photonic device using a specified cloud-based ML model.
@@ -84,7 +91,11 @@ def correct(
84
91
  Consult the module's documentation for available tags.
85
92
 
86
93
  binarize : bool, optional
87
- If set to True, the correction will be binarized (default is False).
94
+ If set to True, the correction will be binarized (default is True).
95
+
96
+ multi_correct : bool, optional
97
+ If set to True, the correction will be generated using a iterative approach.
98
+ (default is False).
88
99
 
89
100
  Returns
90
101
  -------
@@ -100,15 +111,14 @@ def correct(
100
111
  "device": _encode_image(device),
101
112
  "model_name": model_name,
102
113
  "model_tags": model_tags,
114
+ "binary": binarize,
115
+ "multi_correct": multi_correct,
103
116
  }
104
117
 
105
118
  correction = _decode_image(
106
119
  requests.post(function_url, json=correct_data, timeout=200)
107
120
  )
108
121
 
109
- if binarize:
110
- correction = binarize_hard(correction)
111
-
112
122
  return correction
113
123
 
114
124
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefab
3
- Version: 0.4.6
3
+ Version: 0.4.7
4
4
  Summary: Machine learning based prediction of photonic device fabrication
5
5
  Project-URL: Homepage, https://github.com/PreFab-Photonics/PreFab
6
6
  Author-email: Dusan Gostimirovic <dusan@prefabphotonics.com>
@@ -545,7 +545,7 @@ Description-Content-Type: text/markdown
545
545
 
546
546
  | Foundry | Process | Latest Version | Latest Dataset | Model Name | Model Tag | Status |
547
547
  | --------- | ---------------------------------------------------------------------------------- | --------------- | ---------------- | ------------- | ----------- | ------ |
548
- | ANT | [NanoSOI](https://www.appliednt.com/nanosoi-fabrication-service/) | v5 (Jun 3 2023) | d4 (Apr 12 2023) | ANT_NanoSOI | v5-d4 | Beta |
548
+ | ANT | [NanoSOI](https://www.appliednt.com/nanosoi-fabrication-service/) | v6 (Nov 24 2023) | d7 (Nov 24 2023) | ANT_NanoSOI | v6-d7 | Beta |
549
549
  | ANT | [SiN (Upper Edge)](https://www.appliednt.com/nanosoi/sys/resources/specs_nitride/) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-upper | Alpha |
550
550
  | ANT | [SiN (Lower Edge)](https://www.appliednt.com/nanosoi/sys/resources/specs_nitride/) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-lower | Alpha |
551
551
  | SiEPICfab | [SOI](https://siepic.ca/fabrication/) | v5 (Jun 3 2023) | d0 (Jun 14 2023) | SiEPICfab_SOI | v5-d0 | Alpha |
@@ -0,0 +1,8 @@
1
+ prefab/__init__.py,sha256=0r0FhWL0XnAE_rq9OuqrNsXNOWjU8eI3-wMvHVDBHWc,1461
2
+ prefab/io.py,sha256=6UBP3KHTLpmcGkShH6ip9IU1RPCoOp5n8kEjeOjBgfk,6024
3
+ prefab/predictor.py,sha256=UnftijiEUlAPEn-kiofD5Fmi3GmwgO5r-ku7JLBH_Y0,4788
4
+ prefab/processor.py,sha256=lmSOTouyFOb8UZo7JLXi78VjdUz6eJoOyPZMn6IKraw,8996
5
+ prefab-0.4.7.dist-info/METADATA,sha256=a9AzQpyVCGOl-fPFq_85e4kmzDKR915_Dh2WQ4tTo4o,35015
6
+ prefab-0.4.7.dist-info/WHEEL,sha256=mRYSEL3Ih6g5a_CVMIcwiF__0Ae4_gLYh01YFNwiq1k,87
7
+ prefab-0.4.7.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
8
+ prefab-0.4.7.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- prefab/__init__.py,sha256=0r0FhWL0XnAE_rq9OuqrNsXNOWjU8eI3-wMvHVDBHWc,1461
2
- prefab/io.py,sha256=6UBP3KHTLpmcGkShH6ip9IU1RPCoOp5n8kEjeOjBgfk,6024
3
- prefab/predictor.py,sha256=BvcmoUuN3g_MNb9IichHMmueqQILnQK7U8LureMXJec,4562
4
- prefab/processor.py,sha256=lmSOTouyFOb8UZo7JLXi78VjdUz6eJoOyPZMn6IKraw,8996
5
- prefab-0.4.6.dist-info/METADATA,sha256=y4BRtxeYUaPIOy2oNHT_G65WuM8PoZKcy5Y_5xgsNBU,35014
6
- prefab-0.4.6.dist-info/WHEEL,sha256=mRYSEL3Ih6g5a_CVMIcwiF__0Ae4_gLYh01YFNwiq1k,87
7
- prefab-0.4.6.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
8
- prefab-0.4.6.dist-info/RECORD,,
File without changes