Skip to content

Commit

Permalink
Update websocket-server to latest API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Amos committed Dec 31, 2015
1 parent 0326504 commit 4357fdc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions demos/web/websocket-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,16 @@ def processFrame(self, dataURL, identity):
bbs = [bb] if bb is not None else []
for bb in bbs:
# print(len(bbs))
landmarks = align.align(rgbFrame, bb)
alignedFace = align.alignImg("affine", 96, rgbFrame, bb,
landmarks=landmarks)
landmarks = align.findLandmarks(rgbFrame, bb)
alignedFace = align.align(96, rgbFrame, bb, landmarks=landmarks)
if alignedFace is None:
continue

phash = str(imagehash.phash(Image.fromarray(alignedFace)))
if phash in self.images:
identity = self.images[phash].identity
else:
rep = net.forwardImage(alignedFace)
rep = net.forward(alignedFace)
# print(rep)
if self.training:
self.images[phash] = Face(rep, identity)
Expand Down

0 comments on commit 4357fdc

Please sign in to comment.