Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n_tests = 1000
- for i in range(n_tests):
- blocks = divide_img_blocks(np.random.rand(randint(10,1000), randint(10,1000), 3), (randint(2,100), randint(2,100)))
Advertisement
Comments
-
- ValueError Traceback (most recent call last)
- Cell In[79], line 4
- 2 n_tests = 1000
- 3 for i in range(n_tests):
- ----> 4 blocks = divide_img_blocks(np.random.rand(randint(10,1000), randint(10,1000), 3), (randint(2,100), randint(2,100)))
- Cell In[67], line 4, in divide_img_blocks(img, n_blocks)
- 2 horizontal = np.array_split(img, n_blocks[0])
- 3 splitted_img = [np.array_split(block, n_blocks[1], axis=1) for block in horizontal]
- ----> 4 return np.asarray(splitted_img, dtype=np.ndarray).reshape(n_blocks)
- ValueError: could not broadcast input array from shape (10,5,3) into shape (10,)
Add Comment
Please, Sign In to add comment
Advertisement