Skip to content

Commit 0dc2407

Browse files
committed
Ensure compatibility with "Python" 3.7.
1 parent 4857576 commit 0dc2407

File tree

3 files changed

+393
-292
lines changed

3 files changed

+393
-292
lines changed

colour_checker_detection/detection/segmentation.py

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -207,42 +207,42 @@ def as_8_bit_BGR_image(image):
207207
>>> image = list(random_triplet_generator(8, random_state=prng))
208208
>>> image = np.reshape(image, [4, 2, 3])
209209
>>> print(image)
210-
[[[ 0.96702984 0.54723225 0.97268436]
211-
[ 0.71481599 0.69772882 0.2160895 ]]
210+
[[[ 0.96702984 0.25298236 0.0089861 ]
211+
[ 0.54723225 0.43479153 0.38657128]]
212212
<BLANKLINE>
213-
[[ 0.97627445 0.00623026 0.25298236]
214-
[ 0.43479153 0.77938292 0.19768507]]
213+
[[ 0.97268436 0.77938292 0.04416006]
214+
[ 0.71481599 0.19768507 0.95665297]]
215215
<BLANKLINE>
216-
[[ 0.86299324 0.98340068 0.16384224]
217-
[ 0.59733394 0.0089861 0.38657128]]
216+
[[ 0.69772882 0.86299324 0.43614665]
217+
[ 0.2160895 0.98340068 0.94897731]]
218218
<BLANKLINE>
219-
[[ 0.04416006 0.95665297 0.43614665]
220-
[ 0.94897731 0.78630599 0.8662893 ]]]
219+
[[ 0.97627445 0.16384224 0.78630599]
220+
[ 0.00623026 0.59733394 0.8662893 ]]]
221221
>>> image = as_8_bit_BGR_image(image)
222222
>>> print(image)
223-
[[[251 195 251]
224-
[128 217 219]]
223+
[[[ 23 137 251]
224+
[167 176 195]]
225225
<BLANKLINE>
226-
[[137 18 252]
227-
[122 228 176]]
226+
[[ 59 228 251]
227+
[250 122 219]]
228228
<BLANKLINE>
229-
[[112 253 238]
230-
[167 23 203]]
229+
[[176 238 217]
230+
[249 253 128]]
231231
<BLANKLINE>
232-
[[176 250 59]
233-
[239 229 249]]]
232+
[[229 112 252]
233+
[239 203 18]]]
234234
>>> as_8_bit_BGR_image(image)
235-
array([[[251, 195, 251],
236-
[128, 217, 219]],
235+
array([[[ 23, 137, 251],
236+
[167, 176, 195]],
237237
<BLANKLINE>
238-
[[137, 18, 252],
239-
[122, 228, 176]],
238+
[[ 59, 228, 251],
239+
[250, 122, 219]],
240240
<BLANKLINE>
241-
[[112, 253, 238],
242-
[167, 23, 203]],
241+
[[176, 238, 217],
242+
[249, 253, 128]],
243243
<BLANKLINE>
244-
[[176, 250, 59],
245-
[239, 229, 249]]], dtype=uint8)
244+
[[229, 112, 252],
245+
[239, 203, 18]]], dtype=uint8)
246246
"""
247247

248248
image = np.asarray(image)
@@ -278,17 +278,17 @@ def adjust_image(image, target_width=WORKING_WIDTH):
278278
>>> image = list(random_triplet_generator(8, random_state=prng))
279279
>>> image = np.reshape(image, [2, 4, 3])
280280
>>> adjust_image(image, 5) # doctest: +ELLIPSIS
281-
array([[[ 0.9823518..., 0.5380895..., 1.0186476...],
282-
[ 0.7563578..., 0.731978 ..., 0.4231120...],
283-
[ 0.8726642..., 0.2936055..., 0.1687892...],
284-
[ 0.8540266..., 0.1457020..., 0.2416218...],
285-
[ 0.4018965..., 0.8263517..., 0.1943257...]],
281+
array([[[ 0.9925326..., 0.2419374..., -0.0139522...],
282+
[ 0.6174496..., 0.3460755..., 0.3189758...],
283+
[ 0.7447774..., 0.6786660..., 0.1652180...],
284+
[ 0.9476451..., 0.6550805..., 0.2609945...],
285+
[ 0.6991505..., 0.1623470..., 1.0120867...]],
286286
<BLANKLINE>
287-
[[ 0.8791320..., 1.0425965..., 0.1503114...],
288-
[ 0.7324403..., 0.1763674..., 0.3189642...],
289-
[ 0.2110148..., 0.4074382..., 0.3919139...],
290-
[ 0.2356165..., 1.0136062..., 0.5616219...],
291-
[ 1.0039447..., 0.7759574..., 0.8924203...]]])
287+
[[ 0.7269885..., 0.8556784..., 0.4049920...],
288+
[ 0.2666564..., 1.0401633..., 0.8238320...],
289+
[ 0.6419699..., 0.5442698..., 0.9082210...],
290+
[ 0.7894426..., 0.1944301..., 0.7906868...],
291+
[-0.0526997..., 0.6236684..., 0.8711482...]]])
292292
"""
293293

294294
width, height = image.shape[1], image.shape[0]

0 commit comments

Comments
 (0)