Skip to content

Commit

Permalink
replace numpy.bool with bool 3/N
Browse files Browse the repository at this point in the history
Summary:
numpy.bool is long deprecated and removed starting numpy-1.20.0 [1]. This replaces all references with equivalent `bool` type using the following oneliner:
```
rg '\bnp\.bool\b' -lg '.py' fbcode | xargs perl -pi -e 's,\bnp\.bool\b,bool,'
```
Selected some changes and applied arc lint.

1. https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Reviewed By: florazzz

Differential Revision: D50476847

fbshipit-source-id: 2d96df95b5af5f09aae0b33583f4613105cd10d6
  • Loading branch information
igorsugak authored and facebook-github-bot committed Oct 20, 2023
1 parent 5248206 commit e5bfd3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def adjustExposure(img,back,mask):
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (3, 3))
mask = cv2.dilate(mask, kernel, iterations=10)
mask1 = cv2.dilate(mask, kernel, iterations=300)
msk=mask1.astype(np.float32)/255-mask.astype(np.float32)/255; msk=msk.astype(np.bool)
msk=mask1.astype(np.float32)/255-mask.astype(np.float32)/255; msk=msk.astype(bool)

back_tr=back
back_tr[...,0]=bias_gain(img[...,0],back[...,0],msk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def adjustExposure(img,back,mask):
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (3, 3))
mask = cv2.dilate(mask, kernel, iterations=10)
mask1 = cv2.dilate(mask, kernel, iterations=300)
msk=mask1.astype(np.float32)/255-mask.astype(np.float32)/255; msk=msk.astype(np.bool)
msk=mask1.astype(np.float32)/255-mask.astype(np.float32)/255; msk=msk.astype(bool)

bias=np.zeros((1,3)); gain=np.ones((1,3))

Expand Down

0 comments on commit e5bfd3d

Please sign in to comment.