ratio1 3.4.125__py3-none-any.whl → 3.4.126__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.
- ratio1/_ver.py +1 -1
- ratio1/logging/logger_mixins/computer_vision_mixin.py +12 -4
- {ratio1-3.4.125.dist-info → ratio1-3.4.126.dist-info}/METADATA +1 -1
- {ratio1-3.4.125.dist-info → ratio1-3.4.126.dist-info}/RECORD +7 -7
- {ratio1-3.4.125.dist-info → ratio1-3.4.126.dist-info}/WHEEL +0 -0
- {ratio1-3.4.125.dist-info → ratio1-3.4.126.dist-info}/entry_points.txt +0 -0
- {ratio1-3.4.125.dist-info → ratio1-3.4.126.dist-info}/licenses/LICENSE +0 -0
ratio1/_ver.py
CHANGED
|
@@ -270,10 +270,18 @@ class _ComputerVisionMixin(object):
|
|
|
270
270
|
plt.axis('off')
|
|
271
271
|
fig = plt.gcf()
|
|
272
272
|
fig.canvas.draw()
|
|
273
|
-
data = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
|
|
274
|
-
w, h = fig.canvas.get_width_height()
|
|
275
273
|
try:
|
|
276
|
-
|
|
274
|
+
w, h = fig.canvas.get_width_height()
|
|
275
|
+
if hasattr(fig.canvas, 'tostring_rgb'):
|
|
276
|
+
data = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
|
|
277
|
+
np_img = data.reshape((int(h), int(w), 3))
|
|
278
|
+
elif hasattr(fig.canvas, 'tostring_argb'):
|
|
279
|
+
data = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
|
|
280
|
+
argb = data.reshape((int(h), int(w), 4))
|
|
281
|
+
np_img = argb[:, :, 1:4]
|
|
282
|
+
else:
|
|
283
|
+
rgba = np.asarray(fig.canvas.buffer_rgba())
|
|
284
|
+
np_img = rgba[:, :, :3]
|
|
277
285
|
except Exception as e:
|
|
278
286
|
print(e)
|
|
279
287
|
np_img = None
|
|
@@ -440,4 +448,4 @@ class _ComputerVisionMixin(object):
|
|
|
440
448
|
resized = cv2.resize(image, dim, interpolation = inter)
|
|
441
449
|
|
|
442
450
|
# return the resized image
|
|
443
|
-
return resized
|
|
451
|
+
return resized
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ratio1
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.126
|
|
4
4
|
Summary: `ratio1` or Ration1 SDK is the Python SDK required for client app development for the Ratio1 ecosystem
|
|
5
5
|
Project-URL: Homepage, https://github.com/Ratio1/ratio1_sdk
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/Ratio1/ratio1_sdk/issues
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
ratio1/__init__.py,sha256=YimqgDbjLuywsf8zCWE0EaUXH4MBUrqLxt0TDV558hQ,632
|
|
2
|
-
ratio1/_ver.py,sha256=
|
|
2
|
+
ratio1/_ver.py,sha256=WYlO2MZRg2pVclGXnijRTllaAOkXr7doUQiRB9lTCDY,332
|
|
3
3
|
ratio1/base_decentra_object.py,sha256=iXvAAf6wPnGWzeeiRfwLojVoan-m1e_VsyPzjUQuENo,4492
|
|
4
4
|
ratio1/plugins_manager_mixin.py,sha256=X1JdGLDz0gN1rPnTN_5mJXR8JmqoBFQISJXmPR9yvCo,11106
|
|
5
5
|
ratio1/base/__init__.py,sha256=hACh83_cIv7-PwYMM3bQm2IBmNqiHw-3PAfDfAEKz9A,259
|
|
@@ -87,7 +87,7 @@ ratio1/logging/base_logger.py,sha256=iwNirMP38xEA26K8arwDjHXOjJhjE5q_SHzipjqAQzo
|
|
|
87
87
|
ratio1/logging/small_logger.py,sha256=BoCCEDManhe804zqfykZAvXUu9gV0_2NPebftUMIyPk,2998
|
|
88
88
|
ratio1/logging/logger_mixins/__init__.py,sha256=fmDmGVDV41Dfoafe0yCZxJ_CqxWac4DSM8hO6UZnrcA,641
|
|
89
89
|
ratio1/logging/logger_mixins/class_instance_mixin.py,sha256=x2vr_VrRAzGhjgayPxV9t3XtU-c0VoHZb6cjDbslJM8,2725
|
|
90
|
-
ratio1/logging/logger_mixins/computer_vision_mixin.py,sha256=
|
|
90
|
+
ratio1/logging/logger_mixins/computer_vision_mixin.py,sha256=9IccYDZFnBNEUutymvEdhmStPrhK-XT-B55x7g-sRH8,13567
|
|
91
91
|
ratio1/logging/logger_mixins/datetime_mixin.py,sha256=ORqOW4bxaI0UKLtII8-QhOiHvIfwNfz1irBrdYsOJFA,11264
|
|
92
92
|
ratio1/logging/logger_mixins/download_mixin.py,sha256=ZZ1QuQ7kDcUkxhu65odD2pvBRlogsb8mvEEViIYV_L0,18668
|
|
93
93
|
ratio1/logging/logger_mixins/general_serialization_mixin.py,sha256=bNM-6AsYhKD56v79hvJDgO8un5rHH4IKv1XJ3yksseQ,7424
|
|
@@ -109,8 +109,8 @@ ratio1/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,10
|
|
|
109
109
|
ratio1/utils/config.py,sha256=Elfkl7W4aDMvB5WZLiYlPXrecBncgTxb4hcKhQedMzI,10111
|
|
110
110
|
ratio1/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
|
|
111
111
|
ratio1/utils/oracle_sync/oracle_tester.py,sha256=aJOPcZhtbw1XPqsFG4qYpfv2Taj5-qRXbwJzrPyeXDE,27465
|
|
112
|
-
ratio1-3.4.
|
|
113
|
-
ratio1-3.4.
|
|
114
|
-
ratio1-3.4.
|
|
115
|
-
ratio1-3.4.
|
|
116
|
-
ratio1-3.4.
|
|
112
|
+
ratio1-3.4.126.dist-info/METADATA,sha256=t3oQHfvAkdt0kMhcB3SRpPH4C69QYaO2hlNKzRgFVxw,12256
|
|
113
|
+
ratio1-3.4.126.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
114
|
+
ratio1-3.4.126.dist-info/entry_points.txt,sha256=DR_olREzU1egwmgek3s4GfQslBi-KR7lXsd4ap0TFxE,46
|
|
115
|
+
ratio1-3.4.126.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
|
|
116
|
+
ratio1-3.4.126.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|