Skip to content

Commit

Permalink
Update infer.py
Browse files Browse the repository at this point in the history
fix deprecated `np.int`
  • Loading branch information
xiazeyu authored Mar 6, 2024
1 parent f56bb0e commit 7ee0868
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 3_Segmentation_Model/paddleseg/core/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def slide_inference(model, im, crop_size, stride):
w_crop, h_crop = crop_size
w_stride, h_stride = stride
# calculate the crop nums
rows = np.int(np.ceil(1.0 * (h_im - h_crop) / h_stride)) + 1
cols = np.int(np.ceil(1.0 * (w_im - w_crop) / w_stride)) + 1
rows = np.int32(np.ceil(1.0 * (h_im - h_crop) / h_stride)) + 1
cols = np.int32(np.ceil(1.0 * (w_im - w_crop) / w_stride)) + 1
# prevent negative sliding rounds when imgs after scaling << crop_size
rows = 1 if h_im <= h_crop else rows
cols = 1 if w_im <= w_crop else cols
Expand Down

0 comments on commit 7ee0868

Please sign in to comment.