Skip to content

Commit

Permalink
Merge pull request #19 from biigle/python3
Browse files Browse the repository at this point in the history
Use Python 3
  • Loading branch information
mzur authored May 18, 2020
2 parents df66aaf + bc760d4 commit 9c75b01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/config/color_sort.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
| Path to the Python executable.
*/
'python' => '/usr/bin/python',
'python' => '/usr/bin/python3',

/*
| Path to the sorting script.
Expand Down
6 changes: 3 additions & 3 deletions src/resources/scripts/sort.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from scipy.misc import imread
from PIL import Image
import scipy.spatial.distance
import sys
import json
Expand All @@ -19,8 +19,8 @@ def hex_to_rgb(value):

mdists = []
for path in files:
img = imread(path)
img = np.array(Image.open(path))
mdists.append(np.mean(scipy.spatial.distance.cdist(color, img.reshape(-1, 3))))
idxs = np.argsort(mdists)

print json.dumps(ids[idxs].tolist())
print(json.dumps(ids[idxs].tolist()))

0 comments on commit 9c75b01

Please sign in to comment.