Speed up image compositing by resizing

This commit is contained in:
Ruben van de Ven 2019-02-08 19:22:20 +01:00
parent c3a7f5e91d
commit 97679edde0
2 changed files with 5 additions and 3 deletions

View file

@ -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/). Uses a modified version of Affectivas [cpp-sdk-samples](https://github.com/Affectiva/cpp-sdk-samples/).

View file

@ -36,8 +36,8 @@ class CompositeHandler(tornado.web.RequestHandler):
img1 = os.path.join(output_dir, os.path.basename(img1)) img1 = os.path.join(output_dir, os.path.basename(img1))
img2 = os.path.join(output_dir, os.path.basename(img2)) img2 = os.path.join(output_dir, os.path.basename(img2))
i1 = np.asarray(Image.open(img1).convert('RGBA'), dtype=float) i1 = np.asarray(Image.open(img1).resize((200,200)).convert('RGBA'), dtype=float)
i2 = np.asarray(Image.open(img2).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) diffI = blend_modes.difference(i1,i2, opacity=1)
noAlpha = diffI[:,:,0:3] noAlpha = diffI[:,:,0:3]