Skip to content

feat: add a notebook on CNN segmentation and detection with torch - #206

Merged
petercorke merged 2 commits into
mainfrom
feat/torch-notebook
Nov 22, 2026
Merged

petercorke merged 2 commits into
mainfrom
feat/torch-notebook

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

Adds docs/notebooks/torch.ipynb, a notebook on using the toolbox with torch:

  • Semantic segmentation of the Fig 12.7 scene with torchvision's FCN-ResNet50, using Image.tensor and Image.Tensor.
  • Object detection with the Ultralytics YOLO26 nano model, with the boxes and class labels drawn using plot_labelbox.
  • A row for the new notebook (CNNs) in index.ipynb.

Extras in pyproject.toml:

  • torch is now torch and torchvision.
  • New ultralytics extra is ultralytics, torch and torchvision. Ultralytics is AGPL-3.0, so it is a separate extra.
  • all includes all three packages.

Testing

Ran torch.ipynb top to bottom with jupyter nbconvert --execute on a copy, headless (MPLBACKEND=Agg), with torch 2.15.0 and ultralytics 8.4.216: no error outputs and no stderr warnings. Not run: in a live ipympl session, on Colab, with a GPU, or on OpenCV 4. The notebook cannot run in JupyterLite, because torch is not in Pyodide, and says so.

This change was reviewed with AI assistance (Claude Code) and the diff has been read by the maintainer.

🤖 Generated with Claude Code

Adds torch.ipynb: semantic segmentation with torchvision's FCN-ResNet50
and object detection with Ultralytics YOLO26, linked from the notebook
index. The torch extra is now torch and torchvision, a new ultralytics
extra adds ultralytics, and all includes all three.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@petercorke
petercorke merged commit 4de883f into main Nov 22, 2026
34 checks passed
@petercorke
petercorke deleted the feat/torch-notebook branch November 22, 2026 00:51
@github-actions github-actions Bot mentioned this pull request Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant