Deep Learning for Computer Vision Image Classification Object Detection and Face Recognition in Python Jason Brownlee instant download
Deep Learning for Computer Vision Image Classification Object Detection and Face Recognition in Python Jason Brownlee instant download
https://ebookmeta.com/product/deep-learning-for-computer-vision-
image-classification-object-detection-and-face-recognition-in-
python-jason-brownlee/
https://ebookmeta.com/product/deep-learning-for-computer-vision-
image-classification-object-detection-and-face-recognition-in-
python-jason-brownlee-2/
https://ebookmeta.com/product/computer-vision-object-detection-
in-adversarial-vision-1st-edition-bhowmik/
Find Your Way Home (Small Town Dreams #1) 1st Edition
Jackie Ashenden
https://ebookmeta.com/product/find-your-way-home-small-town-
dreams-1-1st-edition-jackie-ashenden/
When the King Comes Home 1st Edition Caroline
Stevermer.
https://ebookmeta.com/product/when-the-king-comes-home-1st-
edition-caroline-stevermer/
https://ebookmeta.com/product/ferment-a-guide-to-the-ancient-art-
of-culturing-foods-from-kombucha-to-sourdough-holly-davis/
https://ebookmeta.com/product/phoenix-reborn-an-alpha-pack-
novella-j-d-tyler/
https://ebookmeta.com/product/migrating-asp-net-microservices-to-
asp-net-core-by-example-1st-edition-iris-classon/
https://ebookmeta.com/product/pediatric-mental-health-a-
compendium-of-aap-clinical-practice-guidelines-and-policies-1st-
edition-american-academy-of-pediatrics-aap/
The Glorious Bastard. 1st Edition Sadie Bosque.
https://ebookmeta.com/product/the-glorious-bastard-1st-edition-
sadie-bosque/
Deep Learning for
Computer Vision
Jason Brownlee
i
Disclaimer
The information contained within this eBook is strictly for educational purposes. If you wish to apply
ideas contained in this eBook, you are taking full responsibility for your actions.
The author has made every effort to ensure the accuracy of the information within this book was
correct at time of publication. The author does not assume and hereby disclaims any liability to any
party for any loss, damage, or disruption caused by errors or omissions, whether such errors or
omissions result from accident, negligence, or any other cause.
No part of this eBook may be reproduced or transmitted in any form or by any means, electronic or
mechanical, recording or by any information storage and retrieval system, without written permission
from the author.
Acknowledgements
Special thanks to my proofreader Sarah Martin and my technical editors Arun Koshy, Andrei
Cheremskoy, and Michael Sanderson.
Copyright
Edition: v1.4
Contents
Copyright i
Contents ii
Preface iii
Introductions v
Welcome v
I Foundations 1
1 Introduction to Computer Vision 3
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Desire for Computers to See . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 What Is Computer Vision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Challenge of Computer Vision . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Tasks in Computer Vision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
ii
CONTENTS iii
IX Conclusions 540
How Far You Have Come 541
Preface
We are awash in images such as photographs, videos, YouTube, Instagram, and increasingly
from live video. Every day, I get questions asking how to develop machine learning models for
image data. Working with images can be challenging as it requires drawing upon knowledge
from diverse domains such as digital signal processing, machine learning, statistics, and these
days, deep learning.
I designed this book to teach you step-by-step how to bring modern deep learning methods
to your computer vision projects. I chose the programming language, programming libraries,
and tutorial topics to give you the skills you need.
Python is the go-to language for applied machine learning and deep learning, both in
terms of demand from employers and employees. This is partially because there is renaissance
Python-based tools for machine learning. I have focused on showing you how to use the best of
breed Python tools for computer vision such as PIL/Pillow, as well as the image handling tools
provided with the Keras deep learning library. Key to getting results is speed of development,
and for this reason, we use the Keras deep learning library as you can define, train, and use
complex deep learning models with just a few lines of Python code. There are three key areas
that you must know when working with image data:
❼ How to handle image data. This includes how to load images, load datasets of image data,
and how to scale image data to make it ready for modeling.
❼ How models work. This mainly includes intuitions for how the layers of a convolutional
neural network operate on images and how to configure these layers.
❼ How to use modern models. This includes both innovations in the model architectures as
well as the specific models used on a variety of different computer vision tasks.
These key topics provide the backbone for the book and the tutorials you will work through.
I believe that after completing this book, you will have the skills that you need to both work
through your own computer vision projects and bring modern deep learning methods to bear.
Jason Brownlee
2019
xi
Introductions
xii
Welcome
Welcome to Deep Learning for Computer Vision. Computer vision is the area of study dedicated
to helping computers see and understand the meaning in digital images such as photographs
and videos. It is an old field of study, up until recently dominated by specialized hand-crafted
methods designed by digital signal processing experts and statistical methods. Within the
last decade, deep learning methods have demonstrated state-of-the-art results on challenging
computer vision tasks such as image classification, object detection, and face recognition. This
book is designed to teach you step-by-step how to bring modern deep learning models to your
own computer vision projects.
❼ You know your way around basic NumPy for array manipulation.
❼ You know your way around basic scikit-learn for machine learning.
❼ You know your way around basic Keras for deep learning.
For some bonus points, perhaps some of the below points apply to you. Don’t panic if they
don’t.
❼ You may know how to work through a predictive modeling problem end-to-end.
❼ You may know a little bit of computer vision such as PIL/Pillow or OpenCV.
This guide was written in the top-down and results-first machine learning style that you’re
used to from MachineLearningMastery.com.
xiii
xiv
❼ About the promise of neural networks and deep learning methods in general for computer
vision problems.
❼ How to load and prepare image data, such as photographs, for modeling using best-of-breed
Python libraries.
❼ How specialized layers for image data work, including 1D and 2D convolutions, max and
average pooling, and intuitions for the impact that each layer has on input data.
❼ How to configure convolutional layers, including aspects such as filter size, stride, and
pooling.
❼ How key modeling innovations for convolutional neural networks work and how to imple-
ment them from scratch, such as VGG blocks, inception models, and resnet modules.
❼ How to develop, tune, evaluate and make predictions with convolutional neural networks
on standard benchmark computer vision datasets for image classification, such as Fashion-
MNIST and CIFAR-10.
❼ How to develop, tune, evaluate, and make predictions with convolutional neural networks on
entirely new datasets for image classification, such as satellite photographs and photographs
of pets.
❼ How to use techniques such as pre-trained models, transfer learning and image augmenta-
tion to accelerate and improve model development.
❼ How to use pre-trained models and develop new models for object recognition tasks, such
as object localization and object detection in photographs, using techniques like R-CNN
and YOLO.
❼ How to use deep learning models for face recognition tasks, such as face identification
and face verification in photographs, using techniques like Google’s FaceNet and Oxford’s
VGGFace.
This book will NOT teach you how to be a research scientist nor all the theory behind why
specific methods work. For that, I would recommend good research papers and textbooks. See
the Further Reading section at the end of each tutorial for a solid starting point.
Change of Kings.
But at last comes a new turn of the wheel to English fortunes.
Cromwell is dead; the Commonwealth is ended; all London is
throwing its cap in the air over the restoration of Charles II. Poor
blind Milton[63] is in hiding and in peril. His name is down among
those accessory to the murder of the King. The ear-cropped Prynne
—who is now in Parliament, and who hates Milton as Milton scorned
Prynne—is very likely hounding on those who would bring the great
poet to judgment. ’Tis long matter of doubt. Past his house near Red
Lion Square the howling mob drag the bodies of Cromwell and
Ireton, and hang them in their dead ghastliness.
Milton, however, makes lucky escape, with only a short term of
prison; but for some time thereafter he was in fear of assassination.
Such a rollicking daredevil, as Scott in his story of Woodstock, has
painted for us in Roger Wildrake (of whom there were many afloat in
those times) would have liked no better fun than to run his rapier
through such a man as John Milton; and in those days he would
have been pardoned for it.
That capital story of Woodstock one should read when they are
upon these times of the Commonwealth. There are, indeed,
anachronisms in it; kings escaping too early or too late, or dying a
little out of time to accommodate the exigencies of the plot; but the
characterization is marvellously spirited; and you see the rakehelly
cavaliers, and the fine old king-ridden knights, and the sour-
mouthed Independents, and the glare and fumes and madness of
the civil war, as you find them in few history pages.
Milton, meanwhile, in his quiet home again, revolves his old
project of a great sacred poem. He taxes every visitor who can, to
read to him in Hebrew, Greek, Latin, Dutch. His bookly appetite is
omnivorous. His daughters have large share of this toil. Poor girls,
they have been little taught, and not wisely. They read what they
read only by rote, and count it severe task-work. Their mother is
long since dead, and a second wife, who lived only for a short time,
dead too. We know very little of that second wife; but she is
embalmed forever in a sonnet, from which I steal this fragment:—
“Methought I saw my late espousèd saint
Brought to me, like Alcestis from the grave;
…
Her face was veiled, yet to my fancied sight
Love, sweetness, goodness in her person shin’d
So clear as in no face with more delight.
But oh, as to embrace me she inclined
I waked, she fled, and day brought back my night.”
The Miltonian reading and the work goes on, but affection, I fear,
does not dominate the household; the daughters overtasked, with
few indulgences, make little rebellions; and the blind, exacting old
man is as unforgiving as the law. Americans should take occasion to
see the great picture by Munkacsy, in the Lenox Gallery, New York,
of Milton dictating Paradise Lost; it is in itself a poem; a dim Puritan
interior; light coming through a latticed window and striking on the
pale, something cadaverous face of the old poet, who sits braced in
his great armchair, with lips set together, and the daughters, in awed
attention, listening or seeming to listen.
I am sorry there is so large room to doubt of the intellectual and
affectionate sympathy existing between them; nevertheless—that it
did not is soberly true; his own harsh speeches, which are of record,
show it; their petulant innuendoes, which are also of record, show it.
Into this clouded household—over which love does not brood so
fondly as we would choose to think—there comes sometimes, with
helpfulness and sympathy, a certain Andrew Marvell, who had been
sometime assistant to Milton in his official duties, and who takes his
turn at the readings, and sees only the higher and better lights that
shine there; and he had written sweet poems of his own, (to which I
shall return) that have kept his name alive, and that will keep it
alive, I think, forever.
There comes also into this home, in these days, very much to the
surprise and angerment of the three daughters, a third wife to the
old poet, after some incredibly short courtship.[64] She is only seven
years the senior of the daughter Anne; but she seems to have been
a sensible young person, not bookishly given, and looking after the
household, while Anne and Mary and Deborah still wait, after a
fashion, upon the student-wants of the poet. In fits of high
abstraction he is now bringing the “Paradise” to a close—not
knowing, or not caring, maybe, for the little bickerings which rise
and rage and die away in the one-sided home.
I cannot stay to characterize his great poem; nor is there need;
immortal in more senses than one; humanity counts for little in it;
one pair of human creatures only, and these looked at, as it were,
through the big end of the telescope; with gigantic, Godlike figures
around one, or colossal demons prone on fiery floods. It is not a
child’s book; to place it in schools as a parsing-book is an atrocity
that I hope is ended. Not, I think, till we have had some fifty years
to view the everlasting fight between good and evil in this world, can
we see in proper perspective the vaster battle which, under Milton’s
imagination, was pictured in Paradise between the same foes. Years
only can so widen one’s horizon as to give room for the
reverberations of that mighty combat of the powers of light and
darkness.
We talk of the organ-music of Milton. The term has its special
significance; it gives hint of that large quality which opens heavenly
spaces with its billows of sound; which translates us; which gives us
a lookout from supreme heights, and so lifts one to the level of his
“Argument.” There is large learning in his great poem—weighty and
recondite; but this spoils no music; great, cumbrous names catch
sonorous vibrations under his modulating touch, and colossal shields
and spears clash together like cymbals. The whole burden of his
knowledges—Pagan, Christian, or Hebraic, lift up and sink away
upon the undulations of his sublime verse, as heavy-laden ships rise
and fall upon some great ground-swell making in from outer seas.
A bookish color is pervading; if he does not steal flowers from
books, he does what is better—he shows the fruit of them. There
are stories of his debt to Cædmon, and still more authentic, of his
debt to the Dutch poet Vondel,[65] and the old Provençal Bishop of
Vienne,[66] who as early as the beginning of the sixth century wrote
on kindred themes. There is hardly room for doubt that Milton not
only knew, but literally translated some of the old Bishop’s fine Latin
lines, and put to his larger usage some of his epithets.
Must we not admit that—in the light of such developments—when
the Puritan poet boasts of discoursing on
Last Days.
The home of Milton in these latter days of his life was often
changed. Now, it was Holborn again; then Jewin Street; then Bunhill
Row; and—one while—for a year or more, when the great plague of
1665 desolated the city, he fled before it to the little village of
Chalfont, some twenty miles distant from London on the Aylesbury
road. There the cottage[67] may still be seen in which he lived, and
the garden in which he walked—but never saw. There, too, is the
latticed window looking on the garden, at which he sat hour by hour,
with the summer winds blowing on him from over honeysuckle beds,
while he brooded, with sightless eyes turned to the sky, upon the
mysteries of fate and foreknowledge.
A young Quaker, Ellwood, perhaps his dearest friend, comes to see
him there, to read to him and to give a helping hand to the old
man’s study; his daughters, too, are at their helpful service; grateful,
maybe, that even the desolation of the plague has given a short
relief from the dingy house in the town and its treadmill labors, and
put the joy of blooming flowers and of singing birds into their
withered hearts.
The year after, which finds them in Bunhill Row again, brings that
great London fire which the Monument now commemorates; they
passing three days and nights upon the edge of that huge tempest
of flame and smoke which devoured nearly two-thirds of London;
the old poet hearing the din and roar and crackle, and feeling upon
his forehead the waves of fierce heat and the showers of cinders—a
scene and an experience which might have given, perhaps, other
color to his pictures of Pandemonium, if his great poem had not
been just now, in these fateful years, completed—completed and
bargained for; £20 were to be paid for it conditionally,[68] in four
payments of £5 each, at a day when London had been decimated by
the plague, and half the city was a waste of ruin and ashes. And to
give an added tint of blackness to the picture, we have to fancy his
three daughters leaving him, as they did, tired of tasks, tired of
wrangling. Anne, the infirm one, who neither read nor wrote, and
Mary, so overworked, and Deborah, the youngest (latterly being very
helpful)—all desert him. They never return. “Undutiful daughters,” he
says to Ellwood; but I think he does not soften toward them, even
when gone. Poor, stern, old man! He would have cut them off by will
from their small shares of inheritance in his estate; but the courts
wisely overruled this. Anne, strangely enough, married—dying
shortly after; Mary died years later, a spinster; and Deborah, who
became Mrs. Clark, had some notice, thirty years later, when it was
discovered that a quiet woman of that name was Milton’s daughter.
But she seems to have been of a stolid make; no poetry, no high
sense of dignity belonging to her; a woman like ten thousand,
whose descendants are now said (doubtfully) to be living
somewhere in India.
But Milton wrought on; his wife Betty, of whom he spoke more
affectionately than ever once of his daughters, humored his poor
fagged appetites of the table. Paradise Regained was in hand; and
later the “Samson Agonistes.” His habits were regular; up at five
o’clock; a chapter of the Hebrew Bible read to him by his daughter
Mary—what time she stayed; an early breakfast, and quiet lonely
contemplation after it (his nephew tells us) till seven. Then work
came, putting Quaker Ellwood to helpful service, or whoever
happened in, and could fathom the reading—this lasting till mid-day
dinner; afterward a walk in his garden (when he had one) for two
hours, in his old gray suit, in which many a time passers-by saw him
sitting at his door. There was singing in later afternoon, when there
was a voice to sing for him; and instrumental music, when his, or a
friendly hand touched the old organ. After supper, a pipe and a glass
of water; always persistently temperate; and then, night and rest.
He attended no church in his later years, finding none in absolute
agreement with his beliefs; sympathizing with the Quakers to a
certain degree, with the orthodox Independents too; but flaming up
at any procrustean laws for faith; never giving over a certain tender
love, I think, for the organ-music and storied splendors of the
Anglican Church; but with a wild, broad freedom of thought chafing
at any ecclesiastic law made by man, that galled him or checked his
longings. His clear, clean intellect—not without its satiric jostlings
and wrestlings—its petulancies and caprices—sought and
maintained, independently, its own relation with God and the
mysterious future.
Our amiable Dr. Channing, with excellent data before him,
demonstrated his good Unitarian faith; but though Milton might have
approved his nice reasonings, I doubt if he would have gone to
church with him. He loved liberty; he could not travel well in double
harness, not even in his household or with the elders. His exalted
range of vision made light of the little aids and lorgnettes which the
conventional teachers held out to him. Creeds and dogmas and
vestments and canons, and all humanly consecrated helps, were but
Jack-o’-lanterns to him, who was swathed all about with the glowing
clouds of glory that rolled in upon his soul from the infinite depths.
In the year 1674—he being then sixty-five years old—on a Sunday,
late at night, he died; and with so little pain that those who were
with him did not know when the end came. He was buried—not in
the great cemetery of Bunhill Fields, close by his house—but beside
his father, in the old parish church of St. Giles, Cripplegate, where he
had been used to go as a boy, and where he had been used to hear
the old burial Office for the Dead—now intoned over his grave
—“Ashes to ashes, dust to dust.” There was no need for the
monument erected to him there in recent years. His poems make a
monument that is read of all the world, and will be read in all times
of the world.
CHAPTER V.
s we launched upon the days of Charles I., in our last talk, we
Andrew Marvell.
When upon the subject of Milton, I made mention of a certain
poet who used to go and see him in his country retirement, and who
was also assistant to him in his duties as Latin Secretary to the
Council. This was Andrew Marvell,[74] a poet of so true a stamp, and
so true a man, that it is needful to know something more of him.
He was son of a preacher at Kingston-upon-Hull (or, by metonomy,
Hull) in the north of England. In a very singular way, the occasion of
his father’s sudden death by drowning (if current tradition may be
trusted) was also the occasion of the young poet’s entrance upon
greatly improved worldly fortune.
The story of it is this, which I tell to fix his memory better in mind.
Opposite his father’s home, on the other bank of the Humber, lived a
lady with an only daughter, the idol of her mother. This daughter
chanced to visit Hull, that she might be present at the baptism of
one of Mr. Marvell’s children. A tempest came up before night, and
the boatmen declared the crossing of the river to be dangerous; but
the young lady, with girlish wilfulness insisted, notwithstanding the
urgence of Mr. Marvell; who, finding her resolved, went with her;
and the sea breaking over the boat both were lost. The despairing
mother found what consolation she could in virtually adopting the
young Andrew Marvell, and eventually bestowing upon him her
whole fortune.
This opened a career to him which he was not slow to follow upon
with diligence and steadiness. Well-taught, well-travelled, well-
mannered, he went up to London, and was there befriended by
those whose friendship insured success. He was liberal in his politics,
beautifully tolerant in religious matters, kept a level head through
the years of Parliamentary rule, and was esteemed and admired by
both Puritans and Royalists. He used a sharp pen in controversy and
wrote many pamphlets, some of which even now might serve as
models for incisive speech; he was witty with the wittiest; was
caustic, humorous; his pages adrip with classicisms; and he had a
delicacy of raillery that amused, and a power of logic that smote
heavily, where blows were in order. He was for a long time member
of Parliament for Hull, and by his honesties of speech and pen, made
himself so obnoxious to the political jackals about Charles’s court—
that he was said to be in danger again and again of assassination;
he finally died under strong (but unfounded) suspicion of poisoning.
Those who knew him described him as “of middling stature,
strong set, roundish face, cherry-cheeked, hazel-eyed, brown-
haired.”[75]
There are dainty poems of his, which should be read, and which
are worth remembering. Take this, for instance, from his Garden,
which was written by him first in Latin, and then rendered thus:
“What wondrous life is this I lead!
Ripe apples drop about my head;
The luscious clusters of a vine
Upon my mouth do crush their wine;
The nectarine and curious peach
Into my hands themselves do reach;
Stumbling on melons, as I pass,
Ensnared with flowers, I fall on grass.
And this other bit, from his “Appleton House” (Nuneaton), still
more full of rural spirit:
“How safe, methinks, and strong behind
These trees, have I encamped my mind,
Where beauty aiming at the heart
Bends in some tree its useless dart,
And where the world no certain shot
Can make, or me it toucheth not.
Author of Hudibras.
It is altogether a different, and a far less worthy character that I
now bring to the notice of the reader. The man is Samuel Butler,[76]
and the book Hudibras—a jingling, doggerel poem, which at the time
of its publication had very great vogue in London, and was the
literary sensation of the hour in a court which in those same
years[77] had received the great epic of Milton without any
noticeable ripple of applause.
For myself, I have no great admiration for Hudibras, or for Mr.
Samuel Butler. He was witty, and wise in a way, and coarse, and had
humor; but he was of a bar-room stamp, and although he could
make a great gathering of the court people stretch their sides with
laughter, it does not appear that he had any high sense of honor, or
much dignity of character.
Mr. Pepys (whose memoirs you have heard of, and of whom we
shall have more to tell) says that he bought the book one day in the
Strand because everybody was talking of it—which is the only reason
a good many people have for buying books; and, he continues—that
having dipped into it, without finding much benefit, he sold it next
day in the Strand for half-price. But poor Mr. Pepys, in another and
later entry, says, “I have bought Hudibras again; everybody does
talk so much of it;” which is very like Mr. Pepys, and very like a good
many other buyers of books.
Hudibras is, in fact, a great, coarse, rattling, witty lunge at the
stiff-neckedness and the cropped heads of the Puritans, which the
roistering fellows about the palace naturally enjoyed immensely. He
calls the Presbyterians,
“Such, as do build their faith upon
The holy text of pike and gun;
Decide all controversies
By infallible artillery;
And prove their doctrines orthodox
By apostolic blows and knocks;
Call fire and sword and desolation
A godly, thorough reformation,
Which always must be going on
And still be doing—never done;
As if Religion were intended
For nothing else but to be mended.
A sect whose chief devotion lies
In odd, perverse antipathies,
In falling out with that or this,
And finding somewhat still amiss.
Samuel Pepys.
I had occasion just now to speak of the Pepys Diary, and promised
later and further talk about its author, whom we now put in focus,
and shall pour what light we can upon him.[80]
He was a man of fair personal appearance and great self-approval,
the son of a well-to-do London tailor, and fairly educated; but the
most piquant memorial of his life at Cambridge University is the
“admonition”—which is of record—of his having been on one
occasion “scandalously over-served with drink.” In his after life in
London he escaped the admonitions; but not wholly the “over-
service” in ways of eating and drinking.
Pepys was a not far-off kinsman of Lord Sandwich (whom he
strongly resembled), and it was through that dignitary’s influence
that he ultimately came into a very good position in connection with
the Admiralty, where he was most intrepid in his examination of tar
and cordage, and brought such close scrutiny to his duties as to
make him an admirable official in the Naval Department under
Charles II. For this service, however, he would never have been
heard of, any more than another straightforward, plodding clerk; nor
would he have been heard of for his book about naval matters,
which you will hardly find in any library in the country. But he did
write a Diary, which you will find everywhere.
It is a Diary which, beginning in 1660, the first of Charles’ reign,
covers the ten important succeeding years; within which he saw
regicides hung and quartered, and heard the guns of terrific naval
battles with the Dutch, and braved all the horrors of the Great
Plague from the day when he first saw house-doors with a red cross
marked on them, and the words “Lord, have mercy on us!” to the
time when ten thousand died in a week, and “little noise was heard,
day or night, but tolling of bells.” Page after page of his Diary is also
given to the great fire of the following year—from the Sunday night
when he was waked by his maid to see a big light on the back side
of Mark Lane, to the following Thursday when two-thirds of the
houses and of the churches of London were in ashes.
But Pepys’ Diary is not so valued for its story of great events as for
its daily setting down of little unimportant things—of the plays which
he saw acted—of the dust that fell on the theatre-goers from the
galleries—of what he bought, and what he conjectured, and what his
wife said to him, and what new dresses she had, and how he slept
comfortably through the sermon of Dr. So-and-So—just as you and I
might have done—never having a thought either that his Diary
would ever be printed. He wrote it, in fact, in a blind short-hand,
which made it lie unnoticed and undetected for a great many years,
until at last some prying Cambridge man unriddled his cipher and
wrote out and published Pepys’ Diary to the world. And it is
delightful; it is so true and honest, and straightforward, and gossipy;
and it throws more light upon the every-day life in London in those
days of the Restoration than all the other books ever written.
There have been other diaries which have historic value; there
was Hyde, Earl of Clarendon,[81] with some humor and a lordly
grace, who wrote a History of the Rebellion—more than half diary—
with sentences as long as his pages; but it does not compare with
Pepys’ for flashes of light upon the accidents of life. There was good,
earnest, well-meaning John Evelyn,[82] who had a pretty place called
Says-Court (inherited through his wife) down at Deptford—which
Scott introduces as the residence of Essex in his story of Kenilworth
—who had beautiful trees and flowers there which he greatly loved.
Well, John Evelyn wrote a diary, and a very good one; with perhaps
a better description of the great London fire of 1666 in it than you
will find anywhere else; he gives us, too, a delightful memorial of his
young daughter Mary—who read the Ancients, who spoke French
and Italian, who sang like an angel, who was as gentle and loving as
she was wise and beautiful—whose death “left him desolate;” but
John Evelyn is silent upon a thousand points in respect to which
Pepys bristles all over like a gooseberry bush. Dr. Burnet, too, wrote
a History of his Own Times, bringing great scholarly attainments to
its execution, and a tremendous dignity of authorship; and he would
certainly have turned up his bishop’s nose at mention of Samuel
Pepys; yet Pepys is worth a dozen of him for showing the life of that
day. He is so simple; he is so true; he is so unthinking; he is the
veriest photographer. Hear him for a little—and I take the passages
almost at random:
“November 9, 1660.—Lay long in bed this morning.
“To the office, and thence to dinner at the Hoope
Tavern, given us by Mr. Ady and Mr. Wine the King’s
fishmonger. Good sport with Mr. Talbot, who eats no
sort of fish, and there was nothing else till we sent for
a neat’s tongue.
“Thence I went to Sir Harry Wright’s, where my Lord
was busy at cards, and so I staid below with Mrs.
Carter and Evans, who did give me a lesson upon the
lute, till he came down, and having talked with him at
the door about his late business of money, I went to
my father’s, and staid late talking with my father about
my sister Poll’s coming to live with me—if she would
come and be as a servant (which my wife did seem to
be pretty willing to do to-day); and he seems to take it
very well, and intends to consider of it.”
And again:
“Home by coach, notwithstanding this was the first
day of the King’s proclamation against hackney
coaches coming into the streets to stand to be hired;
yet I got one to carry me home.”
Again:
“11th November, Lord’s Day.—To church into our
new gallery, the first time it was used. There being no
woman this day, we sat in the foremost pew, and
behind us our servants, and I hope it will not always
be so, it not being handsome for our servants to sit so
equal with us. Afterward went to my father’s, where I
found my wife, and there supped; and after supper we
walked home, my little boy carrying a link [torch], and
Will leading my wife. So home and to prayers and to
bed.”
Another day, having been to court, he says:
“The Queene, a very little plain old woman, and
nothing more in any respect than any ordinary woman.
The Princess Henrietta is very pretty, but much below
my expectation; and her dressing of herself with her
haire frizzed short up to her eares did make her seem
so much the less to me. But my wife, standing near
her, with two or three black patches on, and well
dressed, did seem to me much handsomer than she.
Lady Castelmaine not so handsome as once, and
begins to decay; which is also my wife’s opinion.”
One more little extract and I have done:
“Lord’s Day, May 26. After dinner I, by water, alone
to Westminster to the Parish Church, by which I had
the great pleasure of seeing and gazing at a great
many very fine women; and what with that, and
sleeping, I passed away the time till sermon was
done.”
Was there ever anything more ingenuous than that? How
delightfully sure we are that such writing was never intended for
publication!
The great charm of Mr. Pepys and all such diary writing is, that it
gives us, by a hundred little gossipy touches, the actual complexion
of the times. We have no conventional speech to wrestle with, in
order to get at its meaning. The plain white lights of honesty and
common-sense—so much better than all the rhetorical prismatic
hues—put the actual situation before us; and we have an approach
to that realism which the highest art is always struggling to reach.
The courtiers in their great, fresh-curled wigs, strut and ogle and
prattle before us. We scent the perfumed locks of Peter Lely’s ladies,
and the eels frying in the kitchen. We see Mr. Samuel Pepys bowing
to the Princess Henrietta, and know we shall hear of it if he makes a
misstep in backing out of her august presence. How he gloats over
that new plush, or moire-antique, that has just come home for his
wife—cost four guineas—which price shocks him a little, and sends
him to bed vexed, and makes him think he had better have kept by
the old woollen stuff; but, next Lord’s day being bright, and she
wearing it to St. Margaret’s or St. Giles’, where he watches her as
she sits under the dull fire of the sermon—her face beaming with
gratitude, and radiant with red ribbons—he relents, and softens, and
is proud and glad, and goes to sleep! This Pepys stands a good
chance to outlive Butler, and to outlive Burnet, and to outlive
Clarendon, and to outlive John Evelyn.
I may add further to this mention of the old diarist, that at a
certain period of his life he became suspected—and without reason
—of complicity with the Popish plots (of whose intricacies you will
get curious and graphic illustration in Peveril of the Peak); and poor
Pepys had his period of prisonship like so many others in that day.
He also became, at a later time, singularly enough, the President of
the Royal Society of England—a Society formed in the course of
Charles II.s’ reign, and which enrolled such men as Robert Boyle and
Sir Isaac Newton in its early days; and which now enrols the best
and worthiest of England’s scientists.
I do not think they would elect such a man as Samuel Pepys for
President now; yet it would appear that the old gentleman in his
long wig and his new coat made a good figure in the chair, and
looked wise, and used to have the members down informally at his
rooms in York Building, where he made good cheer for them, and
broached his best bin of claret. Nor should it be forgotten that Pepys
had an appreciative ear for the melodies of Chaucer (like very few in
his day), and spurred Dryden to the making of some of his best
imitations.
When he died—it was in the early years of the eighteenth century
—he left his books, manuscripts, and engravings, which were
valuable, to Magdalen College, Cambridge; and there, as I said when
we first came upon his name, his famous Diary, in short-hand, lay
unheard of and unriddled for more than a hundred years.
A Scientist.
Science was making a push for itself in these times. Newton had
discovered the law of gravitation before Charles II. died; the King
himself was no bad dabbler in chemistry.
Robert Boyle, the son of an Earl, and with all moneyed appliances
to help him, was one of the early promoters and founders of the
Royal Society I spoke of; a noticeable man every way in that epoch
of the Ethereges and the Buckinghams and the Gwynnes—devoting
his fortune to worthy works; estimable in private life; dignified and
serene; tall in person and spare—wearing, like every other well-born
Londoner, the curled, long-bottomed wig of France, and making
sentences in exposition of his thought which were longer and stiffer
than his wigs. I give you a sample. He is discussing the eye, and
wants to say that it is wonderfully constructed; and this is the way
he says it:
“To be told that an eye is the organ of sight, and
that this is performed by that faculty of the mind
which, from its function, is called visive, will give a
man but a sorry account of the instruments and
manner of vision itself, or of the knowledge of that
Opificer who, as the Scripture speaks, formed the eye;
and he that can take up with this easy theory of
Vision, will not think it necessary to take the pains to
dissect the eyes of animals, nor study the books of
mathematicians to understand Vision; and accordingly
will have but mean thoughts of the contrivance of the
Organ, and the skill of the Artificer, in comparison of
the ideas that will be suggested of both of them to
him, that being profoundly skilled in anatomy and
optics, by their help takes asunder the several coats,
humors, muscles, of which that exquisite dioptrical
instrument consists; and having separately considered
the size, figure, consistence, texture, diaphaneity or
opacity, situation, and connection of each of them, and
their coaptation in the whole eye, shall discover, by the
help of the laws of optics, how admirably this little
organ is fitted to receive the incident beams of light
and dispose them in the best manner possible for
completing the lively representation of the almost
infinitely various objects of sight.”
What do you think of that for a sentence? If the Fellows of the
Royal Society wrote much in that way (and the Honorable Boyle did
a good deal), is it any wonder that they should have an exaggerated
respect for a man who could express himself in the short, straight
fashion in which Samuel Pepys wrote his Diary?
John Bunyan.
I have a new personage to bring before you out of this hurly-burly
of the Restoration days, and what I have to say of him will close up
our talk for this morning.
I think he did never wear a wig. Buckingham, who courted almost
all orders of men, would not have honored him with a nod of
recognition; nor would Bishop Burnet. I think even the amiable Dr.
Tillotson, or the very liberal Dr. South, would have jostled away from
him in a crowd, rather than toward him. Yet he was more pious than
they; had more humor than Buckingham; and for imaginative power
would outrank every man living in that day, unless we except the
blind old poet Milton. You will guess easily the name I have in mind:
it is John Bunyan.[83] Not a great name then; so vulgar a one indeed
that—a good many years later—the amiable poet Cowper spoke of it
charily. But it is known now and honored wherever English is
spoken.
He was born at Elstow, a mile away from Bedford, amid fat green
meadows, beside which in early May long lines of hawthorn hedges
are all abloom. You will go straight through that pleasant country in
passing from Liverpool to London, if you take, as I counsel you to
do, the Midland Railway; and you will see the lovely rural pictures
which fell under Bunyan’s eye as he strolled along beside the hedge-
rows, from Elstow—a mile-long road—to the grammar-school at
Bedford.
The trees are beautiful thereabout; the grass is as green as
emerald; old cottages are mossy and picturesque; gray towers of
churches hang out a great wealth of ivy boughs; sleek Durham cattle
and trim sheep feed contentedly on the Bedford meadows, and
rooks, cawing, gather into flocks and disperse, and glide down
singly, or by pairs, into the tops of trees that shade country houses.
The aspects have not changed much in all these years; even the
cottage of Bunyan’s tinker father is still there, with only a new front
upon it. The boy received but little schooling, and that at hap-
hazard; but he got much religious teaching from the elders of the
Baptist chapel, or from this or that old Puritan villager. A stern
doctrinal theology overshadowed all his boyish years, full of
threatening, fiery darts, and full of golden streaks of promise.
He was a badish boy—as most boys are; a goodly quantum of
original sin in him; he says, with his tender conscience, that he was
“very bad;” a child of the devil; swearing, sometimes; playing “three
old cat” very often; picking flowers, I dare say, or idly looking at the
rooks of a Sunday. Yet I would engage that the Newhaven High
School would furnish thirty or forty as bad ones as John Bunyan any
day in the year. But he makes good resolves; breaks them again;
finally is convicted, but falters; marries young (and, as would seem,
foolishly, neither bride nor groom being turned of twenty), and she
bringing for sole dower not so much as one dish or spoon, but only
two good books—The Plain Man’s Pathway to Heaven and The
Practice of Piety.
Even before this he had been drafted for service in the battles
which were aflame in England—doubtless fighting for the
Commonwealth, as most of his biographers[84] allege. Very probably,
too, he was under orders of that Sir Samuel Luke, who lived near by,
and who—as I have mentioned—was the butt of much of Samuel
Butler’s Hudibrastic satire.
Next we hear of him as preacher—not properly sanctioned even
by the non-conforming authorities—but opening that intense
religious talk of his upon whatever and whomsoever would come to
hear. Even his friendly Baptist brothers look doubtfully upon his
irregularities; but he sees only the great golden cross before him in
the skies, and hears only the crackle of the flames in the nethermost
depths below. He is bound to save, in what way he can, those who
will be saved, and to warn, in fearfullest way, those who will be
damned.
Hundreds came to hear this working-man who was so dreadfully
in earnest, and who had no more respect for pulpits or liturgies than
for preaching-places in the woods. It was not strange that he
offended against non-conformist acts, nor strange that, after
accession of Charles II. he came to imprisonment for his illegal
pieties. This prison-life lasted for some twelve years, in the which he
still preached to those who would listen within prison walls, and read
his Bible, and wrought at tagged laces (still a great industry of that
district) for the support of his family, a separation from whom—most
of all from his poor blind daughter Mary—was, he says, like “pulling
the flesh from his bones.” Over and over in that reach of prison-life
he might have been free if he would have promised to abstain from
his irregular preachments, or if he would go over seas to America.
But he would not; he could not forbear to warn whomsoever might
hear, of the fiery pit, and of the days when the heavens should be
opened. He loved not the thought of over-ocean crossing; his duties
lay near; and with all his radicalism he never outlived a gracious
liking for British kingly traditions, and for such ranking of men and
powers as belonged to Levitical story.
Finally, under Charles’ Declaration of Indulgence (1672), which
was intended more for the benefit of ill-used Romanists than for
Non-conformists, Bunyan’s prison-doors were laid open, and he went
to his old work of preaching in public places. There may have been,
as his more recent biographers intimate, a later (1675) short
imprisonment;[85] and this, or some portion of the previous prison-
life, was certainly passed in that ancient Bedford jail, which, only a
few years since, was standing on Bedford bridge, hanging over the
waters of the river Ouse—whose slow current we shall find flowing
again in our story of William Cowper.
And if the whole weight of tradition is not to be distrusted, it was
in this little prison over the river, where passers-by might shout a
greeting to him—that John Bunyan fell into the dreamy fashioning of
that book which has made his name known everywhere, and which
has as fixed a place in the great body of English literature as
Shakespeare’s “Hamlet,” or Spenser’s Faery Queen—I mean the
Pilgrim’s Progress.
But how is it, the reader may ask, that this tinker’s son, who had
so far forgotten his school learning that his wife had to teach him
over again to read and write—how is it that he makes a book which
takes hold on the sympathies of all Christendom, and has a literary
quality that ranks it with the first of allegories?[86]
Mr. Pepys told plainly what we wanted him to tell; but he had
nothing but those trifles which give a color to every-day life to tell of.
If he had undertaken to make a story of a page long, involving
imaginative powers, he would have made a failure of it; and if he
had tried to be eloquent he would have given himself away
deplorably. But this poor brazier (as he calls himself in his last will),
with not one-fourth of his knowledge of the world, with not one-
twentieth of his learning (bald as the old diarist was in this line),
with not one-hundredth part of his self-confidence, makes this
wonderful and charming book of which we are talking. How was it?
Well, there was, first, the great compelling and informing Christian
purpose in him: he was of the Bible all compact; every utterance of
it was a vital truth to him; the fire and the brimstone were real; the
Almighty fatherhood was real; the cross and the passion were real;
the teeming thousands were real, who hustled him on either side
and who were pressing on, rank by rank, in the broad road that
leads to the City of Destruction. The man who believes such things
in the way in which John Bunyan believed them has a tremendous
motive power, which will make itself felt in some shape.
Then that limited schooling of his had kept him to a short
vocabulary of the sharpest and keenest and most telling words.
Rhetoric did not lead him astray after flowers; learning did not tempt
him into far-fetched allusions; literary habit had not spoiled his
simplicities. And again, and chiefest of all, there was a great
imaginative power, coming—not from schools, nor from grammar
teachings—but coming as June days come, and which, breathing
over his pages with an almost divine afflatus, lifted their sayings into
the regions of Poetry.
Therefore and thereby it is that he has fused his thought into such
shape as takes hold on human sympathies everywhere, and his
characters are all live creatures. All these two hundred and twenty
years last past the noble Great-heart has been thwacking away at
Giant Grim and thundering on the walls of Doubting Castle with
blows we hear; and poor, timid Christian has been just as many
years, in the sight of all of us, making his way through pitfalls and
quagmires and Vanity Fairs—hard pressed by Apollyon, and
belabored by Giant Despair—on his steady march toward the
Delectable Mountains and the river of Death, and the shining shores
which lie Beyond.
CHAPTER VI.
here were some unsavory names which crept into the opening