liveBook · Manning

Preprocessing

As explained in Deep Learning with PyTorch, Second Edition

Data preparation performed before model execution, here separating image and prompt encoding from the main model run.

Preprocessing prepares data and intermediate representations before model execution. Depending on the task, it may encode images and prompts, resize and normalize inputs, or convert them into the model’s expected format. section 15.5 section 15.7.3

Common preprocessing roles include:

  • Encode an image and a text or point prompt into embeddings before combining them in a multimodal model. section 2.4
  • Prepare images and segmentation masks by resizing, normalizing, and converting them to tensors. section 15.7.3
  • Filter noisy captions and generate synthetic captions when preparing training data for image-text learning. section 2.4

Segmentation inputs

A Segformer training loop passes CT-image and mask paths to SegformerImageProcessor, then feeds the resulting pixel values and labels to the model. With SAM, set_image preprocesses a photograph while a point prompt is encoded separately before prediction. section 15.5 section 15.7.3

Figure 2.9 Conceptual diagram of BLIP caption generation
figure

Use the diagram to follow how BLIP separates image encoding from text decoding during caption generation. section 2.4

How Deep Learning with PyTorch, Second Edition covers it

How deep it goes
Demonstrates concrete transformations and embedding preparation but defers detailed model-training and encoding internals.
Examples
Uses BLIP captions, SAM point prompts, CT images, masks, SegformerImageProcessor, and TensorBoard loss tracking.
What you can do after
Apply preprocessing via SegformerImageProcessor or SAM’s image-and-prompt workflow before model inference or training.
How it connects
Connects image encoding, embeddings, prompt encoding, segmentation, training loops, and validation.

Also explained in

Compare how 22 books explain preprocessing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with PyTorch, Second Edition. The section links point to the parts of the book it draws on.