MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / detectFace

Method detectFace

recognition/scripts/drag_and_drop.py:323–334  ·  view source on GitHub ↗
(self, img)

Source from the content-addressed store, hash-verified

321 # detects a face in the image
322 # img : the input image
323 def detectFace(self, img):
324 # the img is upscaled so that it become larger than 512 pix
325 upscale = 512 / max(img.shape[0], img.shape[1])
326 print 'detecting', upscale, img.shape
327 #img = self.improve(img)
328 detected = self.detector(img, upscale)
329 if len(detected) == 0:
330 return None
331
332 face = detected[0]
333 img = img[face.top(): face.bottom(), face.left(): face.right()]
334 return img
335
336 # sets the text of the progress bar
337 def setProgress(self, value, text, wait=10):

Callers 1

dropEventMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected