ml4a / ml4a-ofx

A collection of openFrameworks apps for working with machine learning
http://ml4a.github.io
1.22k stars 279 forks source link

Error with Rasterfairy code in image_tsne.ipynb notebook #13

Closed arnicas closed 5 years ago

arnicas commented 7 years ago

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.

genekogan commented 5 years ago

well this took a long time to respond... i think this has been fixed on latest release.