Skip to content

Commit 395d67a

Browse files
Merge pull request #1 from jonathanrocher/ENH/create_initial_notebook
Enh/create initial notebook
2 parents f1098c6 + cf28ace commit 395d67a

14 files changed

+65
-3
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
# OS
3+
*.DS_Store
4+
15
# Byte-compiled / optimized / DLL files
26
__pycache__/
37
*.py[cod]

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
# ets_tutorial
2-
Enthought Tool Suite tutorial
2+
This repository contains an Enthought Tool Suite tutorial submitted for the
3+
SciPy2019 conference.
4+
5+
## Tutorial
6+
7+
## Requirements
8+
9+
traits
10+
traitsui
11+
chaco
12+
openCV
13+
14+
## Contributing

ets_tutorial/0_starting_notebook.ipynb

Whitespace-only changes.
368 KB
Loading
963 KB
Loading
226 KB
Loading
641 KB
Loading
432 KB
Loading

face_detect_skimage.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from skimage import data
2+
from skimage.feature import Cascade
3+
4+
import matplotlib.pyplot as plt
5+
from matplotlib import patches
6+
7+
# Load the trained file from the module root.
8+
trained_file = data.lbp_frontal_face_cascade_filename()
9+
10+
# Initialize the detector cascade.
11+
detector = Cascade(trained_file)
12+
13+
img = data.astronaut()
14+
15+
detected = detector.detect_multi_scale(img=img,
16+
scale_factor=1.2,
17+
step_ratio=1,
18+
min_size=(60, 60),
19+
max_size=(123, 123))
20+
21+
plt.imshow(img)
22+
img_desc = plt.gca()
23+
plt.set_cmap('gray')
24+
25+
for patch in detected:
26+
27+
img_desc.add_patch(
28+
patches.Rectangle(
29+
(patch['c'], patch['r']),
30+
patch['width'],
31+
patch['height'],
32+
fill=False,
33+
color='r',
34+
linewidth=2
35+
)
36+
)
37+
38+
plt.show()

0 commit comments

Comments
 (0)