Speed up image compositing by resizing
This commit is contained in:
parent
c3a7f5e91d
commit
97679edde0
2 changed files with 5 additions and 3 deletions
|
@ -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/).
|
||||||
|
|
||||||
|
|
|
@ -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]
|
||||||
|
|
Loading…
Reference in a new issue