Maybe this is because I'm using a more recent Rasterfairy install, or because I did something wrong in my directory path and sizing setups. But this bit errors for me a the end of the notebook.
for img, grid_pos in tqdm(zip(images, grid_assignment)): 11 print grid_pos ---> 12 idx_x, idx_y = grid_pos 13 x, y = tile_width * idx_x, tile_height * idx_y 14 tile = Image.open(img)
The error is "too many values to unpack". The print statement I added shows it's an array of 2d arrays:
[[ 20. 13.] [ 15. 10.] [ 14. 14.] ..., [ 9. 7.] [ 6. 0.] [ 14. 5.]]
Update - sorry, should have checked into it more -apparently RasterFairy is returning an array of 2 in grid_assignments with the first item being the list you want of the coords:
(array([[ 20., 13.],
[ 15., 10.],
[ 14., 14.],
...,
[ 9., 7.],
[ 6., 0.],
[ 14., 5.]]), (40, 20))
Maybe this is because I'm using a more recent Rasterfairy install, or because I did something wrong in my directory path and sizing setups. But this bit errors for me a the end of the notebook.
for img, grid_pos in tqdm(zip(images, grid_assignment)): 11 print grid_pos ---> 12 idx_x, idx_y = grid_pos 13 x, y = tile_width * idx_x, tile_height * idx_y 14 tile = Image.open(img)
The error is "too many values to unpack". The print statement I added shows it's an array of 2d arrays:[[ 20. 13.] [ 15. 10.] [ 14. 14.] ..., [ 9. 7.] [ 6. 0.] [ 14. 5.]]
Update - sorry, should have checked into it more -apparently RasterFairy is returning an array of 2 in grid_assignments with the first item being the list you want of the coords: (array([[ 20., 13.], [ 15., 10.], [ 14., 14.], ..., [ 9., 7.], [ 6., 0.], [ 14., 5.]]), (40, 20))so grid_assignments[0] works.