From 1c9954c8ad596c46f7f9e182303348f4ac7a0908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Thu, 31 Oct 2019 16:32:45 +0100 Subject: [PATCH] remove downscaling (crashes on too many iamges) --- rank_photos.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rank_photos.py b/rank_photos.py index 9de4b14..f89d0ab 100755 --- a/rank_photos.py +++ b/rank_photos.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python """ Matplotlib based photo ranking system using the Elo rating system. @@ -93,7 +92,7 @@ class Photo: """ Reads the image, performs rotation, and downsamples. """ - + print(self._filename) #---------------------------------------------------------------------- # read image @@ -112,13 +111,16 @@ class Photo: # dump downsample, just discard columns-n-rows M, N = data.shape[0:2] + print(M) + print(N) MN = max([M,N]) + print(MN) step = int(MN / 800) if step == 0: step = 1 - data = data[ 0:M:step, 0:N:step, :] + #data = data[ 0:M:step, 0:N:step, :] #---------------------------------------------------------------------- # rotate @@ -462,9 +464,9 @@ better photo. ranked_list = table.get_ranked_list() - heading_fmt = "%4d %4.0f %7d %7.2f %s\n" + heading_fmt = "%4d %4.0f %7d %7.2f %s\n" - heading = "Rank Score Matches Win % Filename\n" + heading = "Rank Score Matches Win % Filename\n" fd.write(heading)