"docs/source/en/training/create_dataset.md" did not exist on "4bae76e4539c30f68fa4e39c4e492a2155cf81d0"
find_candidate_object_locations.py 472 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)