mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Added a Python example for find_candidate_object_locations
This commit is contained in:
parent
bf06ce7185
commit
067e36b505
19
python_examples/find_candidate_object_locations.py
Normal file
19
python_examples/find_candidate_object_locations.py
Normal file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/python
|
||||
# This example shows how to use find_candidate_object_locations()
|
||||
|
||||
import dlib
|
||||
from skimage import io
|
||||
|
||||
image_file = '../examples/faces/2009_004587.jpg'
|
||||
img = io.imread(image_file)
|
||||
|
||||
# Locations of candidate objects will be saved into rects
|
||||
rects = []
|
||||
dlib.find_candidate_object_locations(img, rects, min_size=500)
|
||||
|
||||
windows = []
|
||||
for d in rects:
|
||||
windows.append([d.top(), d.left(), d.bottom(), d.right()])
|
||||
|
||||
print len(windows)
|
||||
print (image_file, windows)
|
Loading…
Reference in New Issue
Block a user