From 97679edde00ae1b227da85830cc10aea91fc43e8 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Fri, 8 Feb 2019 19:22:20 +0100 Subject: [PATCH] Speed up image compositing by resizing --- README.md | 4 +++- echoserver.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4c43b5b..c5b0019 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Gender Bias +# Specimens of Discriminatory Composite Portraiture - Gender Differentiation + +hostname: specimensofgender Uses a modified version of Affectivas [cpp-sdk-samples](https://github.com/Affectiva/cpp-sdk-samples/). diff --git a/echoserver.py b/echoserver.py index f3f00a9..4182e2f 100644 --- a/echoserver.py +++ b/echoserver.py @@ -36,8 +36,8 @@ class CompositeHandler(tornado.web.RequestHandler): img1 = os.path.join(output_dir, os.path.basename(img1)) img2 = os.path.join(output_dir, os.path.basename(img2)) - i1 = np.asarray(Image.open(img1).convert('RGBA'), dtype=float) - i2 = np.asarray(Image.open(img2).convert('RGBA'), dtype=float) + i1 = np.asarray(Image.open(img1).resize((200,200)).convert('RGBA'), dtype=float) + i2 = np.asarray(Image.open(img2).resize((200,200)).convert('RGBA'), dtype=float) diffI = blend_modes.difference(i1,i2, opacity=1) noAlpha = diffI[:,:,0:3]