liveBook · Manning

SAM

Also called Segment Anything

SAM, or Segment Anything Model, is a pretrained promptable computer-vision model that generates segmentation masks for objects in images.

How 3 Manning books explain it

Deep Learning with PyTorch, Second Edition

A transformer-based image segmentation model designed to generalize to many objects and support prompt-driven, zero-shot mask prediction.

How it is used
Introduces promptable segmentation for locating candidate nodules in CT images before classification.
How deep it goes
Explains the three architecture components and demonstrates pretrained automatic and point-prompted prediction without implementing SAM from scratch.
Examples
Uses an astronaut image for automatic masks, a dog image for point prompts, and CT slices for candidate-nodule masks.
What you can do after
Apply it via the Segment Anything library to generate automatic or point-prompted masks with pretrained weights.

Read how Deep Learning with PyTorch, Second Edition explains SAM →

Deep Learning with Python, Third Edition

A pretrained segmentation model available through KerasHub for prompting-based segmentation tasks.

How it is used
Deploys prompting-based image segmentation when labeled training data or a predefined object-class list is limiting.
How deep it goes
Explains the high-level architecture and demonstrates point and box inference, while deferring prompt-encoder and mask-decoder internals.
Examples
Demonstrates peach, banana, and mango segmentation using foreground points, alternative masks, and an approximate box.
What you can do after
Apply SAM through KerasHub to generate object masks from point or box prompts and inspect alternative predictions.

Read how Deep Learning with Python, Third Edition explains SAM →

Deep Learning with R, Third Edition

Segment Anything is a promptable image-segmentation model that generates segmentation masks from images and user-provided prompts.

How it is used
Applies pretrained promptable segmentation to objects selected by points or boxes.
How deep it goes
Explains inputs, embeddings, and major components while deferring prompt-encoder and mask-decoder details.
Examples
Demonstrates segmenting a mango with a box prompt and displaying the resulting mask.
What you can do after
Apply SAM via KerasHub to generate masks from images and point or box prompts.

Read how Deep Learning with R, Third Edition explains SAM →

What to know first

Related concepts

Questions about SAM

What is SAM?

SAM, or Segment Anything Model, is a pretrained promptable computer-vision model that generates segmentation masks for objects in images.

Which Manning books explain SAM?

Deep Learning with PyTorch, Second Edition, Deep Learning with Python, Third Edition and Deep Learning with R, Third Edition.

What should I know before learning SAM?

Manning books that teach SAM usually introduce computer vision, image segmentation, segmentation mask and classifier first.

What is SAM a kind of?

SAM is a kind of pretrained model. A pretrained model is a machine-learning model whose parameters were learned through prior training before it is used for inference or adapted to a later task.

What are the parts of SAM?

SAM includes image encoder and mask decoder.

What is SAM also called?

SAM is also called Segment Anything.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.